[Index] Generate versioning files for targets fully built for indexing - #1795
Merged
Merged
Conversation
The index build arena skipped the Apple Generic Versioning file and the kernel extension module info file for every target, to avoid forcing Swift module generation when a target is only being prepared. Targets in targetsRequiredToBuildForIndexing are fully compiled and linked in the arena, so skipping these files only produces a binary missing the <Product>VersionNumber and <Product>VersionString symbols a regular build exports. When the target also sets SUPPORTS_TEXT_BASED_API, GenerateTAPI's verification then fails on the version symbols declared in its umbrella header. Only skip these files for targets that aren't required to build for indexing. rdar://188475806
rintaro
requested review from
cmcgee1024,
daveinglis,
jakepetroules,
mhrawdon,
owenv,
rconnell9 and
rjmansfield
as code owners
September 27, 2026 03:46
Member
Author
|
@swift-ci Please test |
rintaro
commented
Sep 27, 2026
| results.checkWarning(.contains("argument unused during compilation: '-index-unit-output-path"), failIfNotFound: false) | ||
| results.checkNoDiagnostics() | ||
| results.checkTaskExists(.matchTargetName("Lib"), .matchRuleType("CompileC"), .matchRuleItemBasename("Lib_vers.c")) | ||
| results.checkTaskExists(.matchTargetName("Lib"), .matchRuleType("GenerateTAPI")) |
Member
Author
There was a problem hiding this comment.
GenerateTAPI shouldn't be needed in prepare builds. rdar://188503355
mhrawdon
approved these changes
Sep 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The index build arena skips the Apple Generic Versioning file (
<PRODUCT_NAME>_vers.c) and for every target, so that targets that are only being prepared don't have to build their Swift module.However, targets in
targetsRequiredToBuildForIndexingare fully compiled and linked in the arena, so skipping these files saves nothing for them. It also leaves their binaries without the<Product>VersionNumberand<Product>VersionStringsymbols a regular build exports. If the target also setsSUPPORTS_TEXT_BASED_API,GenerateTAPIfails verification on those symbols when its umbrella header declares them, for example:declaration has external linkage, but dynamic library doesn't have symbol 'LibVersionNumber'.With this change, these files are skipped only for targets that aren't required to build for indexing.
rdar://188475806