英文:
Can't trigger Bazel remote caching
问题
我正在尝试设置Bazel远程缓存,但迄今为止没有成功。我遇到的问题是Bazel似乎根本不读取/写入缓存。
我采取的步骤:
-
启动运行Linux的虚拟机
-
使用Bazelisk安装Bazel 6.2.1
-
克隆这个仓库https://github.com/bazelbuild/bazel
-
运行
bazel build examples/py_native:bin --disk_cache=~/.cache/bazel_disk
,在~/.cache/bazel_disk
内部未创建任何内容
Screenshot -
运行
bazel build examples/shell:bin --remote_cache=https://storage.googleapis.com/dsp-bazel-cache
,在GCS存储桶内部未创建任何内容
Screenshot
我之前已运行bazel clean
。
Screenshot
我正在尝试理解发生了什么以及在哪里可以检查日志来进行故障排除。非常感谢任何帮助。谢谢。
英文:
I'm trying set up Bazel remote caching with no success so far. The problem I'm having is that Bazel does not seem to read/write to cache at all.
Steps I took:
-
Boot up a VM running Linux
-
Install Bazel 6.2.1 using Bazelisk
-
Clone this repo https://github.com/bazelbuild/bazel
-
Run
bazel build examples/py_native:bin --disk_cache=~/.cache/bazel_disk
, nothing is created inside~/.cache/bazel_disk
Screenshot -
Run
bazel build examples/shell:bin --remote_cache=https://storage.googleapis.com/dsp-bazel-cache
, nothing is created inside the GCS bucket
Screenshot
I already run bazel clean
beforehand.
Screenshot
I'm trying to understand what happened and where I can check logs to troubleshoot here. Any help is really appreciated. Thank you.
答案1
得分: 1
"Building" a simple Python binary does not require much work. Therefore, there isn't anything interesting to cache. Try out something more heavyweight like C++, Java, or running a test.
Also, keep in mind that if the output tree is already up to date from a previous build, Bazel will not have to build anything and therefore not populate the cache. Run bazel clean
to remove the output tree.
英文:
"Building" a simple Python binary does not require much work. Therefore, there isn't anything interesting to cache. Try out something more heavyweight like C++, Java, or running a test.
Also, keep in mind that if the output tree is already up to date from a previous build, Bazel will not have to build anything and therefore not populate the cache. Run bazel clean
to remove the output tree.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论