You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implements a subset of #17586
Builds on #18024 (adds all to --manager)
💥 What does this PR do?
Adds --manager=all, which makes every binding resolve a Selenium Manager binary cross-compiled from the current source instead of the pinned download. Note that nothing yet uses this new flag in our build/release process (see Additional Considerations)
Running bazel with --config=release now uses the same optimizations as cargo build --release
🔧 Implementation Notes
Linux binaries are fully static (musl) and Windows uses the LLVM MinGW target, because those are what the hermetic LLVM toolchain can link without a system SDK
The C libraries some crates depend on (bzip2, xz, zstd) now come from Bazel modules instead of cargo build scripts, so they cross-compile too
all is marked incompatible on Windows hosts until the upstream fixes ship (see Additional Considerations)
The binaries built from --manager=all are slightly different from what is built (and published) from Cargo
The macOS binary is kept as a fat binary, but the minimum version for Intel rises from 10.12 to 11.0 since one deployment target covers both architectures and arm64 can't go lower
The Windows binary is 64-bit instead of 32-bit, which increases its size from 3.5 to about 4.4 MB
🤖 AI assistance
AI assisted (complete below)
Tool(s): Claude Code (Opus 5)
What was generated: the Bazel cross-compile wiring, the verification runs, and this description
I reviewed all AI output and can explain the change
💡 Additional Considerations
Cross-compiling from a Windows host requires upstream changes to be merged and released:
• Adds --manager=all to build every Selenium Manager platform artifact from source.
• Uses hermetic LLVM targets and Bazel-provided C libraries for cross-compilation.
• Aligns Bazel release optimization settings with Cargo release builds.
Diagram
graph TD
A["Manager all mode"] --> B["Artifact resolver"] --> C["Platform transitions"] --> D["LLVM toolchains"] --> E["Platform binaries"] --> H["Language bindings"]
F["Bazel C libraries"] --> C
E --> G["macOS lipo"] --> H
Loading
High-Level Assessment
The following are alternative approaches to this PR:
1. Native CI build matrix
➕ Uses each platform's system SDK and canonical Cargo targets
➕ Allows platform-specific execution and validation
➖ Cannot produce every binary from one host
➖ Requires artifact aggregation and duplicates setup across runners
2. RBE-backed cross-compilation
➕ Preserves hermetic builds while distributing expensive platform compilation
➕ Better fits release jobs that otherwise rebuild every binary locally
➖ Requires additional remote-execution and release-pipeline integration
➖ Does not remove current upstream limitations on Windows hosts
Recommendation: The PR's hermetic platform-transition approach is the best foundation for one-host, reproducible cross-compilation and avoids reliance on system SDKs. Retain this implementation, then move these same targets to RBE before release integration to reduce duplicated build time; a native CI matrix should remain useful for platform validation rather than artifact production.
Files changed (5) +103 / -3
Enhancement (2) +12 / -0
BUILD.bazelAdd the manager all build mode+8/-0
Add the manager all build mode
• Extends the Selenium Manager build flag with an 'all' value and exposes a matching configuration selector.
BUILD.bazelResolve every Manager artifact from cross-compiled targets+4/-0
Resolve every Manager artifact from cross-compiled targets
• Routes Linux, macOS, and Windows Manager aliases to Bazel cross-compiled outputs whenever '--manager=all' is active. Existing host-build and pinned-download behavior remains unchanged.
.bazelrcAlign Bazel release builds with Cargo optimizations+6/-0
Align Bazel release builds with Cargo optimizations
• Sets the macOS deployment target to 11.0 for universal binaries. Adds fat LTO, size optimization, single codegen unit, abort-on-panic, and symbol stripping to match Cargo's release profile.
MODULE.bazelConfigure hermetic native dependencies and cross-target toolchains+29/-3
Configure hermetic native dependencies and cross-target toolchains
• Adds Bazel modules for bzip2, xz, and zstd and injects them into Rust crates instead of running crate build scripts. Registers Linux LLVM execution toolchains and adds musl and LLVM-MinGW Rust target triples.
BUILD.bazelBuild Selenium Manager for all supported target platforms+56/-0
Build Selenium Manager for all supported target platforms
• Defines Rust platform transitions for musl Linux, Intel and ARM macOS, and 64-bit LLVM-MinGW Windows targets. Extracts transitioned outputs, marks them incompatible on Windows hosts, and combines macOS executables into a universal binary with LLVM lipo.
1. New cross-build routing is untested✗ Dismissed📘 Rule violation☼ Reliability
Description
The new manager_all selections redirect packaged manager aliases to cross-compiled artifacts, but
the PR adds no test that exercises the flag or verifies those resolutions. An incorrect platform
label, output path, or compatibility condition would surface only during a real --manager=all
build and could reach every language package consuming these aliases.
Compliance rule 5 requires focused regression coverage for behavioral changes. The cited files
introduce the new flag-driven routing and cross-compilation outputs, while repository search shows
manager_all only in these production build definitions and no test exercising the new selection.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
The new `--manager=all` behavior routes every packaged Selenium Manager binary through cross-compilation without automated regression coverage for the selected artifacts.
## Fix Focus Areas
- common/manager/BUILD.bazel[12-45]
- rust/BUILD.bazel[24-76]
## Recommended Fix
Add focused Bazel tests that build or analyze each manager alias with `--manager=all`, verify that every alias resolves to its expected cross-compiled output, verify the macOS combined binary, and cover the declared Windows-host incompatibility.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Context sources
Review mode: ⚖️ Balanced: Downgraded extended -> standard: change is below the extended eligibility bar (hunks 12/18, lines 106/200; both must reach the floor). Router rationale: This build-system change introduces cross-compilation across multiple targets, toolchains, C dependencies, platform transitions, and release optimizations, creating many independent, easy-to-miss correctness risks.
Tip of the day
💡 Did you know, you can reply 'qodo' on any finding to push back, ask questions, or dig deeper
titusfortner
changed the title
[build] add --manager=all to cross-compile every Selenium Manager binary from one host
[build] add bazel flag to support cross-compiling all Selenium Manager binaries from Linux or Mac
Sep 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
B-buildIncludes scripting, bazel and CI integrationsB-managerSelenium ManagerC-rustRust code is mostly Selenium Manager
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 Related Issues
Implements a subset of #17586
Builds on #18024 (adds
allto--manager)💥 What does this PR do?
--manager=all, which makes every binding resolve a Selenium Manager binary cross-compiled from the current source instead of the pinned download. Note that nothing yet uses this new flag in our build/release process (see Additional Considerations)--config=releasenow uses the same optimizations ascargo build --release🔧 Implementation Notes
allis marked incompatible on Windows hosts until the upstream fixes ship (see Additional Considerations)--manager=allare slightly different from what is built (and published) from Cargo🤖 AI assistance
💡 Additional Considerations
rules_rs_short_toolchain_names.patchbut upstream patch would be better)<os>-<arch>resolution in every binding) has the following issues to address still:--manager=all--manager=allto split the fat binary and include ARM64 WindowsWhen the release process uses(done in [build] use RBE to prepare and build the artifacts for releases #18041)--manager=all, each publish job cross-compiles all 6 binaries on its own runner (15 minutes each in parallel), so we probably want to redo the process to use RBE first--manager=all, need to document the changes in released binaries (discussed above)🔄 Types of changes