我的 Bazel C++ 项目的 CI 构建最近中断了。该错误表示 HTTPS 下载http_repository
失败:
INFO: Repository eigen instantiated at:
no stack (--record_rule_instantiation_callstack not enabled)
Repository rule http_archive defined at:
/private/var/tmp/_bazel_kstaley/efca2582089f638162aa9f6ccfe4282e/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in <toplevel>
WARNING: Download from https://gitlab.com/libeigen/eigen/-/archive/56b3e3f3f8ca9972ca390c8296fde363bdab271c/eigen-56b3e3f3f8ca9972ca390c8296fde363bdab271c.tar.gz failed: class com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException GET returned 406 Not Acceptable
ERROR: An error occurred during the fetch of repository 'eigen':
java.io.IOException: Error downloading [https://gitlab.com/libeigen/eigen/-/archive/56b3e3f3f8ca9972ca390c8296fde363bdab271c/eigen-56b3e3f3f8ca9972ca390c8296fde363bdab271c.tar.gz] to /private/var/tmp/_bazel_kstaley/efca2582089f638162aa9f6ccfe4282e/external/eigen/eigen-56b3e3f3f8ca9972ca390c8296fde363bdab271c.tar.gz: GET returned 406 Not Acceptable
ERROR: /Users/kstaley/src/myrepo/library/utilities/BUILD:58:11: //library/utilities:mylibrary depends on @eigen//:eigen in repository @eigen which failed to fetch. no such package '@eigen//': java.io.IOException: Error downloading [https://gitlab.com/libeigen/eigen/-/archive/56b3e3f3f8ca9972ca390c8296fde363bdab271c/eigen-56b3e3f3f8ca9972ca390c8296fde363bdab271c.tar.gz] to /private/var/tmp/_bazel_kstaley/efca2582089f638162aa9f6ccfe4282e/external/eigen/eigen-56b3e3f3f8ca9972ca390c8296fde363bdab271c.tar.gz: GET returned 406 Not Acceptable
ERROR: Analysis of target '//library/mypackage:mybinary' failed; build aborted: Analysis failed
我想在本地重现此错误,但我已经在本地缓存了该文件(下载错误似乎是间歇性的),因此我的本地构建成功。
如何删除 Bazel 缓存的.tar.gz
文件副本,以便在本地测试下载是否成功?我已经尝试过bazel clean --expunge
,但它似乎并没有删除下载的工件。