diff --git a/pkgs/development/compilers/rust/make-rust-platform.nix b/pkgs/development/compilers/rust/make-rust-platform.nix index 29a7e5f95194..1f69bb92e213 100644 --- a/pkgs/development/compilers/rust/make-rust-platform.nix +++ b/pkgs/development/compilers/rust/make-rust-platform.nix @@ -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 { diff --git a/pkgs/development/compilers/rust/rust-vendor-src.nix b/pkgs/development/compilers/rust/rust-vendor-src.nix new file mode 100644 index 000000000000..18d9922e1c6c --- /dev/null +++ b/pkgs/development/compilers/rust/rust-vendor-src.nix @@ -0,0 +1,6 @@ +{ runCommand, rustc }: + +runCommand "rust-vendor-src" { } '' + tar --strip-components=1 -xzf ${rustc.src} + mv vendor $out +''