-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Pass the correct toolchain path to SwiftBuild #8696
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-ci test |
@swift-ci test windows |
let sessionResult = if toolchainPath.components.contains(where: { $0.hasSuffix(".xctoolchain") }) { | ||
await service.createSession(name: name, developerPath: nil, resourceSearchPaths: packageManagerResourcesDirectory.map { [$0.pathString] } ?? [], cachePath: nil, inferiorProductsPath: nil, environment: nil) | ||
} else { | ||
await service.createSession(name: name, swiftToolchainPath: toolchainPath.pathString, resourceSearchPaths: packageManagerResourcesDirectory.map { [$0.pathString] } ?? [], cachePath: nil, inferiorProductsPath: nil, environment: nil) |
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 went back and forth on whether this should use the toolchain from build params or the toolchain this SwiftPM is installed in. I think I've decided I'm happy with this approach though
try resolveSymlinks(swiftCompilerPath) | ||
.parentDirectory // bin | ||
.parentDirectory // usr | ||
.parentDirectory // <toolchain> |
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.
This probably breaks for some platforms like FreeBSD where there's an expectation of using /usr/local
but will handle that in a future change.
@swift-ci test windows |
@swift-ci test windows self hosted |
@swift-ci test windows |
SwiftBuild can be initialized with either an Xcode-based developer directory for a Swift toolchain based developer directory, pass the right flags to initialize properly based on what kind of toolchain is in use.
5d4c5d7
to
0a9566c
Compare
@swift-ci test |
@swift-ci test windows |
@swift-ci test windows |
Amendment to #8696 which computes the correct path on Windows and FreeBSD, which use different install layouts from the other platforms.
Amendment to #8696 which computes the correct path on Windows and FreeBSD, which use different install layouts from the other platforms.
Amendment to #8696 which computes the correct path on Windows and FreeBSD, which use different install layouts from the other platforms.
SwiftBuild can be initialized with either an Xcode-based developer directory for a Swift toolchain based developer directory, pass the right flags to initialize properly based on what kind of toolchain is in use.