Skip to content

Cache the downloaded Xcode Swift toolchain across Bazel restarts - #22905

Open
jketema wants to merge 1 commit into
github:mainfrom
jketema:jketema/swift-fix
Open

jketema wants to merge 1 commit into
github:mainfrom
jketema:jketema/swift-fix

Conversation

@jketema

@jketema jketema commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Use upstream's standalone_toolchain for Xcode instead of a separate local, configuring repository rule that refetches the pinned download on every server restart. Keep the SDK lookup and path watch.

Publish rules_swift as 4.0.0-rc5-codeql.3 and regenerate registry metadata. Rebase the external static runtime patch onto upstream's inline attributes so the patches apply in the generated order.

CI failures are expected.

Use upstream's standalone_toolchain for Xcode instead of a separate local, configuring repository rule that refetches the pinned download on every server restart. Keep the SDK lookup and path watch.

Publish rules_swift as 4.0.0-rc5-codeql.3 and regenerate registry metadata. Rebase the external static runtime patch onto upstream's inline attributes so the patches apply in the generated order.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 477ddbb2-ed60-4303-bada-daa9aecee456
@jketema jketema added the depends on internal PR This PR should only be merged in sync with an internal Semmle PR label Oct 27, 2026
@jketema
jketema marked this pull request as ready for review October 28, 2026 13:34
Copilot AI max review requested due to automatic review settings October 28, 2026 13:34
@jketema
jketema requested review from a team as code owners October 28, 2026 13:34

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.

🔵 Needs a closer look

Xcode selection changes are not tracked, so the cached sdkroot can keep pointing to the previous SDK even after a Bazel restart while that SDK remains installed.

No open issues 🎉

What changed in this PR

This PR reuses upstream’s standalone repository rule for the downloaded Xcode Swift toolchain to avoid refetching it across Bazel server restarts.

Changes:

  • Removes the separate local/configuring macOS rule while retaining SDK lookup and path watching.
  • Updates the custom rules_swift release to 4.0.0-rc5-codeql.3.
  • Rebases the external static runtime patch and refreshes patch ordering and integrity metadata.
File Description
MODULE.bazel Selects the updated rules_swift release.
misc/​bazel/​registry/​modules/​rules_swift/​metadata.json Lists the updated custom release.
misc/​bazel/​registry/​modules/​rules_swift/​4.0.0-rc5-codeql.3/​source.json Updates patch ordering and integrity hashes.
misc/​bazel/​registry/​modules/​rules_swift/​4.0.0-rc5-codeql.3/​patches/​register_downloaded_macos_toolchain.patch Removes the local macOS rule while preserving SDK discovery.
misc/​bazel/​registry/​modules/​rules_swift/​4.0.0-rc5-codeql.3/​patches/​external_static_runtime.patch Rebases runtime support onto upstream’s inline attributes.
misc/​bazel/​registry/​modules/​rules_swift/​4.0.0-rc5-codeql.3/​MODULE.bazel Declares the updated custom release version.

Review effort: Max

This branch has not been deployed

No deployments
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants