From 63cf1927c3bd3c88d6db5626f39394923c4b9464 Mon Sep 17 00:00:00 2001 From: Daniel Beckwith Date: Sun, 5 Mar 2023 10:11:53 -0500 Subject: [PATCH] fix builder patch from https://github.com/mozilla/nixpkgs-mozilla/issues/304#issuecomment-1416761163 --- rust-overlay.nix | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/rust-overlay.nix b/rust-overlay.nix index 46543b7..0354451 100644 --- a/rust-overlay.nix +++ b/rust-overlay.nix @@ -290,20 +290,20 @@ let for target in $out/bin/{rustc,rustdoc} $out/lib/rustlib/etc/*.py; do if [ -e $target ]; then cp --remove-destination "$(realpath -e $target)" $target - fi - # The SYSROOT is determined by using the librustc_driver-*.so. - # So, we need to point to the *.so files in our derivation. - chmod u+w $target - patchelf --set-rpath "$out/lib" $target || true + # The SYSROOT is determined by using the librustc_driver-*.so. + # So, we need to point to the *.so files in our derivation. + chmod u+w $target + patchelf --set-rpath "$out/lib" $target || true + fi done # Here we copy the librustc_driver-*.so to our derivation. # The SYSROOT is determined based on the path of this library. - if ls $out/lib/librustc_driver-*.so &> /dev/null; then - RUSTC_DRIVER_PATH=$(realpath -e $out/lib/librustc_driver-*.so) - rm $out/lib/librustc_driver-*.so - cp $RUSTC_DRIVER_PATH $out/lib/ + if ls "$out/lib/librustc_driver-*.so" &> /dev/null; then + RUSTC_DRIVER_PATH="$(realpath -e "$out/lib/librustc_driver-*.so")" + rm "$out/lib/librustc_driver-*.so" + cp "$RUSTC_DRIVER_PATH" $out/lib/ fi '';