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

Emit supplemental outputs for the target variant #1770

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

etcwilde
Copy link
Contributor

This patch teaches the driver how to emit the supplementary outputs for a module build for the target-variant.

These supplementary outputs are:

  • Swift module
  • Swift module documentation
  • Swift module source information
  • Swift interface
  • Swift private interface
  • Swift package interface
  • JSON API description
  • JSON ABI description

This means that the driver can emit all of the relevant outputs for a build in a single invocation without needing to be called twice with the same arguments, with one to emit the zippered object and target supplemental outputs, and again for the target-variant outputs.

Patch to add new flags: swiftlang/swift#78336

rdar://141582282

This should have no actual impact on compilation. The idea is that we
are grouping the supplementary outputs that are specific to a given
target. This will allow us to store two of them, one for the target and
one for the target-variant. The end goal being that we can emit the
target variant interface bits in the same driver invocation that
generates the zippered object files.
This patch wires up emitting the interface information for the target
variant in the same swiftc invocation that emits the zippered object
file.
This patch adds the api description to the set of supplemental outputs
emitted for both the target and target variant.
This adds flags for setting the variant module doc path, source info
path, api descriptor path, module interface path, private interface
path, and package interface path.
@etcwilde
Copy link
Contributor Author

@swift-ci please test

Now teaching the compiler to emit the ABI JSON file for the target
variant module.
@etcwilde etcwilde force-pushed the ewilde/target-variant-modules branch from ef97232 to b3c8853 Compare January 2, 2025 16:08
@etcwilde
Copy link
Contributor Author

etcwilde commented Jan 2, 2025

swiftlang/swift#78336
@swift-ci please test

Copy link
Contributor

@artemcm artemcm left a comment

Choose a reason for hiding this comment

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

I think this is a good way to do it.
Have you given any thought to folding moduleOutputPaths into moduleOutputInfo?

@etcwilde
Copy link
Contributor Author

etcwilde commented Jan 7, 2025

Have you given any thought to folding moduleOutputPaths into moduleOutputInfo?

I did consider it. My reasons for not doing that was 1, size of the patch, and 2, ModuleOutputInfo is a public type and I was doing my best to avoid impacting the public interface. If 2 isn't an issue, I can move things around so that the output paths live in module output info.

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