-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add toolchain swift stdlib to env when swift run. #8364
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
Conversation
Swift Build doesn't set the rpath of the generated executable to point at the toolchains swift standard library. We shouldn't be hardcoding those paths anyway since that restricts deployment options. Instead we point the LD_LIBRARY_PATH at swift run time to pick them up.
@swift-ci please test |
@swift-ci please test windows |
@@ -242,11 +244,23 @@ public struct SwiftRunCommand: AsyncSwiftCommand { | |||
arguments = options.arguments | |||
} | |||
|
|||
// For Linux, need to point LD_LIBRARY_PATH at the swift runtime | |||
let environment: [String: String]? | |||
if toolchain.targetTriple.isLinux() { |
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.
nit: could be if toolchain.targetTriple.objectFormat == .elf
to cover other relevant platforms as well.
I guess for the platform part of the directory path you could use the OS part of the triple, though it's not guaranteed to be 1:1 for all platforms (e.g. Apple platforms, and Android)
(can also be a follow-on change)
Swift Build doesn't set the rpath of the generated executable to point at the toolchains swift standard library. We shouldn't be hardcoding those paths anyway since that restricts deployment options. Instead we point the LD_LIBRARY_PATH at swift run time to pick them up.