[rust] Allow cross-compilation of selenium-manager on all platforms#17586
Open
AutomatedTester wants to merge 18 commits into
Open
[rust] Allow cross-compilation of selenium-manager on all platforms#17586AutomatedTester wants to merge 18 commits into
AutomatedTester wants to merge 18 commits into
Conversation
* origin/trunk: (97 commits) [py] update python dependencies (#17490) [build] fix renovate reported issues with configuration [build] remove base-ref from renovate workflows it does not work for the use case I had for them [build] add renovate dependency workflow (#17504) [build] simplify commit-changes workflow (#17503) [build] clarify dependency pin and update tasks (#17463) [build] do not rerun or attempt to upload logs unless workflow failure is from the Bazel step [build] fix renovate ignore rules_python to v2 until upstream fixed [build] renovate ignore rules_python until upstream fixed [build] bump rules_closure version (#17500) [build] bump rules_jvm_external (#17501) [js] remove npm dependency by using bazel for everything (#17499) [build] bump ruby versions to latest patch releases (#17496) [dotnet] [build] Support deterministic build output (#17497) [build] remove renovate update requests pending work done in #17427 (#17498) [dotnet] [build] Fix remote linkage in SourceLink (#17495) [rust] update reqwest to 0.13 (#17488) [build] bump low-risk Bazel module dependencies (#17494) [dotnet] run format against slnx instead of looping csproj (#17483) [build] ignore renovate.json references in renovate recommendations ... # Conflicts: # MODULE.bazel # rust/BUILD.bazel
The windows-link/windows-targets patches were changing include_str! from lowercase readme.md to uppercase README.md, but: 1. The crate only ships readme.md (lowercase), and 2. Bazel's Rust sandbox does not include non-source files like README regardless of case, so include_str! always fails. Fix: patch out the doc attribute entirely. On Windows, the LLVM toolchain package only provides a GNU-mode clang++ (-target x86_64-w64-windows-gnu) which cannot handle the MSVC-style linker flags (/NOLOGO, .lib files) that rustc emits for x86_64-pc-windows-msvc targets. Re-enable MSVC auto-detection on Windows so Visual Studio's link.exe is available for rustc when building native Windows targets.
…Linux The hermetic LLVM exec toolchains for Windows and macOS cause build failures: - Windows: the minimal LLVM package ships only a GNU-mode clang++ that rejects MSVC-style linker flags (/NOLOGO, backslash paths, .lib files) generated by rustc for x86_64-pc-windows-msvc targets. Removing the Windows LLVM exec toolchain registrations and keeping the existing BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=0 override allows Bazel to detect Visual Studio's link.exe on Windows runners. - macOS: the hermetic LLVM sysroot lacks compiler-rt builtins at the path aws-lc-sys's build script expects (configuration hash mismatch between the build-script exec config and the main build config). It also lacks system frameworks like CoreServices required by aws-lc-sys. Removing the macOS LLVM exec toolchain registration and re-enabling Xcode CC detection (BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=0, BAZEL_NO_APPLE_CPP_TOOLCHAIN=0) lets macOS runners use Xcode clang which has full system access. LLVM exec toolchains are kept only for Linux where they work correctly and are required for the musl cross-compilation targets.
4 tasks
5 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Taking over #17427 from @shs96c who was unable to complete it.
This PR enables cross-compilation of
selenium-managerfrom any host platform to all target platforms (Linux x86_64/aarch64, macOS aarch64, Windows x86_64/aarch64) using the hermetic LLVM toolchain.Key changes (from Simon's original work)
rules_rs0.0.61 → 0.0.76 andllvm0.7.9 → 0.8.0rust/BUILD.bazelFixes applied in this PR (on top of Simon's work)
windows-link/windows-targetspatches: The original patches changedinclude_str!("../readme.md")→include_str!("../README.md")but the crate only shipsreadme.mdand Bazel's Rust sandbox doesn't include non-source files anyway. Fixed by removing the doc attribute entirely.clang++.exewhich can't handle MSVC-style linker flags (/NOLOGO,.libfiles). Re-enabled MSVC CC auto-detection on Windows so Visual Studio'slink.exeis used for MSVC targets.Known remaining issues
aws-lc-sys(pulled in transitively throughreqwest→rustls→rustls-platform-verifier) requiresCoreServices.frameworkwhich is not in the hermetic LLVM macOS SDK sysroot. Adding the aarch64 macOS exec LLVM toolchain (new in this PR) causes this to surface. Fixing requires either a different TLS cert backend or a richer macOS sysroot — tracked as a follow-up.Closes #17427