Skip to content

[Frontend] Support -index-store-path for explicit module interface compilation. #79485

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

Merged
merged 1 commit into from
Feb 21, 2025

Conversation

allevato
Copy link
Member

No description provided.

// swift-interface-format-version: 1.0
// swift-module-flags: -module-name IndexWhileBuilding

// REQUIRES: OS=macosx
Copy link
Member

Choose a reason for hiding this comment

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

Why does the test require macOS?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm, it shouldn't. I adapted this from test/ModuleInterface/ExplicitInterfaceBuild.swiftinterface, which also claims to require macOS, but I don't see anything in it that should either. Maybe that one was a mis-copy of test/ModuleInterface/ExplicitInterfaceObjc.swiftinterface?

I've removed it from my test; let's see what happens.

@allevato allevato force-pushed the index-swiftinterface branch from cea4058 to 5fd9852 Compare February 19, 2025 17:42
@allevato
Copy link
Member Author

@swift-ci please smoke test

@allevato allevato merged commit 7c258f2 into swiftlang:main Feb 21, 2025
3 checks passed
@allevato allevato deleted the index-swiftinterface branch February 21, 2025 20:55
copybara-service bot pushed a commit to bazelbuild/rules_swift that referenced this pull request Mar 31, 2025
Starting with Swift 6.1 (Xcode 16.3), the frontend correctly generates an indexstore from a `.swiftinterface` file when it is build with `-explicit-interface-module-build` (swiftlang/swift#79485). Collect that indexstore if requested.

To do this, the worker has to find the `.swiftinterface` file and extract the flags from it in order to pass them to the frontend. For system frameworks, this is a bit more delicate, because we don't know the path to the actual `.swiftinterface` file at analysis time (it may be a _variant_ of the current architecture, like `arm64e` for `arm64`). So we add logic to the worker that infers the right file given the path to the parent `.swiftmodule` directory, using similar logic to the compiler itself.

PiperOrigin-RevId: 742225315
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