Skip to content

Commit d143478

Browse files
paldepindCopilot
andcommitted
Unified: Remove the SwiftSyntax extractor backend
Make native Swift parsing unconditional and remove backend features, Swift FFI bindings, and their Cargo and Bazel build infrastructure. Keep the reference parser as a standalone Swift executable and move the JSON-to-yeast adapter into differential-test infrastructure. Generate and check raw corpus snapshots with the native parser, preserving all mapped AST expectations. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: c3453b85-5da4-4c2f-9e1e-87bb48fe348a
1 parent 70d9130 commit d143478

182 files changed

Lines changed: 397 additions & 3221 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.bazelrc‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ build --define=CODEQL_PLATFORM={CODEQL_PLATFORM}
1414
common --override_module=semmle_code=%workspace%/misc/bazel/semmle_code_stub
1515

1616
build --repo_env=CC=clang --repo_env=CXX=clang++
17-
# The standalone Linux toolchain uses gold, which does not support the
18-
# LLD-specific -z nostart-stop-gc workaround enabled by rules_swift.
19-
build:linux --features=-swift.lld_gc_workaround
2017
# Disable Android SDK auto-detection (we don't use it, and rules_android has Bazel 9 compatibility issues)
2118
build --repo_env=ANDROID_HOME=
2219

‎.github/skills/bazel/SKILL.md‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,8 @@ Bazel's own macro / rule / repository-rule distinction applies as usual. What is
4949

5050
Prefer inline rules in `BUILD.bazel`. A `.bzl` file earns its `load()` only when the shape repeats across packages or a
5151
value must be computed: [`rust.bzl`](../../../misc/bazel/rust.bzl) is worth it because every Rust binary that ships in a
52-
pack must get the same universal-binary wrapper and symbols test, and forgetting either is a release bug. A local
53-
debugging aid opts out and declares a plain `rust_binary`; see `swift-syntax-parse` in
54-
[`unified/swift-syntax-rs/BUILD.bazel`](../../../unified/swift-syntax-rs/BUILD.bazel). The `_gen_binaries` list in
52+
pack must get the same universal-binary wrapper and symbols test, and forgetting either is a release bug. The
53+
`_gen_binaries` list in
5554
[`go/BUILD.bazel`](../../../go/BUILD.bazel) does not earn a `.bzl`, because it is shared within a single file, where a
5655
local variable does the job.
5756

‎.github/workflows/update-rust-analyzer.lock.yml‎

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.github/workflows/update-rust-analyzer.md‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ safe-outputs:
7878
- "shared/yeast-schema/Cargo.toml"
7979
- "ruby/extractor/Cargo.toml"
8080
- "unified/extractor/Cargo.toml"
81-
- "unified/swift-syntax-rs/Cargo.toml"
8281
- "unified/extractor-unsupported-os/Cargo.toml"
8382
- "cpp/extractor/bmn/**"
8483
- "ql/extractor/**"

‎BUILD.bazel‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,3 @@ exports_files([
33
"Cargo.lock",
44
"Cargo.toml",
55
])
6-
7-
constraint_setting(name = "swift_runtime_linkage")
8-
9-
constraint_value(
10-
name = "static_swift_runtime",
11-
constraint_setting = ":swift_runtime_linkage",
12-
visibility = ["//visibility:public"],
13-
)

‎CODEOWNERS‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
/swift/ @github/codeql-swift
3131
/swift/extractor/ @github/codeql-swift @github/code-scanning-language-coverage
3232
/unified/extractor/ @github/code-scanning-language-coverage
33-
/unified/swift-syntax-rs/ @github/code-scanning-language-coverage
33+
/unified/swift-parser/ @github/code-scanning-language-coverage
3434
/misc/codegen/ @github/codeql-swift
3535
/java/kotlin-extractor/ @github/codeql-kotlin @github/code-scanning-language-coverage
3636
/java/ql/test-kotlin1/ @github/codeql-kotlin

‎Cargo.lock‎

Lines changed: 0 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ members = [
1414
"ruby/extractor",
1515
"unified/extractor",
1616
"unified/swift-parser",
17-
"unified/swift-syntax-rs",
1817
"rust/extractor",
1918
"rust/extractor/macros",
2019
"rust/ast-generator",

‎MODULE.bazel‎

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ bazel_dep(name = "gazelle", version = "0.54.0")
3131
bazel_dep(name = "rules_dotnet", version = "0.22.2-codeql.1")
3232
bazel_dep(name = "googletest", version = "1.18.0.bcr.1")
3333
bazel_dep(name = "rules_rust", version = "0.75.0")
34-
bazel_dep(name = "rules_swift", version = "4.2.2-codeql.1")
35-
bazel_dep(name = "swift-syntax", version = "604.0.0")
3634
bazel_dep(name = "zstd", version = "1.5.7.bcr.3")
3735

3836
bazel_dep(name = "buildifier_prebuilt", version = "10.1.0", dev_dependency = True)
@@ -258,35 +256,6 @@ use_repo(
258256
"swift-resource-dir-macos",
259257
)
260258

261-
# Hermetic swift.org toolchain for building `unified/swift-syntax-rs`.
262-
#
263-
# The version is pinned as a literal rather than read from
264-
# `unified/swift-syntax-rs/.swift-version` via `swift_version_file`: the latter
265-
# makes the extension `module_ctx.read` a `//unified/...` label, which fails to
266-
# resolve when this repo is consumed as a dependency module (`@@ql+`) whose
267-
# `unified/swift-syntax-rs` package is not loadable in that context. Keep this
268-
# in sync with `unified/swift-syntax-rs/.swift-version` (used by the `cargo`
269-
# build) and the `swift-syntax` release in `swift/Package.swift`.
270-
swift = use_extension("@rules_swift//swift:extensions.bzl", "swift", dev_dependency = True)
271-
swift.toolchain(
272-
name = "swift_toolchain",
273-
swift_version = "6.3.3",
274-
)
275-
use_repo(
276-
swift,
277-
"swift_toolchain",
278-
"swift_toolchain_ubuntu22.04",
279-
"swift_toolchain_ubuntu22.04-aarch64",
280-
"swift_toolchain_xcode",
281-
)
282-
283-
register_toolchains(
284-
"@swift_toolchain//:swift_toolchain_exec_ubuntu22.04",
285-
"@swift_toolchain//:swift_toolchain_exec_ubuntu22.04-aarch64",
286-
"@swift_toolchain//:swift_toolchain_exec_xcode",
287-
dev_dependency = True,
288-
)
289-
290259
node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node")
291260
node.toolchain(
292261
name = "nodejs",

0 commit comments

Comments
 (0)