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

Most upvoted comments