Skip to content

release: candidate consumer builds and tests a Swift package on BCR rules_swift (closes #12075) - #12115

Draft
TrapsterDK wants to merge 7 commits into
mainfrom
swift-consumer-12075
Draft

TrapsterDK wants to merge 7 commits into
mainfrom
swift-consumer-12075

Conversation

@TrapsterDK

@TrapsterDK TrapsterDK commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #12075 (also #11415)

a_candidate_archive_builds_tests_and_checks_a_registry_consumer (deploy/private/release/tests/candidate_consumer_test.rs) gains assert_swift_consumer, Linux x86_64 only, run after dx check //... and the GCC step. It writes swift/tests/consumer into the registry-only consumer (no override), asserts bazel mod explain rules_swift shows the version rules_dx pins, and runs bazel test //swift:greet_tests.

  • swift/tests/BUILD.bazel: consumer_srcs filegroup, visible to the release test package.
  • deploy/private/release/tests/BUILD.bazel: adds it to data.
  • patches/README.md: ## rules_swift on Linux section names the test.
  • docs/design/nested-tests.md: release consumer row extended.
  • The earlier harness test and lock plan are dropped (no harness cache growth, no new nested target).

Tests

  • Built //deploy/private/release/tests:release_consumer_smoke_test. Not run locally (nested consumer test); Evidence: run 43516441662 (linux_x86_64) failed in all three tests of the target before reaching the swift step, on code this PR does not touch: candidate_consumer_test panics in dx_test_scratch::git ("not a git repository") in the sandboxed harness, and quickstart_consumer_test fails on "javascript is not a package" because //:module_srcs has no javascript package (same partial module_srcs as nested: swift_linux extension check moves out of the harness consumer, bazel mod fails on its partial module_srcs (part of #11415) #12261). Rebased on main de968cb; no new evidence until those are fixed on main. Built the target locally; not run (nested consumer test).

  • //patches/... pass. //tools/ci:prose_rules_test and //tools/ci:test_budget_test fail on files this PR does not touch (MODULE.bazel, deploy/README.md, docs/support-matrix.md, api_spec/helm/swift/private budget counts), same on main.

  • Stacked on PR 12656 (module_srcs carries the //cli/cli:dx and dx_generated_policy closure). Also stacked on PR 12571 (its 10 commits cherry-picked: consumers pin patched rules_py, rules_flutter, rules_rust and llvm). Evidence: run 43544584889 (linux_x86_64, //deploy/private/release/tests:release_consumer_smoke_test) failed in all three tests: runfiles lacked patches/rules_rust (and patches/llvm), which the consumers copy. b8e8103 adds those patches to data; built locally, no further evidence run in this round. Run 43543126252 failed in all three tests on key "3.47.9" not found in stock rules_flutter (release: release_consumer_smoke_test fails on rules_py and rules_flutter 3.47.9 resolution in consumers (linux and windows) #12005), which PR 12571 fixes. Run 43541251765 failed: the archive lacked java/private/toolchain and cli/advisory_prep, which MODULE.bazel names.

Remaining:

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xut2hws3L7Tg4oUvpSvuYD

@TrapsterDK TrapsterDK changed the title swift: nested test builds swift/tests/consumer on BCR rules_swift (part of #12075) release: candidate consumer builds and tests a Swift package on BCR rules_swift (closes #12075) Nov 12, 2026
@TrapsterDK TrapsterDK added the needs-review Touches review paths; needs a second-session Review: comment label Nov 12, 2026
@TrapsterDK

Copy link
Copy Markdown
Collaborator Author

Review: changes requested

  1. patches/README.md (new section ## rules_swift on Linux, line 69-74): the sentence "Linux consumers need no rules_swift patch: the swift_linux extension declares the toolchains" is rationale, which AGENTS.md forbids in docs. It also names a swift_linux extension that I could not find; MODULE.bazel uses the swift extension (repos dx_swift_linux_*). State only what the test covers, or drop the section.

Not verified: the rules_swift@<version> match in mod explain output and the nested run. The PR stays draft until the network job is green.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xut2hwH5AS7ytCaBAYwEtU

@TrapsterDK

Copy link
Copy Markdown
Collaborator Author

Review: approve

The earlier fix landed: patches/README.md now only states what assert_swift_consumer covers, with no rationale and no swift_linux mention. I found nothing that must change before merge.

Not verified: the nested run and the rules_swift@<version> match in mod explain output. The PR stays draft until the network job is green.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xut2i1LBYg969L4ZJRMURT

@TrapsterDK

Copy link
Copy Markdown
Collaborator Author

Evidence 43219759704 (linux_x86_64) failed on //deploy/private/release/tests:release_consumer_smoke_test before the Swift stage, in code this PR does not change:

  • candidate_consumer_test::a_candidate_archive_builds_tests_and_checks_a_registry_consumer: the pre-existing "repo state" setup (candidate_consumer_test.rs:59) panics at cli/test_scratch/src/lib.rs:178: git ["rev-parse", "--path-format=absolute", "--git-path", "index"] failed: fatal: not a git repository (test ran remotely, no checkout).
  • quickstart_consumer_test::{the_readme_quickstart_runs_as_written,bcr_test_module_runs_its_presubmit_targets} (file not touched): Label '@@rules_dx+//javascript:extensions.bzl' is invalid because 'javascript' is not a package (requested by @@rules_dx+//:MODULE.bazel:1799), i.e. the archive's module_srcs lacks javascript/BUILD.bazel.

assert_swift_consumer was never reached. Stays draft until the target runs green with these fixed upstream (see #12005, #10990).

@TrapsterDK

Copy link
Copy Markdown
Collaborator Author

Rebased onto main; evidence run 43516441662 (linux_x86_64, release_consumer_smoke_test) dispatched. Previous run 43219759704 failed on a pre-rebase tree.

@TrapsterDK
TrapsterDK force-pushed the swift-consumer-12075 branch 2 times, most recently from 100b065 to 26e08cd Compare November 14, 2026 00:45
@TrapsterDK

Copy link
Copy Markdown
Collaborator Author

Harness now snapshots a checkout without .git (no parent, no alternates). Rebased on main. Evidence run 43536332072 (linux_x86_64) dispatched; nested/consumer tests not run locally.

@TrapsterDK
TrapsterDK force-pushed the swift-consumer-12075 branch 2 times, most recently from 60c367b to 22eeb8b Compare November 14, 2026 01:52
@TrapsterDK
TrapsterDK marked this pull request as ready for review November 14, 2026 02:14
@TrapsterDK
TrapsterDK marked this pull request as draft November 14, 2026 02:14
@TrapsterDK

Copy link
Copy Markdown
Collaborator Author

Evidence run 43546409752 (linux_x86_64, //deploy/private/release/tests:release_consumer_smoke_test) dispatched on b8e8103.

@TrapsterDK

Copy link
Copy Markdown
Collaborator Author

Rebased onto main as 4 commits (merged #12656/#12571 commits and the .git-less snapshot change dropped, main has them). Last run 43546409752 failed on missing patches/rules_fortran package, now on main. Evidence run 43659794958 (linux_x86_64, //deploy/private/release/tests:release_consumer_smoke_test) dispatched on 0636026. Local: //tools/testing:module_srcs_test, //swift/tests, //ocaml/private/... pass; //patches:readme_generated (fmt row) and //patches/llvm/tests:macos_sdk_symlinks_test fail on files this PR does not touch.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xut2hvuiHK9vSNJZWiqKfX

TrapsterDK and others added 5 commits November 15, 2026 01:59
…ules_swift (closes #12075)

The release consumer, which reaches rules_dx only through a local registry
with no override, now writes swift/tests/consumer on Linux x86_64, asserts
`mod explain rules_swift` selects the version rules_dx pins, and runs
`bazel test //swift:greet_tests`. patches/README.md and the nested-tests
table name the check.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xut2hwH5AS7ytCaBAYwEtU
…iles (part of #12075)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xut2hws3L7Tg4oUvpSvuYD
…ers (part of #12075)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xut2hws3L7Tg4oUvpSvuYD
…sion inputs (part of #12075)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xut2hws3L7Tg4oUvpSvuYD
rules_julia is created by a rules_dx module extension since #12747, so a
single_version_override on it fails as an override on a nonexistent module.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xut2hvuiHK9vSNJZWiqKfX
@TrapsterDK

Copy link
Copy Markdown
Collaborator Author

Run 43659794958 failed in all three tests: consumers set a single_version_override on rules_julia, which main (#12747) now creates through a rules_dx extension. e447afa drops that override. Local: //tools/testing/nested:dx_nested_test, //tools/testing:module_srcs_test, //swift/tests/... pass; smoke test built, not run locally. Evidence run 43661427774 (linux_x86_64) dispatched.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xut2hvuiHK9vSNJZWiqKfX

…ifests (part of #12075)

The registry consumer failed loading //swift: swift/private/platforms was not
a package in the archive. The quickstart consumers failed analysing //:dx:
the .github actions glob matched nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xut2hvuiHK9vSNJZWiqKfX
@TrapsterDK

Copy link
Copy Markdown
Collaborator Author

Run 43661427774: the candidate test reached the Swift stage and failed because swift/private/platforms was not in module_srcs; the quickstart tests failed on an empty .github actions glob. 203bd5d adds both to module_srcs. Local: //tools/testing:module_srcs_test passes. Evidence run 43662333255 (linux_x86_64) dispatched.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xut2hvuiHK9vSNJZWiqKfX

…crate patches (part of #12075)

The registry consumer's swift tests depend on //swift/private/tools:swift_format,
and rules_dx's crate annotations patch ring and gomod-parser from
@rules_dx//patches, so consumers fetching those crates need the packages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xut2hvuiHK9vSNJZWiqKfX
@TrapsterDK

Copy link
Copy Markdown
Collaborator Author

Run 43662333255: Swift stage failed on missing //swift/private/tools; quickstart tests failed fetching gomod-parser (its patch lives in @rules_dx//patches/gomod-parser). c7e4456 adds swift/private/tools, patches/gomod-parser and patches/ring to module_srcs. Local: //tools/testing:module_srcs_test, //swift/private/tools/... pass. Evidence run 43663605314 (linux_x86_64) dispatched.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xut2hvuiHK9vSNJZWiqKfX

@TrapsterDK

Copy link
Copy Markdown
Collaborator Author

Run 43663605314 (3rd round, c7e4456) still fails, further along:

  • candidate test, Swift stage: fetching @rules_dx++swift+dx_swift_libs_linux_x86_64 fails: libbrotlicommon.so.1 is in neither lib/x86_64-linux-gnu nor usr/lib/x86_64-linux-gnu of the sysroot (swift/private/toolchain/repos.bzl:135). The sysroot the consumer resolves lacks libbrotli.
  • quickstart_bcr: //:android_device_cc finds no @bazel_tools//tools/cpp:toolchain_type toolchain in the consumer.
  • the_readme_quickstart_runs_as_written: target TIMEOUT at 600s.
    Stays draft; evidence round budget used.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xut2hvuiHK9vSNJZWiqKfX

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

needs-review Touches review paths; needs a second-session Review: comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

consumer-setup: Swift toolchain tags need no patched rules_swift (part of #11387)

1 participant