bazel: java_tools' ijar and singlejar don't build on windows
The ijar embedded in java_tools doesn’t build from source on Windows.
Repro:
Build one of the java_tools zips in the bazel repo:
bazel build //src:java_tools_java10_zip
export JAVA_TOOLS_ZIP=~/java_tools.zip
cp bazel-bin/src/java_tools_java10.zip $JAVA_TOOLS_ZIP
mkdir java_tools_repro && cd java_tools_repro
cat >WORKSPACE <<EOF
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "local_java_tools",
urls = ["$JAVA_TOOLS_ZIP"]
)
EOF
bazel build @local_java_tools//:lib-util
The log includes:
ERROR: D:/b/g4je5q24/execroot/io_bazel/_tmp/33823c8031b1529f3520a7c37487665f/root/ayzg7dvk/external/local_java_tools/BUILD:376:1: C++ compilation of rule '@local_java_tools//:lib-util' failed (Exit 2)
external/local_java_tools/java_tools/src/main/native/windows/util.cc(30): fatal error C1083: Cannot open include file: 'src/main/native/windows/file.h': No such file or directory
Target @local_java_tools//:ijar_cc_binary failed to build
The failing target is a cc_library
which uses strip_include_prefix
(from a naive point of view this looks like the culprit).
The BUILD file where the targets are defined is tools/jdk/BUILD.java_tools.
Example of log on Buildkite: https://storage.googleapis.com/bazel-untrusted-buildkite-artifacts/fdd75d7e-09da-44dc-8e2b-24c907722980/src\test\shell\bazel\bazel_java_tools_javac10_test\attempt_1.log
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 16 (16 by maintainers)
Commits related to this issue
- Windows: fix ijar compilation from ext.repo //src/main/native/windows:lib-file and //src/main/native/windows:lib-util were merged into one rule some time ago. This commit merges the copies of those ... — committed to laszlocsomor/bazel by laszlocsomor 5 years ago
- Update to java_tools javac11 v4.0 RELNOTES: The new java_tools release: * fixes https://github.com/bazelbuild/bazel/issues/8614 * exposes a new toolchain `@java_tools//:prebuilt_toolchain` which is u... — committed to bazelbuild/bazel by iirina 5 years ago
- Release 0.29.0 (2019-08-28) Baseline: 6c5ef5369a3ffceb8a65cc159a2fff1401242810 Cherry picks: + 338829f2633e91ae0492ee4169446465e10b5994: Fix retrying of SocketTimeoutExceptions in HttpConne... — committed to bazelbuild/bazel by a-googler 5 years ago
- Release 0.29.0 (2019-08-28) Baseline: 6c5ef5369a3ffceb8a65cc159a2fff1401242810 Cherry picks: + 338829f2633e91ae0492ee4169446465e10b5994: Fix retrying of SocketTimeoutExceptions in HttpConne... — committed to buchgr/bazel by a-googler 5 years ago
Fixed by https://github.com/bazelbuild/bazel/pull/8954