rustPlatform.rustVendorSrc: init

This is needed when compiling against rustLibSrc, for example when using
wasm-pack. The upstream Cargo.lock may not include those dependencies.
This commit is contained in:
aleksana
2025-06-25 01:18:58 +08:00
parent 0cbc19a065
commit 453d6b714e
2 changed files with 12 additions and 0 deletions
@@ -51,6 +51,12 @@
inherit runCommand rustc;
};
# Useful when rebuilding std
# e.g. when building wasm with wasm-pack
rustVendorSrc = callPackage ./rust-vendor-src.nix {
inherit runCommand rustc;
};
# Hooks
inherit
(callPackages ../../../build-support/rust/hooks {
@@ -0,0 +1,6 @@
{ runCommand, rustc }:
runCommand "rust-vendor-src" { } ''
tar --strip-components=1 -xzf ${rustc.src}
mv vendor $out
''