Skip to content
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

Pass the "available modules" for a target down to Swift commands #7581

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

Conversation

DougGregor
Copy link
Member

When the Swift driver can handle it, produce the complete set of modules that are available within a package (either from targets in that package or products of packages it depends on). Provide that set of available modules as a JSON file to the Swift driver so it can reason about modules that are available to the given target. Also provide the package manifest path and the current target name in the package for use by the compiler.

This goes along with swiftlang/swift#73745

When the Swift driver can handle it, produce the complete set of modules
that are available within a package (either from targets in that package or
products of packages it depends on). Provide that set of available modules
as a JSON file to the Swift driver so it can reason about modules that
are available to the given target. Also provide the package manifest
path and the current target name in the package for use by the compiler.
@DougGregor
Copy link
Member Author

@swift-ci please test

@DougGregor DougGregor marked this pull request as draft May 20, 2024 05:19
in package: ResolvedPackage
) -> AvailableModulesList {
package.targets.map { target in
(target.c99name, .target(name: target.name))
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this is guaranteed to be correct for C targets or binary targets, and it should exclude any plugin and macro targets

Copy link
Contributor

Choose a reason for hiding this comment

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

For binary targets we at least tell people to match the target name and module name, but we aren't verifying it.

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