[英]How can I find the root cause for bazel error Worker process did not return a WorkResponse?
My bazel v4.0.0.我的 bazel v4.0.0. build just shows me this unclear
Worker process did not return a WorkResponse
error message which seems to hide the root cause of the problem. build 只是向我展示了这个不清楚
Worker process did not return a WorkResponse
错误消息,这似乎隐藏了问题的根本原因。 It happens when I include a processor in the java_library
target.当我在
java_library
目标中包含一个处理器时会发生这种情况。
This is a reduced version of my bazel BUILD file:这是我的 bazel BUILD 文件的简化版本:
java_library(
name="java",
srcs=glob(["**/*.java"]),
plugins = [
":my_processor",
],
)
java_plugin(
name = "my_processor",
processor_class = "mypackage.MyProcessor",
)
How to find out what is wrong?如何找出问题所在?
Possibly there's more scenarios that could cause this error, my what worked for me as a is to specify --noexperimental_worker_multiplex
.可能还有更多可能导致此错误的情况,我的工作是指定
--noexperimental_worker_multiplex
。
The command bazel build //myproject/src/main/java --noexperimental_worker_multiplex
changed the error message but most importantly it revealed: Did you try to print something to stdout?命令
bazel build //myproject/src/main/java --noexperimental_worker_multiplex
更改了错误消息,但最重要的是它显示:您是否尝试将某些内容打印到标准输出?
And indeed the processor appeared to contain a System.out.println
.事实上,处理器似乎包含一个
System.out.println
。 Removing it resolved this build error.删除它解决了这个构建错误。
Btw I did remove the --noexperimental_worker_multiplex
after the problem was solved, because I think the experimental_worker_multiplex is a good thing.顺便说一句,我确实在问题解决后删除了
--noexperimental_worker_multiplex
,因为我认为experimental_worker_multiplex 是一件好事。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.