Skip to content

Initialize Swift Build with a toolchain-based developer directory #8464

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

owenv
Copy link
Contributor

@owenv owenv commented Apr 8, 2025

This allows us to correctly construct the stack of toolchains used for tool/library lookup internally, fixing builds of test targets (among other things).

Depends on swiftlang/swift-build#385

@@ -265,7 +266,11 @@ public final class SwiftBuildSystem: SPMBuildCore.BuildSystem {
)

do {
try await withSession(service: service, name: self.buildParameters.pifManifest.pathString, packageManagerResourcesDirectory: self.packageManagerResourcesDirectory) { session, _ in
let toolchainPath = self.buildParameters.toolchain.swiftCompilerPath
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the toolchain base path should also be part of the Toolchain protocol itself rather than expanded here in SwiftBuildSystem.

Also because on some platforms it's usr/local/bin instead of usr/local, so I'd rather that logic be kept In UserToolchain itself.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's not an obvious way to add that requirement right now because the SwiftPM-level toolchain type conflates toolchains, SDKs, and cross compilation bundles

@owenv owenv force-pushed the owenv/init-swift-toolchain branch from 7bd0ecd to 99f53dc Compare April 9, 2025 20:12
@owenv
Copy link
Contributor Author

owenv commented Apr 9, 2025

@swift-ci test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants