Skip to content

Conversation

owenv
Copy link
Collaborator

@owenv owenv commented Sep 5, 2025

This can be used by SwiftPM to register the toolchain it intends to use with the build service if it's at a nonstandard location

@owenv
Copy link
Collaborator Author

owenv commented Sep 5, 2025

@swift-ci test

@owenv owenv force-pushed the owenv/toolchain-registration branch from a65ecf6 to 3b4e3f4 Compare September 5, 2025 23:26
@owenv
Copy link
Collaborator Author

owenv commented Sep 5, 2025

@swift-ci test

@jakepetroules
Copy link
Collaborator

Why do we need to register toolchains dynamically versus freezing them at Core initialization time? Can you detail here under what circumstances SwiftPM would use this API?

Also note that there is one Core instance in a service per developer-directory, so they can be shared across multiple sessions, and a service level API would seem more appropriate than a session-level API if we're going to add this functionality.

@owenv
Copy link
Collaborator Author

owenv commented Sep 8, 2025

@jakepetroules the main problem I'm trying to solve is that right now, SwiftPM is relying on CC and SWIFT_EXEC overrides instead of properly setting up the toolchainRegistry stack to be selected-toolchain default-toolchain. So, given a SwiftPM UserToolchain, we need to 1. register the toolchain if it's in a nonstandard location and 2. determine its identifier to include in TOOLCHAINS.

I could potentially register the toolchain when the service is brought up but it ends up working a little oddly since in theory a service might have >1 Core. I'll explore some alternatives a bit

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.

2 participants