[rust] Allow cross-compilation of selenium-manager on all platforms#17586
[rust] Allow cross-compilation of selenium-manager on all platforms#17586AutomatedTester wants to merge 1 commit into
Conversation
ebcdc24 to
f1cc57a
Compare
|
It's suboptimal, but I'm ok with Windows or Mac not being able to cross compile everything so long as Linux can do it all. The primary missing piece as I see it is the lack of x86 support for Mac. Ideally we can continue to release a fat binary instead of requiring the bindings to pick between them, but I guess the bindings fix is easy enough if we need to go that route. |
Cross-compiles selenium-manager for every supported OS/arch via rules_rs platform transitions + the hermetic @llvm toolchain (musl on Linux, gnullvm on Windows), so release bundles can build all platform binaries from a single host. Bindings (Java, Python, Ruby, JS, .NET) updated to probe per-(os, arch) paths from the bundle. Rebased onto trunk's rules_rs 0.0.90 / @llvm-on-macOS work (#17683).
68c9337 to
3d919b2
Compare
|
https://bazelbuild.slack.com/archives/CSV56UT0F/p1781613082861409 Raised the above discussion as I think there is a bug in the way transitive deps are handled |
I need to come back to this next week and watch updates to |
|
Hi @AutomatedTester |
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