bazel: Tests which use java stub template with large classpaths fails because of local_jdk implicit dependency

Description of the problem / feature request:

Running a java_test (we’re actually using scala_junit_test but that uses the java_stub_template.txt) with a very long classpath fails since the template assumes existence of local_jdk/bin/jar in runfiles.

Bugs: what’s the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

I’ll try to work on a full repro but given a target with a very long classpath using the java_stub_template (java_test/ scala_junit_test) try to test it with bazel 0.19.0 (maybe reproduces earlier) and it will fail with .../foo.runfiles/local_jdk/bin/jar: No such file or directory

I’ve worked around it for now by adding the following data dependency explicitly: "@bazel_tools//tools/jdk:jar",. This generates a warning about using a deprecated dependency.

What operating system are you running Bazel on?

OS X

What’s the output of bazel info release?

release 0.19.0

Have you found anything relevant by searching the web?

java_stub_template relevant line: https://github.com/bazelbuild/bazel/blob/1afef648af1851121c54f9e138d0e94cdd27ea00/src/main/java/com/google/devtools/build/lib/bazel/rules/java/java_stub_template.txt#L354 I think this is related to @cushon’s work on #5594

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Comments: 17 (14 by maintainers)

Commits related to this issue

Most upvoted comments

Any news?