无法触发 Bazel 远程缓存。

huangapple go评论64阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2023年6月13日 12:08:52
  • 转载请务必保留本文链接:https://go.coder-hub.com/76461636.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定