-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Rustc_driver cann't correctly find codegen dirs with multiple subfolders in libdir. #57014
Comments
Third solution I came up with is if |
The current algorithm was introduced in 884715c |
Search codegen backends based on target libdir instead of sysroot Fixes rust-lang#57014 Fixes cases with custom libdir when it consists of two or more parts.
Search codegen backends based on target libdir instead of sysroot Fixes #57014 Fixes cases with custom libdir when it consists of two or more parts.
This reverts commit 6861426, reversing changes made to cae623c. Should fix tools on windows. Reopens rust-lang#57014
Could this issue be reopened because the PR was reverted? |
While working on #62497 I think, what if move codegen libraries from sysroot libdir to rustc libdir? I think it is more useful because codegen are libraries rustc loads and links itself. |
Triage: Is this still a problem? If yes, can you please provide updated step by step instructions on how to reproduce? Thanks! |
When rust compiled and installed with multiple subfolders in libdir it cann't correctly found directory with codegen-backends. See rust-lang/rust-clippy#3565
https://github.com/rust-lang/rust/blob/master/src/librustc_driver/lib.rs#L302
It would be work if
rustc_driver
was placed in/usr/lib64/librustc_driver-62d9b292bf74f4a6.so
so it get/usr
as sysroot but it placed in/usr/lib64/rust-9999/librustc_driver-62d9b292bf74f4a6.so
so it get incorrect/usr/lib64
.I suppose it could be two possible solutions: The first is about to iterate parents until root will be reached. The second is to calculate number of parents need to be removed with
find_libdir
fromfilesearch.rs
. Which are better or there are some other ways to solve this?P.S. Looks like it doesn't fail for system-wide installed rustc and clippy because
filesearch::get_or_default_sysroot
got correct/usr
sysroot from binaries in/usr/bin
. If them will be moved same way asgcc
in Gentoo it will break as well:The text was updated successfully, but these errors were encountered: