gpt4 book ai didi

bazel - 如何为指定的 bazel 规则禁用远程缓存

转载 作者:行者123 更新时间:2023-12-01 19:36:58 25 4
gpt4 key购买 nike

在我的 bazelrc 中,我有以下配置:

build:remote --spawn_strategy=remote
build:remote --remote_local_fallback
build:remote --genrule_strategy=sandboxed
build:remote --remote_rest_cache=http://HOST/PATH

这适用于所有带有“bazel build -c opt --config=remote//...”的规则。但是,对于某些类型的规则,我想为它们禁用远程缓存,因为它们不太可能命中缓存,而且它们的输出通常非常大。

假设我们有一个带有助记符 MNEMONIC 的规则,我应该如何关闭该规则的远程缓存?非常感谢!

最佳答案

我们终于通过“--modify_execution_info”解决了这个问题:

build:remote --modify_execution_info MNEMONIC=+no-cache

助记词可以通过'bazel aquery'查询。

我们已验证此方法适用于 Bazel 2.2.0。

关于bazel - 如何为指定的 bazel 规则禁用远程缓存,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48438650/

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