bazel是否支持在不同平台上进行远程执行?

编程入门 行业动态 更新时间:2024-10-25 12:29:03
本文介绍了bazel是否支持在不同平台上进行远程执行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

具体来说,我想在Mac主机上的Windows worker上运行测试.

Specifically, I want to run tests on Windows workers from a Mac host.

在不同机器上运行bazel远程执行者测试的评论表示这是Bazel团队正在努力的事情,但要确认.

Comments on running bazel remote executor test on separate machines indicate that it is something that Bazel team is working on, but want to confirm.

推荐答案

只需尝试一下!

在Windows 10计算机上构建并运行本地远程执行工作器:

Build and run local remote execution worker on your Windows 10 machine:

git clone github/bazelbuild/bazel.git cd bazel bazel build src/tools/remote:worker bazel-bin/src/tools/remote/worker --work_path=/tmp/test --listen_port=8080 bazel-out/x64_windows-fastbuild/bin/src/tools/remote/worker.exe --listen_port=8080 --work_path=C:\tmp\lre --debug

注意:如果它抱怨缺少某些命令,例如zip,请打开MSYS Shell并运行实例pacman -Syu zip unzip

Note: If it complains that some commands are missing such as zip open an MSYS shell and run for instance pacman -Syu zip unzip

设置您的.bazelrc以进行远程执行:

Setup your .bazelrc to work with remote execution:

# Remote Build Execution requires a strong hash function, such as SHA256. startup --host_jvm_args=-Dbazel.DigestFunction=SHA256 # Depending on how many machines are in the remote execution instance, setting # this higher can make builds faster by allowing more jobs to run in parallel. # Setting it too high can result in jobs that timeout, however, while waiting # for a remote machine to execute them. build:remote --jobs=8 # Set various strategies so that all actions execute remotely. Mixing remote # and local execution will lead to errors unless the toolchain and remote # machine exactly match the host machine. build:remote --spawn_strategy=remote build:remote --strategy=Javac=remote build:remote --strategy=Closure=remote build:remote --genrule_strategy=remote build:remote --define=EXECUTOR=remote # Enable the remote cache so action results can be shared across machines, # developers, and workspaces. build:remote --remote_cache=localhost:8080 # Enable remote execution so actions are performed on the remote systems. build:remote --remote_executor=localhost:8080 # Enable encryption. #build:remote --tls_enabled=true # Enforce stricter environment rules, which eliminates some non-hermetic # behavior and therefore improves both the remote cache hit rate and the # correctness and repeatability of the build. build:remote --experimental_strict_action_env=true # Set a higher timeout value, just in case. build:remote --remote_timeout=3600 build:remote --auth_enabled=false # Since we're testing remote execution, let's make sure it always actually # happens. build:remote --remote_accept_cached=false test --cache_test_results=false test --test_output=errors # TODO(b/77217487): Needed for C++ builds until fix to # github/bazelbuild/bazel/issues/4883 is available. build --nocheck_visibility build:debug --verbose_failures build:debug --explain=explain.txt build:debug --verbose_explanations build:debug --toolchain_resolution_debug build:debug --subcommands

现在从Mac进行远程构建(当然localhost:8080应该更改为Windows 10计算机的IP):

Now do a remote build from your Mac (of course localhost:8080 should be changed to the IP of your Windows 10 machine):

bazel build --config=remote //:HelloWorld

现在执行远程执行

bazel run --config=remote //:HelloWorld

注意:从 github无耻地被盗/bazelbuild/bazel/issues/4962

更多推荐

bazel是否支持在不同平台上进行远程执行?

本文发布于:2023-07-03 21:57:32,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1012535.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:平台上   bazel

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!