-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[REPL] When using the default resource directory, prefer loading Swift dylibs from /usr/lib/swift. #22093
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
[REPL] When using the default resource directory, prefer loading Swift dylibs from /usr/lib/swift. #22093
Conversation
@swift-ci please test |
I don't think this is the right way to go. We should always prefer the dylibs in the compiler resource dir; they just might not be present. |
3f7e899
to
7cd22bc
Compare
As discussed in e-mail, I've retargeted this change to 5.0, and we'll do a slightly different version of it for the longer term. |
@swift-ci please test |
Build failed |
Build failed |
llvm::sys::path::append(absolutePath, runtimeLibPathWithName); | ||
auto result = dlopen(absolutePath.c_str(), RTLD_LAZY | RTLD_GLOBAL); | ||
if (result) return result; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we want to be 100% correct here, we still want to search the normal dlopen
paths first, then /usr/lib/swift, then the toolchain. Maybe it's better to modify DarwinToolChains.cpp, which just sets DYLD_LIBRARY_PATH up front.
Or maybe it doesn't matter, because there's not going to be anything in /usr/lib/swift/ that conflicts with someone's own library. Hopefully.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we're OK, as /usr/lib/swift will only contain the stuff that would be bundled with the compiler.
@swift-ci please test |
Build failed |
…maybe we should limit this to Apple platforms? |
That seems wise. The proper long-term fix can be more broad. |
…t dylibs from /usr/lib/swift. rdar://problem/46355503
7cd22bc
to
8358df8
Compare
@swift-ci please test |
Build failed |
Build failed |
rdar://problem/46355503