bazel的遠程工作人員指南(here)解釋瞭如何在本地啓動遠程工作人員,然後對其運行bazel。在單獨的機器上運行bazel遠程執行程序測試
我試了一下,確實是工作(與臭蟲reported in GH)
的另一種嘗試是通過運行其泊塢窗容器內和運行巴澤勒反對創建運行一個虛擬單獨的機器上遠程工作者。但它以不同的方式失敗 - 我想這次我錯誤地使用了它。
這是我的搬運工文件:
FROM openjdk:8
# install release bazel from apt
RUN echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list
RUN curl https://bazel.build/bazel-release.pub.gpg | apt-key add -
RUN apt-get update && apt-get install -y zip bazel
# compile dev bazel from sources
RUN mkdir -p /usr/src/bazel
# "bazel" has the latest development code of bazel from github
COPY bazel /usr/src/bazel
WORKDIR /usr/src/bazel
RUN bazel build src/bazel
# compile remote_worker using latest development bazel
RUN bazel-bin/src/bazel build //src/tools/remote_worker
# prepare cache folder
RUN mkdir -p /tmp/test
# Run remote-worker
CMD ["bazel-bin/src/tools/remote_worker/remote_worker","--work_path=/tmp/test","--listen_port=3030"]
構建它,我只是跑了泊塢窗結合港口到本地主機後:
$ docker build -t bazel-worker .
$ docker run -p 3030:3030 bazel-worker
然後跑巴澤勒Java測試使用遠程工作者運行: (可以檢查出我的測試回購here)
$ bazel --host_jvm_args=-Dbazel.DigestFunction=SHA1 test \
--spawn_strategy=remote \
--remote_executor=localhost:3030 \
--remote_cache=localhost:3030 \
--strategy=Javac=remote \
--remote_local_fallback=false \
--remote_timeout=600 \
//src/main/java/com/example/...
但我得到這個奇怪的錯誤消息:
____Loading package: src/main/java/com/example
____Loading package: @bazel_tools//tools/cpp
____Loading package: @local_jdk//
____Loading package: @local_config_xcode//
____Loading package: @local_config_cc//
____Loading complete. Analyzing...
____Loading package: tools/defaults
____Loading package: @bazel_tools//third_party/java/jdk/langtools
____Loading package: @junit//jar
____Found 1 test target...
____Building...
____[0/2] BazelWorkspaceStatusAction stable-status.txt
____[2/4] Creating source manifest for //src/main/java/com/example:my_test
____From Extracting interface @junit//jar:jar:
/tmp/test/build-80057300-ffd2-49ea-a20b-3f234d9963db/external/bazel_tools/tools/jdk/ijar/ijar: 1: /tmp/test/build-80057300-ffd2-49ea-a20b-3f234d9963db/external/bazel_tools/tools/jdk/ijar/ijar: �����0��!H__PAGEZEROx__TEXTpp__text__TEXT/��__stubs__TEXT0p�__stub_helper__TEXT���__gcc_except_tab__TEXT�: not found
/tmp/test/build-80057300-ffd2-49ea-a20b-3f234d9963db/external/bazel_tools/tools/jdk/ijar/ijar: 2: /tmp/test/build-80057300-ffd2-49ea-a20b-3f234d9963db/external/bazel_tools/tools/jdk/ijar/ijar: Syntax error: word unexpected (expecting ")")
ERROR: /private/var/tmp/_bazel_ors/719f891d5db9fd5e73ade25b0c847fd1/external/junit/jar/BUILD.bazel:2:1: output 'external/junit/jar/_ijar/jar/external/junit/jar/junit-4.12-ijar.jar' was not created.
ERROR: /private/var/tmp/_bazel_ors/719f891d5db9fd5e73ade25b0c847fd1/external/junit/jar/BUILD.bazel:2:1: not all outputs were created or valid.
____Building complete.
Target //src/main/java/com/example:my_test failed to build
Use --verbose_failures to see the command lines of failed build steps.
____Elapsed time: 13.614s, Critical Path: 0.21s
上午我做錯了什麼?在實際(或虛擬)遠程計算機上運行遠程工作人員時,我需要以不同的方式運行它(而不是僅在本地運行)?
重要提:我的機器是mac osx sierra
。 ,我相信docker openjdk:8
是基於ubuntu的,我正在運行本地bazel開發版本(sha 956810b6ee24289e457a4b8d0a84ff56eb32c264
)。
哦哇。不知道。 Out use case特別圍繞利用其他體系結構而不是我們的本地機器。有關於GH的問題嗎?我們可以遵循的東西? –
我編輯我的答案是更完整一點。我不知道生長激素問題,但它在我們的待辦事項清單上,以支持這個即將到來的問題。 –