Skip to content

Bazel: Update to latest rules_cc, rules_swift, and apple_support - #22325

Open
jketema wants to merge 2 commits into
mainfrom
jketema/update-bazel-deps
Open

Bazel: Update to latest rules_cc, rules_swift, and apple_support#22325
jketema wants to merge 2 commits into
mainfrom
jketema/update-bazel-deps

Conversation

@jketema

@jketema jketema commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Note that rules_swift requires the versions of apple_support and rules_cc we're updating to.

Also update the Swift version we use in the build to 6.3.3, which is supported out-of-the-box by the new rules_swift version.

Windows tests are expected to fail here; resolved internally.

@jketema jketema added the depends on internal PR This PR should only be merged in sync with an internal Semmle PR label Aug 12, 2026
@jketema
jketema force-pushed the jketema/update-bazel-deps branch from 0134a2a to 09272d5 Compare August 12, 2026 12:21
Note that `rules_swift` requires the versions of `apple_support` and
`rules_cc` we're updating to.

Also update the Swift version we use in the build to 6.3.3, which
is supported out-of-the-box by the new `rules_swift` version.
@jketema
jketema force-pushed the jketema/update-bazel-deps branch from 09272d5 to 8080619 Compare August 12, 2026 12:31
@jketema
jketema marked this pull request as ready for review August 12, 2026 13:22
@jketema
jketema requested a review from a team as a code owner August 12, 2026 13:22
Copilot AI balanced review requested due to automatic review settings August 12, 2026 13:22
@jketema
jketema requested a review from a team as a code owner August 12, 2026 13:22

Copilot AI left a comment

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.

Pull request overview

Updates Bazel’s Swift/C++ dependencies and Swift toolchain while adapting runtime linking for the upgraded rules.

Changes:

  • Upgrades rules_cc, rules_swift, apple_support, and Swift 6.3.3.
  • Adds explicit Swift dynamic-runtime linking.
  • Disables an incompatible linker workaround on standalone Linux builds.
Show a summary per file
File Description
.bazelrc Configures the Linux linker workaround.
MODULE.bazel Updates Bazel dependencies and Swift version.
unified/swift-syntax-rs/.swift-version Pins Swift 6.3.3.
unified/swift-syntax-rs/BUILD.bazel Integrates Swift runtime linking.
unified/swift-syntax-rs/README.md Documents the updated Swift version.
unified/swift-syntax-rs/swift_runtime_linking.bzl Exposes runtime linking information.

Review details

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 6/6 changed files
  • Comments generated: 2
  • Review effort level: Balanced

Comment thread .bazelrc
build --repo_env=CC=clang --repo_env=CXX=clang++
# The standalone Linux toolchain uses gold, which does not support the
# LLD-specific -z nostart-stop-gc workaround enabled by rules_swift.
build:linux --features=-swift.lld_gc_workaround

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We don't use Gold when building from the internal repo, so this is fine.

load("@rules_swift//swift:swift.bzl", "swift_common")

def _swift_runtime_linking_impl(ctx):
return [swift_common.get_toolchain(ctx).dynamic_runtime_cc_info]

@jketema jketema Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That actually breaks things if the conditionals are removed at the place where this us used. Handled this slightly differently.

@jketema
jketema force-pushed the jketema/update-bazel-deps branch from 639d53e to 7d4724a Compare August 12, 2026 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

depends on internal PR This PR should only be merged in sync with an internal Semmle PR documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants