如何更改Bazel构建输出目录位置
我有小项目,在构建它之后,他的布局看起来像这样。
|-- BUILD
|-- README.md
|-- VERSION
|-- WORKSPACE
|-- bazel-bin -> /home/bkch/.cache/bazel/_bazel_bkch/172376ca1288bc6e93208fc2d53c0b74/execroot/distroless/bazel-out/k8-fastbuild/bin
|-- bazel-distroless -> /home/bkch/.cache/bazel/_bazel_bkch/172376ca1288bc6e93208fc2d53c0b74/execroot/distroless
|-- bazel-out -> /home/bkch/.cache/bazel/_bazel_bkch/172376ca1288bc6e93208fc2d53c0b74/execroot/distroless/bazel-out
|-- bazel-testlogs -> /home/bkch/.cache/bazel/_bazel_bkch/172376ca1288bc6e93208fc2d53c0b74/execroot/distroless/bazel-out/k8-fastbuild/testlogs
|-- debian_archives.bzl
Bazel-bin,Bazel-Out,Bazel-Distross,Bazel-Testlogs
是用户根文件夹中.cache
的符号链接。我想在当前的工作区目录中构建它们,而不是符号链接。
来自 documentation>我尝试使用<我尝试使用<代码> - output_base = $ pwd/output或-oxput_user_root = $ pwd/output 。当我使用这些选项的那一刻,bazel build
是各种随机原因失败。但是,当我使用bazel build //... 使用以下选项时,构建成功。
I have small project and after building it he layout looks like this.
|-- BUILD
|-- README.md
|-- VERSION
|-- WORKSPACE
|-- bazel-bin -> /home/bkch/.cache/bazel/_bazel_bkch/172376ca1288bc6e93208fc2d53c0b74/execroot/distroless/bazel-out/k8-fastbuild/bin
|-- bazel-distroless -> /home/bkch/.cache/bazel/_bazel_bkch/172376ca1288bc6e93208fc2d53c0b74/execroot/distroless
|-- bazel-out -> /home/bkch/.cache/bazel/_bazel_bkch/172376ca1288bc6e93208fc2d53c0b74/execroot/distroless/bazel-out
|-- bazel-testlogs -> /home/bkch/.cache/bazel/_bazel_bkch/172376ca1288bc6e93208fc2d53c0b74/execroot/distroless/bazel-out/k8-fastbuild/testlogs
|-- debian_archives.bzl
bazel-bin, bazel-out, bazel-distroless, bazel-testlogs
are symbolic links to .cache
in user root folder. Instead of the symbolic links I would like to build them in current workspace directory.
From the documentation I tried using --output_base=$PWD/output or --output_user_root=$PWD/output
. The moment I use these options the bazel build
is failing of various random reasons. But when I use bazel build //...
with out these options the build succeeds.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想答案可能在这里... github.com/bazelbuild/bazelbuild/bazel/bazel/bazel/sissues/13601 <13601 <13601 <13601 <13601 <13601 <13601 <13601 < /a>我们只需要在项目文件夹之外包含文件夹-Axput_base = $ pwd /../输出
I guess the answer might lie here... github.com/bazelbuild/bazel/issues/13601 we just need to have folder outside the project folder --output_base=$PWD/../output