Add target dependencies to the package manifest via Fix-Its #73745
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.
When a module name for a given import declaration cannot be resolved, consult the "available modules" file provided by the Swift package manager to determine whether a module by that name is available something in the package or any of its dependencies.
If so, add a note with a Fix-It to the "no such module" diagnostic that edits the package manifest to introduce the missing target dependencies, e.g.,
Accepting the Fix-It should update the package manifest appropriately, so that building again will succeed in finding the appropriate module.
To support this functionality, there are three new frontend parameters:
-package-manifest <path>
: provides the path to the package manifest file containing the target being built-package-target-name <name>
: provides the name of the target being built within that package manifest file-package-available-modules <path>
: provides the path to a JSON file containing the set of modules that are known to the package, which includes both modules declared within that package as well as any modules provided by the products of imported packages.The Swift Package Manager is responsible for providing these command-line parameters.