Skip to content

Commit

Permalink
Update rust-overlay.nix
Browse files Browse the repository at this point in the history
  • Loading branch information
ggreif authored Apr 25, 2023
1 parent ca45ac2 commit 3814b72
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions rust-overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ let
name = name + "-" + version;
paths = components;
postBuild = ''
shopt -u nullglob
# If rustc or rustdoc is in the derivation, we need to copy their
# executable into the final derivation. This is required
# for making them find the correct SYSROOT.
Expand All @@ -292,6 +291,7 @@ let
# The SYSROOT is determined by using the librustc_driver-*.{so,dylib}.
# So, we need to point to the *.so files in our derivation.
shopt -u nullglob
if ls $out/lib/*.so &>/dev/null; then
chmod u+w $target
patchelf --set-rpath "$out/lib" $target || true
Expand All @@ -300,11 +300,9 @@ let
# Here we copy the librustc_driver-*.{so,dylib} to our derivation.
# The SYSROOT is determined based on the path of this library.
if ls $out/lib/librustc_driver-*.so $out/lib/librustc_driver-*.dylib; then
RUSTC_DRIVER_PATH=$(realpath -e $out/lib/librustc_driver-*.{so,dylib})
echo SYSROOT: cp --remove-destination $RUSTC_DRIVER_PATH $out/lib/
cp --remove-destination $RUSTC_DRIVER_PATH $out/lib/
fi
RUSTC_DRIVER_PATH=$(realpath -e $out/lib/librustc_driver-*.{so,dylib})
echo SYSROOT: cp --remove-destination $RUSTC_DRIVER_PATH $out/lib/
cp --remove-destination $RUSTC_DRIVER_PATH $out/lib/
'';

# Export the manifest file as part of the nix-support files such
Expand Down

0 comments on commit 3814b72

Please sign in to comment.