Skip to content

Tests which use java stub template with large classpaths fails because of local_jdk implicit dependency  #6955

@ittaiz

Description

@ittaiz

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:

create_and_run_classpath_jar "local_jdk/bin/jar"

I think this is related to @cushon's work on #5594

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2We'll consider working on this in future. (Assignee optional)team-Rules-JavaIssues for Java rulestype: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions