[Commands] Migrate: Avoid injecting feature settings into every Swift… #8700
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
… module
Motivation:
Previously the feature flags in
:migrate
mode were injected globally into "destination" parameter and affected every module in the graph, this is technically harmless but creates a lot of noise and precludes some of the future optimizations i.e. avoid injecting@concurrent
into some closure literals when context is already@concurrent
.Instead of using build parameters, let's make the
Module.buildSettings
mutable in SwiftPM package and inject feature settings directly intobuildSettings
of the user-requested or all root package modules instead.Modifications:
Module.buildSettings
to be apackage(set) var
instead of alet
to allow for mutation my migration command.Migrate
command to inject the requested upcoming/experimental features in:migrate
mode only into request targets or all non-plugin modules of root packages.Result:
No more global build flags and extraneous warnings from dependency modules that shouldn't have migration enabled.