gpt4 book ai didi

docker - 当不支持沙箱时,有没有办法让 bazel 使用沙箱目录?

转载 作者:数据小太阳 更新时间:2023-10-29 03:04:51 32 4
gpt4 key购买 nike

我在 docker 容器内运行 bazel。在本地,当我运行没有标志的 bazel 时,我收到以下警告:

WARNING: Sandboxed execution is not supported on your system and thus hermeticity of actions cannot be guaranteed. See http://bazel.build/docs/bazel-user-manual.html#sandboxing for more information. You can turn off this warning via --ignore_unsupported_sandboxing.

虽然我失去了一些关于密封性的保证,但 Bazel 仍然会在运行我的任何 genrules 之前创建所有沙盒目录。

但是,在 CI 中,我没有看到该警告,而是在尝试沙盒时失败。所以我通过 --genrule_strategy=standalone 来阻止崩溃,但现在我的 genrules 正在工作区中执行,这是我绝对不希望的。

有没有办法让我获得我在本地看到的行为,其中显式沙盒调用被禁用,因为它们会失败,但正确复制 srcs/deps/data 的 tmp 目录创建仍然发生?

我可以将一个标志传递给 bazel 以触发该行为,或者我可以对我的系统执行某些操作以说服 bazel 那里不支持沙盒?

最佳答案

您使用的是哪个 bazel 版本,当它尝试使用沙盒时会崩溃?我怀疑c2d773ef4c0916a44fd7936f7bbc22ec55102915将解决该问题,因为它可以检测沙箱是否工作得更加稳健,这似乎可以满足您的需求。

关于docker - 当不支持沙箱时,有没有办法让 bazel 使用沙箱目录?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43744153/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com