Uh oh!
There was an error while loading. Please reload this page.
Unified: Drop the separate swift-syntax binary and make tests runnable both with Bazel and cargo - #22290
Conversation
Just assume `swift`/`swiftc` are on the path.
There was a problem hiding this comment.
Pull request overview
Integrates Swift parsing directly into the unified extractor and enables its tests under both Bazel and Cargo.
Changes:
- Replaces the external parser process with direct
swift-syntax-rscalls. - Adds Swift linking, runtime packaging, and platform constraints.
- Adds Bazel targets for corpus and pipeline tests.
Show a summary per file
| File | Description |
|---|---|
Cargo.lock | Records the new extractor dependency. |
unified/BUILD.bazel | Packages the extractor with Swift runtime libraries. |
unified/platforms.bzl | Defines supported unified-extractor platforms. |
unified/extractor/BUILD.bazel | Links Swift and adds Bazel tests. |
unified/extractor/Cargo.toml | Adds swift-syntax-rs. |
unified/extractor/build.rs | Propagates Cargo linker metadata. |
unified/extractor/src/languages/swift/parse.rs | Calls Swift parsing in-process. |
unified/extractor/tests/corpus_tests.rs | Supports Bazel and Cargo corpus paths. |
unified/swift-syntax-rs/BUILD.bazel | Simplifies binary and runtime linking targets. |
unified/swift-syntax-rs/Cargo.toml | Declares the native library link name. |
unified/swift-syntax-rs/build.rs | Exposes native library/runtime directories. |
unified/swift-syntax-rs/swift-syntax-parse.sh | Removes the obsolete parser wrapper. |
Review details
- Files reviewed: 11/12 changed files
- Comments generated: 2
- Review effort level: Balanced
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
redsun82
left a comment
There was a problem hiding this comment.
I like the approach! I even wonder whether we could generalize with unconditionally passing --cfg=bazel to all bazel rust invocations (via a .bazelrc/.internal.bazelrc setting maybe?).
jketema
commented
Aug 6, 2026
Are there other places where that would be immediately useful? |
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: jketema <93738568+jketema@users.noreply.github.com>
Co-authored-by: jketema <93738568+jketema@users.noreply.github.com>
…fied-extractor Sync unified docs with in-process swift-syntax-rs parsing (post-#22290)
Partially based on: #22248
Note that this doesn't yet update the
.mdfiles. I'll deal with those in a separate PR. Also building on macOS from the internal repo is still broken (will deal with that after this has been merged). I also have not looked atcreate-extractor-pack.shyet.Commit-by-commit review recommended.