Skip to content

java_library and java_binary with empty java file fails with confusing error message #486

@hhclam

Description

@hhclam

$ touch dummy.java
$ cat BUILD
java_library(
name = "test",
srcs = ["dummy.java"],
)
$ bazel build :test

The above build command would fail with:
NFO: Found 1 target...
INFO: From Building libtest.jar (1 files):
Expected at least one FLOW event
BazelJavaBuilder threw exception: java compilation returned status ABNORMAL
ERROR: /net/hsalpha/userhome/alpha/Projects/bazel-fail2/BUILD:1:1: Java compilation in rule '//:test' failed: java failed: error executing command external/local-jdk/bin/java -Xbootclasspath/p:third_party/java/jdk/langtools/javac.jar -client -jar tools/jdk/JavaBuilder_deploy.jar @bazel-out/local_linux-fastbuild/bin/libtest.jar-2.params: com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
Target //:test failed to build
Use --verbose_failures to see the command lines of failed build steps.

The command should choose to not fail or output a more meaningful error message that suggests the user to check the source files.

Metadata

Metadata

Assignees

Labels

P3We're not considering working on this, but happy to review a PR. (No assignee)type: bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions