Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
damienmg opened this issue Oct 20, 2016 · 13 comments
Assignees
Labels
breakage category: misc > testing P1 I'll work on this now. (Assignee required) type: bug

Comments

@damienmg
Copy link
Contributor

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

@damienmg
Copy link
Contributor Author

@damienmg damienmg self-assigned this Oct 20, 2016
damienmg added a commit to damienmg/rules_scala that referenced this issue Oct 20, 2016
testonly was not enforced in previous version of Bazel but this will
be fixed in the next version of Bazel. Correct it for rules_scala.

Tested with `bazel build ...`

Tracking bug: bazelbuild/bazel#1967
@damienmg
Copy link
Contributor Author

bazelbuild/rules_scala#98 for rules_scala

damienmg added a commit to damienmg/rules_web that referenced this issue Oct 20, 2016
Fixing the testonly actually requires to be able to set testonly on bind
or to remove all bind (I would recommend the latest). Next version of
Bazel will be fixed to correctly enforce testonly so I recommend merging
that change for now, then fix the external bindings.

Tested with `bazel build ...`

Tracking bug: bazelbuild/bazel#1967
damienmg added a commit to damienmg/tensorflow that referenced this issue Oct 20, 2016
This target is shiped into the pip_package so it is not testonly. Current
version of Bazel does not enforce testonly but the next version will.
Tested by building build_pip_package.

Tracking bug: bazelbuild/bazel#1967
@damienmg
Copy link
Contributor Author

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

TensorFlow serving needs tensorflow pr in.

@damienmg
Copy link
Contributor Author

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

rules_webtesting have been fixed by upstream.

gopherbot pushed a commit to google/re2 that referenced this issue Oct 24, 2016
testonly was not enforced in previous version of Bazel but this will
be fixed in the next version of Bazel. Correct it for re2.

Tested with `bazel build ...`

Tracking bug: bazelbuild/bazel#1967

Change-Id: I880326e99bc8ed4904473dcf0939bd7ab3b41b26
Reviewed-on: https://code-review.googlesource.com/8610
Reviewed-by: John Cater <jcater@google.com>
Reviewed-by: Paul Wankadia <junyer@google.com>
@petemounce
Copy link
Contributor

petemounce commented Oct 24, 2016

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
Copy link
Contributor Author

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

@petemounce
Copy link
Contributor

@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
Copy link
Contributor

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
Copy link
Contributor

Is this still a release blocker?

@damienmg
Copy link
Contributor Author

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

@petemounce
Copy link
Contributor

@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
Copy link
Contributor Author

Ok only TensorFlow_Serving is left.

@damienmg
Copy link
Contributor Author

damienmg commented Nov 2, 2016

And now TensorFlow_Serving is fixed! Breakage over \o/

@damienmg damienmg closed this as completed Nov 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breakage category: misc > testing P1 I'll work on this now. (Assignee required) type: bug
Projects
None yet
Development

No branches or pull requests

3 participants