Skip to content

Commit

Permalink
fix builder patch from mozilla#304 (comment)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbeckwith authored and fatho committed Mar 11, 2023
1 parent 78e7239 commit 89bf998
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 @@ -287,20 +287,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 89bf998

Please sign in to comment.