diff options
author | Alyssa Ross <hi@alyssa.is> | 2023-11-16 12:19:36 +0100 |
---|---|---|
committer | Adam Joseph <54836058+amjoseph-nixpkgs@users.noreply.github.com> | 2023-11-30 09:23:06 +0000 |
commit | 8929ba838fa34da64f1490a4f47209d20c9346be (patch) | |
tree | f329df1105dddf7260e423c54f2354ed8cae772d /pkgs/development/compilers/rust | |
parent | 8b51cdd3bea18e806e3ed63add8e19292dfc84ec (diff) | |
download | nixlib-8929ba838fa34da64f1490a4f47209d20c9346be.tar nixlib-8929ba838fa34da64f1490a4f47209d20c9346be.tar.gz nixlib-8929ba838fa34da64f1490a4f47209d20c9346be.tar.bz2 nixlib-8929ba838fa34da64f1490a4f47209d20c9346be.tar.lz nixlib-8929ba838fa34da64f1490a4f47209d20c9346be.tar.xz nixlib-8929ba838fa34da64f1490a4f47209d20c9346be.tar.zst nixlib-8929ba838fa34da64f1490a4f47209d20c9346be.zip |
rustc: use the wrapper for fastCross sysroot
This avoids having two layers of wrapper for cross rustc.
Diffstat (limited to 'pkgs/development/compilers/rust')
-rw-r--r-- | pkgs/development/compilers/rust/1_74.nix | 2 | ||||
-rw-r--r-- | pkgs/development/compilers/rust/default.nix | 7 | ||||
-rw-r--r-- | pkgs/development/compilers/rust/rustc.nix | 2 |
3 files changed, 7 insertions, 4 deletions
diff --git a/pkgs/development/compilers/rust/1_74.nix b/pkgs/development/compilers/rust/1_74.nix index f8749a8b65c2..163c64c249b7 100644 --- a/pkgs/development/compilers/rust/1_74.nix +++ b/pkgs/development/compilers/rust/1_74.nix @@ -16,7 +16,7 @@ , CoreFoundation, Security, SystemConfiguration , pkgsBuildTarget, pkgsBuildBuild, pkgsBuildHost , makeRustPlatform -, wrapRustc +, wrapRustcWith , llvmPackages_16, llvm_16 } @ args: diff --git a/pkgs/development/compilers/rust/default.nix b/pkgs/development/compilers/rust/default.nix index b70b7ccf6264..d56b6fb9e08e 100644 --- a/pkgs/development/compilers/rust/default.nix +++ b/pkgs/development/compilers/rust/default.nix @@ -18,7 +18,7 @@ , CoreFoundation, Security, SystemConfiguration , pkgsBuildBuild , makeRustPlatform -, wrapRustc +, wrapRustcWith }: let @@ -76,7 +76,10 @@ in # Use boot package set to break cycle inherit (bootstrapRustPackages) cargo rustc rustfmt; }); - rustc = wrapRustc self.rustc-unwrapped; + rustc = wrapRustcWith { + inherit (self) rustc-unwrapped; + sysroot = if fastCross then self.rustc-unwrapped else null; + }; rustfmt = self.callPackage ./rustfmt.nix { inherit Security; inherit (self.buildRustPackages) rustc; diff --git a/pkgs/development/compilers/rust/rustc.nix b/pkgs/development/compilers/rust/rustc.nix index cb74ec11127f..7e365f52ef30 100644 --- a/pkgs/development/compilers/rust/rustc.nix +++ b/pkgs/development/compilers/rust/rustc.nix @@ -169,7 +169,7 @@ in stdenv.mkDerivation (finalAttrs: { python ./x.py --keep-stage=0 --stage=1 install library/std mkdir -v $out/bin $doc $man - makeWrapper ${rustc.unwrapped}/bin/rustc $out/bin/rustc --add-flags "--sysroot $out" + ln -s ${rustc.unwrapped}/bin/rustc $out/bin makeWrapper ${rustc.unwrapped}/bin/rustdoc $out/bin/rustdoc --add-flags "--sysroot $out" ln -s ${rustc.unwrapped}/lib/rustlib/{manifest-rust-std-,}${stdenv.hostPlatform.rust.rustcTargetSpec} $out/lib/rustlib/ echo rust-std-${stdenv.hostPlatform.rust.rustcTargetSpec} >> $out/lib/rustlib/components |