Repository navigation
Conversation
louwers
requested review from
aaronsky,
adincebic,
brentleyjones,
keith and
luispadron
as code owners
October 8, 2026 19:50
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Extract symbol graphs from the public headers of `objc_library` targets with `clang -extract-api` so that `docc_archive` can document Objective-C (and mixed Swift/Objective-C) code. Symbol graphs are now collected uniformly through `deps` for both languages. Fixes bazelbuild#2241 Assisted-by: Claude <noreply@anthropic.com>
A DocC archive documents a single module, so including the symbol graphs of transitive Objective-C dependencies results in multiple root modules and unresolved symbol links in the .docc bundle. Only extract the Objective-C module of the dep itself. Targets that don't define a module themselves (bundling rules or objc_library targets without public headers) forward the Objective-C symbol graphs of their direct deps, which also allows attaching a .docc bundle to an existing library. Also add the `source_service` and `source_service_base_url` attributes to link symbols to their source files. Assisted-by: Claude <noreply@anthropic.com>
louwers
force-pushed
the
docc-objc-support
branch
from
October 8, 2026 19:52
9fd2499 to
5f16986
Compare
louwers
commented
Oct 11, 2026
Assisted-by: Claude <noreply@anthropic.com>
Assisted-by: Claude <noreply@anthropic.com>
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.
Fixes #2241
docc_archiveonly supported Swift. This adds Objective-C support by extracting symbol graphs from the public headers (hdrs) ofobjc_librarytargets withclang -extract-api, the same tool Xcode uses for Objective-C DocC.-targettriple comes from the C++ toolchain and the SDK from the target platform.-fmodulesis passed whenenable_modulesis set or-fmodulesis incopts.MultipleRootPageswarnings and unresolved links from the.doccbundle. Targets that don't define a module themselves forward the Objective-C symbol graphs of their directdeps: bundling rules likeios_framework, orobjc_librarytargets without public headers. The latter can be used to attach a.doccbundle to an existing library without it ending up as a resource in the app bundle.emit_extension_block_symbols = "1"also adds--emit-extension-symbol-graphsfor Objective-C, which includes members of categories on types from other modules.source_serviceandsource_service_base_urlattributes (mapping todocc convert --source-service/--source-service-base-url) link symbols to their source files. Symbol graphs reference files relative to the execution root, so the symbol graph collection step anchors those paths at a fixed checkout path that is passed as--checkout-path. That keeps outputs deterministic. Generated (bazel-out/) andexternal/files are not linked.Tested with new Starlark tests covering:
.doccbundleios_frameworkwith Objective-C depsobjc_librarywrapper with a.doccbundlesource_serviceI also used it to replace the bespoke DocC script in MapLibre Native (maplibre/maplibre-native#4738). The output matches the script's, with source links added for headers the script couldn't link.
🤖 Generated with Claude Code