bazelbuild / bazel

a fast, scalable, multi-language and extensible build system
https://bazel.build
Apache License 2.0
23.2k stars 4.06k forks source link

Projects broken by testonly enforcement on ci.bazel.io: re2, rules_scala, rules_web, TensorFlow, TensorFlow_Serving #1967

Closed damienmg closed 8 years ago

damienmg commented 8 years ago

Creating that bug for tracking my progress toward fixing those projects. /cc @philwo fyi

damienmg commented 8 years ago

https://code-review.googlesource.com/8610 for re2

damienmg commented 8 years ago

bazelbuild/rules_scala#98 for rules_scala

damienmg commented 8 years ago

bazelbuild/rules_web#20 for rules_web tensorflow/tensorflow#5093 for TensorFlow

TensorFlow serving needs tensorflow pr in.

damienmg commented 8 years ago

(fwiw it is not really blocking the release itself, we need to fix the project).

rules_webtesting have been fixed by upstream.

petemounce commented 8 years ago

I'm using bazel 0.3.2 to compile some scala (with rules_scala at https://github.com/petemounce/rules_scala/commit/deff6c2806df8fbfc98330c06c1444140664daa2 (which is our fork with a I-think-unrelated diff), and I think I'm affected by this issue. I have a target like

scala_library(
    name = "testing_scala",
    testonly = 1,
    srcs = glob(["*.java"]),
    visibility = ["//visibility:private"],
    deps = [
        "//third_party/scalatest",
    ],
)

If I've understood the issue correctly, this is because of the testonly = 1 attribute being set.

Error output:

ERROR: /Users/peter/src/everything/ArchUtil/src/main/java/improbable/archutil/testing/BUILD:7:1: Couldn't build file ArchUtil/src/main/java/improbable/archutil/testing/testing_scala.jar: scala //ArchUtil/src/main/java/improbable/archutil/testing:testing_scala failed: scalac failed: error executing command bazel-out/host/bin/external/io_bazel_rules_scala/src/java/io/bazel/rulesscala/scalac/scalac @bazel-out/local-fastbuild/bin/ArchUtil/src/main/java/improbable/archutil/testing/testing_scala_worker_input: com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
Exception in thread "main" java.lang.RuntimeException: nope
    at io.bazel.rulesscala.scalac.ScalaCInvoker.main(ScalaCInvoker.java:338)
Caused by: java.io.IOException: Cannot run program "external/local_jdk/bin/javac ": error=2, No such file or directory
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
    at io.bazel.rulesscala.scalac.ScalaCInvoker.compileJavaSources(ScalaCInvoker.java:293)
    at io.bazel.rulesscala.scalac.ScalaCInvoker.processRequest(ScalaCInvoker.java:237)
    at io.bazel.rulesscala.scalac.ScalaCInvoker.main(ScalaCInvoker.java:334)
Caused by: java.io.IOException: error=2, No such file or directory
    at java.lang.UNIXProcess.forkAndExec(Native Method)
    at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
    at java.lang.ProcessImpl.start(ProcessImpl.java:134)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
    ... 3 more
damienmg commented 8 years ago

I think your error is related to Sandboxing on OS X. It is definitely not related to testonly,

petemounce commented 8 years ago

@damienmg is https://github.com/bazelbuild/bazel/wiki/How-to-turn-off-sandboxing accurate? It seems to refer to options applicable for bazel test, not bazel build? Also, the snippet contains commas, so it looks not quite right?

petemounce commented 8 years ago

If I change my bazel invocation to ${BAZEL} build --spawn_strategy=standalone --genrule_strategy=standalone --test_strategy=standalone //my_target I get the same error.

kchodorow commented 8 years ago

Is this still a release blocker?

damienmg commented 8 years ago

@kchodorow: No sorry. @petemounce: yes it should be

petemounce commented 8 years ago

@damienmg it's ok - I was able to repro my issue within rules_scala and have PR'd with that failing test bazelbuild/rules_scala#101. No capacity to actually fix right at the moment as I'm involved in our own release cycle.

damienmg commented 8 years ago

Ok only TensorFlow_Serving is left.

damienmg commented 8 years ago

And now TensorFlow_Serving is fixed! Breakage over \o/