-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Refactor Commands
module
#5807
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
Refactor Commands
module
#5807
Conversation
very cool! |
6d2c99f
to
14c4329
Compare
@swift-ci please smoke test |
swiftlang/sourcekit-lsp#650 |
swiftlang/swift#61574 |
Bootstrapping SwiftPM on Windows with "debug" configuration is possible, but in release build it will hit swiftlang/swift-llbuild#844, so this is currently unusable. It’s nice to see SwiftPM being bootstrapped on Windows, in align with other platforms. |
swiftlang/swift#61574 |
Looks like this is an unrelated issue on the CI right now? I also saw it on TSC PRs. |
swiftlang/swift#61574 |
This is an initial step of unwinding the direct dependency of individual commands to a concrete build system implementation, through two major changes: - Adding a new target `DriverSupport` which contains integration with swift-driver that is independent of a concrete build system being used (today mostly `checkSupportedFrontendFlags(flags:fileSystem)` but there could be more in the future) - Adding a new `BuildSystemProvider` API which handles instantiation of a concrete build system. This will e.g. allow creating a `SwiftCommand` which doesn't depend on the `XCBuildSupport` module (which is going to help with #5807) and also provides a way to generally clean up (almost) all callsites from directly interacting with a concrete build system.
Split out #5846 to address the concerns about build system support. |
This is an initial step of unwinding the direct dependency of individual commands to a concrete build system implementation, through two major changes: - Adding a new target `DriverSupport` which contains integration with swift-driver that is independent of a concrete build system being used (today mostly `checkSupportedFrontendFlags(flags:fileSystem)` but there could be more in the future) - Adding a new `BuildSystemProvider` API which handles instantiation of a concrete build system. This will e.g. allow creating a `SwiftCommand` which doesn't depend on the `XCBuildSupport` module (which is going to help with #5807) and also provides a way to generally clean up (almost) all callsites from directly interacting with a concrete build system.
This is an initial step of unwinding the direct dependency of individual commands to a concrete build system implementation, through two major changes: - Adding a new target `DriverSupport` which contains integration with swift-driver that is independent of a concrete build system being used (today mostly `checkSupportedFrontendFlags(flags:fileSystem)` but there could be more in the future) - Adding a new `BuildSystemProvider` API which handles instantiation of a concrete build system. This will e.g. allow creating a `SwiftCommand` which doesn't depend on the `XCBuildSupport` module (which is going to help with #5807) and also provides a way to generally clean up (almost) all callsites from directly interacting with a concrete build system.
This is an initial step of unwinding the direct dependency of individual commands to a concrete build system implementation, through two major changes: - Adding a new target `DriverSupport` which contains integration with swift-driver that is independent of a concrete build system being used (today mostly `checkSupportedFrontendFlags(flags:fileSystem)` but there could be more in the future) - Adding a new `BuildSystemProvider` API which handles instantiation of a concrete build system. This will e.g. allow creating a `SwiftCommand` which doesn't depend on the `XCBuildSupport` module (which is going to help with #5807) and also provides a way to generally clean up (almost) all callsites from directly interacting with a concrete build system.
This is an initial step of unwinding the direct dependency of individual commands to a concrete build system implementation, through two major changes: - Adding a new target `DriverSupport` which contains integration with swift-driver that is independent of a concrete build system being used (today mostly `checkSupportedFrontendFlags(flags:fileSystem)` but there could be more in the future) - Adding a new `BuildSystemProvider` API which handles instantiation of a concrete build system. This will e.g. allow creating a `SwiftCommand` which doesn't depend on the `XCBuildSupport` module (which is going to help with #5807) and also provides a way to generally clean up (almost) all callsites from directly interacting with a concrete build system.
14c4329
to
73137a8
Compare
Commands
module
Simplified this PR a little bit for easier review and updated it based on the refactoring I have done separately. Once this lands, there will be two eventual follow-up PRs:
|
@swift-ci please smoke test |
73137a8
to
20b354a
Compare
@swift-ci please smoke test |
observabilityScope: customObservabilityScope ?? swiftTool.observabilityScope | ||
) | ||
}, | ||
], uniquingKeysWith: { a, b in |
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 is a bit unclear to me, we are merging a map of 1?
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.
We're merging with the providers from defaultBuildSystemProvider
above, right now this doesn't have an effect, but I wanted to keep it forward compatible.
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.
very nice
This is the initial step in reducing the first stage of the bootstrap build. Currently, the initial bootstrap build using CMake is essentially building the entirety of SwiftPM and that is (mostly) because the `Commands` module pulls in everything that SwiftPM possibly offers. This introduces a new `CoreCommands` module which contains the necessary parts for providing a minimal build command using the native build system. This can be used to provide a new `swift-bootstrap` executable which is a minimal version of `swift-build`, but actually doing so will be a separate PR. The Windows build currently relies entirely on CMake, so initally we will not be able to profit much from the minimal build, but this will get us closer to doing so in the future.
20b354a
to
fab38b1
Compare
@swift-ci please smoke test |
This was removed in #5807 before projects had time to migrate. Restore this option until they do.
This was removed in #5807 before projects had time to migrate. Restore this option until they do. rdar://101841334
This is the initial step in reducing the first stage of the bootstrap build. Currently, the initial bootstrap build using CMake is essentially building the entirety of SwiftPM and that is (mostly) because the
Commands
module pulls in everything that SwiftPM possibly offers.This introduces a new
CoreCommands
module which contains the necessary parts for providing a minimal build command using the native build system. This can be used to provide a newswift-bootstrap
executable which is a minimal version ofswift-build
, but actually doing so will be a separate PR.The Windows build currently relies entirely on CMake, so initally we will not be able to profit much from the minimal build, but this will get us closer to doing so in the future.