From 368c415a01ee0df1e03682879ee9c396047b588f Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Fri, 28 Jun 2019 20:42:12 +0200 Subject: [PATCH] rustc: don't patch precompiled binaries on darwin This doesn't work anymore since 1.35.0 because the load commands end up being too large, but this is a precompiled binary anyway so it's not really needed or more impure to use the expected system versions. --- .../compilers/rust/binaryBuild.nix | 23 ++++--------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/pkgs/development/compilers/rust/binaryBuild.nix b/pkgs/development/compilers/rust/binaryBuild.nix index 77dba7f9e620..cb2fba96e181 100644 --- a/pkgs/development/compilers/rust/binaryBuild.nix +++ b/pkgs/development/compilers/rust/binaryBuild.nix @@ -31,7 +31,8 @@ rec { license = [ licenses.mit licenses.asl20 ]; }; - buildInputs = [ bash ] ++ stdenv.lib.optional stdenv.isDarwin Security; + buildInputs = [ bash ] + ++ stdenv.lib.optional stdenv.isDarwin Security; postPatch = '' patchShebangs . @@ -53,17 +54,6 @@ rec { "$out/bin/cargo" ''} - ${optionalString (stdenv.isDarwin && bootstrapping) '' - install_name_tool -change /usr/lib/libresolv.9.dylib '${darwin.libresolv}/lib/libresolv.9.dylib' "$out/bin/rustc" - install_name_tool -change /usr/lib/libresolv.9.dylib '${darwin.libresolv}/lib/libresolv.9.dylib' "$out/bin/rustdoc" - install_name_tool -change /usr/lib/libiconv.2.dylib '${darwin.libiconv}/lib/libiconv.2.dylib' "$out/bin/cargo" - install_name_tool -change /usr/lib/libresolv.9.dylib '${darwin.libresolv}/lib/libresolv.9.dylib' "$out/bin/cargo" - install_name_tool -change /usr/lib/libcurl.4.dylib '${stdenv.lib.getLib curl}/lib/libcurl.4.dylib' "$out/bin/cargo" - for f in $out/lib/lib*.dylib; do - install_name_tool -change /usr/lib/libresolv.9.dylib '${darwin.libresolv}/lib/libresolv.9.dylib' "$f" - done - ''} - # Do NOT, I repeat, DO NOT use `wrapProgram` on $out/bin/rustc # (or similar) here. It causes strange effects where rustc loads # the wrong libraries in a bootstrap-build causing failures that @@ -85,7 +75,8 @@ rec { license = [ licenses.mit licenses.asl20 ]; }; - buildInputs = [ makeWrapper bash ] ++ stdenv.lib.optional stdenv.isDarwin Security; + buildInputs = [ makeWrapper bash ] + ++ stdenv.lib.optional stdenv.isDarwin Security; postPatch = '' patchShebangs . @@ -102,12 +93,6 @@ rec { "$out/bin/cargo" ''} - ${optionalString (stdenv.isDarwin && bootstrapping) '' - install_name_tool -change /usr/lib/libiconv.2.dylib '${darwin.libiconv}/lib/libiconv.2.dylib' "$out/bin/cargo" - install_name_tool -change /usr/lib/libresolv.9.dylib '${darwin.libresolv}/lib/libresolv.9.dylib' "$out/bin/cargo" - install_name_tool -change /usr/lib/libcurl.4.dylib '${stdenv.lib.getLib curl}/lib/libcurl.4.dylib' "$out/bin/cargo" - ''} - wrapProgram "$out/bin/cargo" \ --suffix PATH : "${rustc}/bin" '';