Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SYSROOT detection on latest nightly #299

Merged
merged 1 commit into from
Jan 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions rust-overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,20 @@ let
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
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/
fi
'';

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