Open tjgq opened 1 year ago
Since tw.exe and xml.exe (and launcher.exe) binaries are easily obtained (they are bundled with bazel.exe on windows), it would be good to document a workaround for providing these .exe binaries myself and convincing bazel linux binary to use them in a build.
If lucky, such workaround (if it exists) would allow me to run sh_test
and 'native_test` rules on windows executor from linux host or it would possibly reveal whether other non-yet-known issues exist with the cross-platform execution.
A Bazel with (unconditionally) embedded {tw,xml,launcher}.exe
binaries can be built from https://github.com/tjgq/bazel/tree/win-rbe-fixes (for investigation purposes only; not planning to submit as-is).
cc @meteorcloudy
Yeah, I agree we should move stuff out of @bazel_tools
as much as possible, especially platform specific dependencies, hopefully that is easier in the Bzlmod world.
Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs. If you think this issue is still relevant and should stay open, please post any comment here and the issue will no longer be marked as stale.
It's currently not possible to run a
*_test
rule on a remote Windows executor when Bazel is running on a Linux host.@bazel_tools//tools/test:test_wrapper
and@bazel_tools//tools/test:xml_writer
, which point to bundled precompiledtw.exe
andxml.exe
files if Bazel was built for Windows, and are missing otherwise (causing the test rule to fail during loading).sh_test
) have a dependency on@bazel_tools//tools/launcher:launcher
which points to a bundled precompiledlauncher.exe
if Bazel was built for Windows, and to the C++ source code otherwise. This makes a C++ cross-compiler required for a build that is otherwise not dependent on C++. In addition, C++ cross-compilation from Linux to Windows is currently broken (see #19208).Note that it's possible to run a
genrule
on Windows from a Linux host, showing that this is a testing-specific issue rather than a more general one with cross-platform Windows builds.A minimal repro is available at https://github.com/jtattermusch/win-from-linux-rbe-repro (thanks @jtattermusch!). You must use a Bazel built at or after 2f0948b.
We should consider publishing the
tw.exe
,xml.exe
andlauncher.exe
binaries to an external repository and fetch it on demand when a test is configured for Windows. This would avoid unnecessarily increasing the Bazel binary size, introducing useless dependencies on other platforms, or requiring a C++ cross compiler only for running tests.