Skip to content

Add support for symbol graph generation for clang targets#10057

Open
cmcgee1024 wants to merge 3 commits into
swiftlang:mainfrom
cmcgee1024:clang_target_symbolgraphs
Open

Add support for symbol graph generation for clang targets#10057
cmcgee1024 wants to merge 3 commits into
swiftlang:mainfrom
cmcgee1024:clang_target_symbolgraphs

Conversation

@cmcgee1024
Copy link
Copy Markdown
Member

@cmcgee1024 cmcgee1024 commented May 13, 2026

Add support for symbol graph generation for clang targets:

  • Add header files to the PIF with "project" visibility
  • Set TAPI symbol graph output directory to the same location as used for Swift
  • Set TAPI to use the project headers as input to the symbol graph generation

@cmcgee1024
Copy link
Copy Markdown
Member Author

@swift-ci please test

Copy link
Copy Markdown
Contributor

@owenv owenv left a comment

Choose a reason for hiding this comment

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

This lgtm but I think we should have a test which generates the symbol graph end to end

#expect(sources == expected)
}

@Test func symbolGraphExtractorBuildSettings() async throws {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think it would also be valuable to have a test for this which runs a build end to end and verifies we can correctly extract the symbol graph

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'm hoping to avoid yet another e2e test in SwiftPM. There are other e2e tests for symbol graphs in general. If it's important then I'll add it.

// for symbol graph generation. For non-swift API that will be done using TAPI and
// a build setting to instruct it to use project visible header files. In the future
// it may be possible to add public header files with public header visibility.
for headerPath in headerFiles {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One thing we should double check is that this doesn't cause us to generate any headermaps we didn't before

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.

2 participants