-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix SYSROOT detection on latest nightly
Rust changed the way the SYSROOT is determined in: rust-lang/rust#103660 Before this change the SYSROOT was determined based on the rustc executable. Now it is determined based on the librustc_driver-*.so file. This pr fixes the detection by copying the library to the derivation as we have done it for the rustc executable.
- Loading branch information
Showing
1 changed file
with
13 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
ggreif
|
||
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 | ||
This comment has been minimized.
Sorry, something went wrong. |
||
cp $RUSTC_DRIVER_PATH $out/lib/ | ||
fi | ||
''; | ||
|
||
# Export the manifest file as part of the nix-support files such | ||
|
This assumes that shared libraries are in ELF format, right? When running this on
darwin
I getpatchelf
is innixpkgs
, but I guess it won't do the right thing on.dylib
s.