Suppose I have a minimal Scala WORKSPACE file:
workspace(name = "scala_example") git_repository( name = "io_bazel_rules_scala", commit = "e9e65ada59823c263352d10c30411f4739d5df25", remote = "https://github.com/bazelbuild/rules_scala", ) load("@io_bazel_rules_scala//scala:scala.bzl", "scala_repositories") scala_repositories() load("@io_bazel_rules_scala//scala:toolchains.bzl", "scala_register_toolchains") scala_register_toolchains()
And then a BUILD :
load("@io_bazel_rules_scala//scala:scala.bzl", "scala_binary") scala_binary( name = "example-bin", srcs = glob(["*.scala"]), main_class = "Example", )
And Example.scala :
object Example { def main(args: Array[String]): Unit = println("running") }
I can run bazel run example-bin and everything works fine. My problem is that this recent PR_PRICE PR_1 has changed the way the Java binary path is used to use the following:
ctx.attr._java_runtime[java_common.JavaRuntimeInfo].java_executable_exec_path
... instead of the previous ctx.executable._java.short_path .
After this change, the Java binary path includes an external directory in a path that seems deprecated (?). This means that after this change, if I run the following:
bazel run --nolegacy_external_runfiles example-bin
Does not work any more:
INFO: Running command line: bazel-bin/example-bin .../.cache/bazel/_bazel_travis/03e97e9dbbfe483081a6eca2764532e8/execroot/scala_example/bazel-out/k8-fastbuild/bin/example-bin.runfiles/scala_example/example-bin_wrapper.sh: line 4: .../.cache/bazel/_bazel_travis/03e97e9dbbfe483081a6eca2764532e8/execroot/scala_example/bazel-out/k8-fastbuild/bin/example-bin.runfiles/scala_example/external/local_jdk/bin/java: No such file or directory ERROR: Non-zero return code '127' from command: Process exited with status 127
It also breaks down some of the scenarios that I have that are waiting for paths not external .
Why java_executable_exec_path give me this external path? Is there any option that I can give basel to convince him not to do this?