Skip to content

Commit

Permalink
fix builder
Browse files Browse the repository at this point in the history
  • Loading branch information
dbeckwith committed Mar 5, 2023
1 parent 956c6de commit 63cf192
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions rust-overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
'';

Expand Down

0 comments on commit 63cf192

Please sign in to comment.