aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/development/compilers/rust/binary.nix
diff options
context:
space:
mode:
Diffstat (limited to 'infra/libkookie/nixpkgs/pkgs/development/compilers/rust/binary.nix')
-rw-r--r--infra/libkookie/nixpkgs/pkgs/development/compilers/rust/binary.nix12
1 files changed, 9 insertions, 3 deletions
diff --git a/infra/libkookie/nixpkgs/pkgs/development/compilers/rust/binary.nix b/infra/libkookie/nixpkgs/pkgs/development/compilers/rust/binary.nix
index 9ae7e51e5fef..b84e390e0b0d 100644
--- a/infra/libkookie/nixpkgs/pkgs/development/compilers/rust/binary.nix
+++ b/infra/libkookie/nixpkgs/pkgs/development/compilers/rust/binary.nix
@@ -1,4 +1,4 @@
-{ stdenv, makeWrapper, bash, curl, darwin
+{ stdenv, makeWrapper, bash, curl, darwin, zlib
, version
, src
, platform
@@ -42,17 +42,23 @@ rec {
./install.sh --prefix=$out \
--components=${installComponents}
- ${optionalString (stdenv.isLinux && bootstrapping) ''
+ ${optionalString (stdenv.isLinux && bootstrapping) (''
patchelf \
--set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
"$out/bin/rustc"
+ '' + optionalString (stdenv.lib.versionAtLeast version "1.46")
+ # rustc bootstrap needs libz starting from 1.46
+ ''
+ ln -s ${zlib}/lib/libz.so.1 $out/lib/libz.so.1
+ ln -s ${zlib}/lib/libz.so $out/lib/libz.so
+ '' + ''
patchelf \
--set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
"$out/bin/rustdoc"
patchelf \
--set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
"$out/bin/cargo"
- ''}
+ '')}
# Do NOT, I repeat, DO NOT use `wrapProgram` on $out/bin/rustc
# (or similar) here. It causes strange effects where rustc loads