bazel: Java_tools tests don't pass on windows
Description of the problem:
Java_tools tests don’t pass on Windows. The tests pass on Linux and MacOS. First failing commit is https://github.com/bazelbuild/bazel/commit/e906f89 Update java_toolchain to properly declare config transitions.
Failing build: https://buildkite.com/bazel-trusted/java-tools-binaries-java/builds/146#3727aefe-9cca-4ffc-8aad-bd77a8841428
The test that fails is bazel_java_test.sh:1493 test_build_hello_world_with_remote_embedded_tool_targets
It is a simple java_library, java_binary built with line:
bazel build //java/main:main_deploy.jar --define EXECUTOR=remote
The define selects to compile singlejar
(instead of a precompiled version).
Dependency chain:
//java/main:main_deploy.jar (c100cb1)
//java/main:main (c100cb1)
@bazel_tools//tools/jdk:current_java_toolchain (c100cb1)
@bazel_tools//tools/jdk:legacy_current_java_toolchain (c100cb1)
@bazel_tools//tools/jdk:remote_toolchain (c100cb1)
@remote_java_tools_linux//:toolchain (c100cb1)
@remote_java_tools_linux//:singlejar (68ac4b4)
@remote_java_tools_linux//:singlejar_cc_bin (68ac4b4)
@remote_java_tools_linux//:output_jar (68ac4b4)
@remote_java_tools_linux//:combiners (68ac4b4)
Emitted error:
ERROR: C:/tools/msys64/home/b/_bazel_b/7qk42fzu/execroot/io_bazel/_tmp/cb0c59f5da4da9f39b5558b460a48a99/root/7mljusu
5/external/local_java_tools/BUILD:733:11: C++ compilation of rule '@local_java_tools//:combiners' failed (Exit 2): cl.exe
failed: error executing command C:/Program Files (x86)/Microsoft Visual
Studio/2019/BuildTools/VC/Tools/MSVC/14.27.29110/bin/HostX64/x64/cl.exe /nologo /DCOMPILER_MSVC /DNOMINMAX
/D_WIN32_WINNT=0x0601 /D_CRT_SECURE_NO_DEPRECATE ... (remaining 27 argument(s) skipped)
--
| bazel-out/x64_windows-opt-exec-
2B5CBBC6/bin/external/local_java_tools/_virtual_includes/combiners\src/tools/singlejar/combiners.h(24): fatal error C1083:
Cannot open include file: 'src/tools/singlejar/transient_bytes.h': No such file or directory
| Target //java/main:main_deploy.jar failed to build
| Use --verbose_failures to see the command lines of failed build steps.
| INFO: Elapsed time: 2.046s, Critical Path: 1.01s
| INFO: 49 processes: 48 internal, 1 worker.
| FAILED: Build did NOT complete successfully
| FAILED: Build did NOT complete successfully
src/tools/singlejar/transient_bytes.h
is defined in cc_library
hdrs
and works on other OSes. It uses strip_include_prefix
. Possibly problem with directory separator?
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 30 (30 by maintainers)
I can now run the test and see the failure. I can’t reproduce it outside of a test, which points to some kind of environment mismatch. I’ll keep looking.