Skip to content

build(release): cross-compile the release tools in presubmit - #4262

Merged
rickeylev merged 6 commits into
bazel-contrib:mainfrom
rickeylev:bazelci_cross_release_artifacts
Oct 15, 2026
Merged

rickeylev merged 6 commits into
bazel-contrib:mainfrom
rickeylev:bazelci_cross_release_artifacts

Conversation

@rickeylev

Copy link
Copy Markdown
Collaborator

Presubmit built the release tools only for each CI host's own platform,
so 8 of the 11 platforms in dev/platforms were built only when the
release workflow ran.

A new target, //dev/release_artifacts:cross_compiled_artifacts, builds
the tools for the platforms that the host can cross-compile for, with a
split transition on --platforms. BazelCI's default builds of //... on
Linux x86_64, macOS arm64, and Windows x86_64 thus cover all 11
platforms without new jobs. BazelCI has no Windows Arm machines, so
Windows x86_64 hosts also get a Rust toolchain for Arm Windows.

On all three hosts, developers' machines included, builds of //... now
also cross-compile, e.g. the 5 musl variants on Linux x86_64. The
release workflow still builds aarch64-pc-windows-msvc and
x86_64-apple-darwin natively.

Work towards #4216

@rickeylev
rickeylev requested a review from aignas as a code owner October 14, 2026 06:34
@rickeylev rickeylev added the presubmit-auto-run BazelCI: skip the block step for CI config changes in this PR label Oct 14, 2026
Presubmit only built the release tools for each CI host's own
platform, so 8 of the 11 platforms in dev/platforms were only built
when the release workflow ran.

A new target, //dev/release_artifacts:cross_compiled_artifacts, builds
the tools for the platforms that the host can cross-compile for, with a
split transition on --platforms. BazelCI's default builds of //... on
Linux x86_64, macOS arm64, and Windows x86_64 thus cover all 11
platforms without new jobs. BazelCI has no Windows Arm machines, so
Windows x86_64 hosts also get a Rust toolchain for Arm Windows.

Arm Windows needs Visual Studio's optional ARM64 build tools. A config
setting detects them through toolchain resolution, so Windows machines
without them skip that platform instead of failing. BazelCI's Windows
jobs set --//dev/release_artifacts:require_msvc_arm64 to make missing
tools an error there.

On Linux x86_64, developers' machines included, builds of //... now
also cross-compile the 5 musl variants. The release workflow still
builds aarch64-pc-windows-msvc and x86_64-apple-darwin natively.

Work towards bazel-contrib#4216
Name the strict MSVC ARM64 flag in the shared .bazelrc's ci config,
which BazelCI's default Windows jobs now pass, instead of in
presubmit.yml. Also recognize all of rules_cc's error scripts in the
toolchain probe, and apply wording fixes from code review.
Keep the release build rules in one file: the cross_compiled_files
rule and its transition move unchanged into release_files.bzl, and
cross_compiled_files.bzl and its bzl_library are removed.
BazelCI's test step and --config=fast-tests build only tests and their
dependencies, so add a build_test for
//dev/release_artifacts:cross_compiled_artifacts.
@rickeylev
rickeylev force-pushed the bazelci_cross_release_artifacts branch from e093946 to 56c566c Compare October 14, 2026 20:52
@aignas
aignas added this pull request to the merge queue Oct 14, 2026
@rickeylev
rickeylev removed this pull request from the merge queue due to a manual request Oct 14, 2026
Only the Windows jobs passed --config=ci, so the CI settings in .bazelrc
applied to them alone. The shared build and test flag sets now include
it, so every default and RBE bzlmod job uses it in both steps, which
keeps `bazel test` reusing the build's analysis cache.

A new reusable_config_test_flags anchor mirrors the build one. The
Windows and rolling jobs merge it; the RBE jobs, which set their own
flags, list --config=ci explicitly.
The RBE jobs listed --config=ci by hand. Merging the shared flag sets
instead keeps them in sync with the other jobs; rbe_min thereby also
gains --keep_going and --verbose_failures.
@rickeylev
rickeylev added this pull request to the merge queue Oct 15, 2026
Merged via the queue into bazel-contrib:main with commit ce2cc35 Oct 15, 2026
5 checks passed
@rickeylev
rickeylev deleted the bazelci_cross_release_artifacts branch October 15, 2026 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

presubmit-auto-run BazelCI: skip the block step for CI config changes in this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants