Bazel测试返回私有GitHub存储库的校验和不匹配错误

7xllpg7q  于 2023-06-20  发布在  Git
关注(0)|答案(2)|浏览(148)

我正在尝试运行GitHub存储库上的一些测试。该repo依赖于我公司的GitHub上提供的其他私有repo。他们并没有真正为我提供运行测试的自述文件,但我在使用的项目中有一个Makefile。这是他们用于构建测试的Bazel命令:

bazel \
--host_jvm_args=-Djavax.net.ssl.trustStore='/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/security/cacerts' \
--host_jvm_args=-Djavax.net.ssl.trustStorePassword='changeit' \
test --features=race //test/e2e/...

**注意:**我必须添加--host_jvm_args参数,因为否则命令会失败,并出现SunCertPathBuilderException: unable to find valid certification path to requested target错误。

但是,在运行上面的命令时,我得到了这个错误:

ERROR: An error occurred during the fetch of repository 'com_github_pie_<company>_<repo-name>_bazel_prettier':
   java.io.IOException: Error downloading [https://github.pie.<company>.com/<repo-name>/bazel-prettier/archive/v0.0.2.tar.gz] to /private/var/tmp/_bazel_<my-user-name>/492c2b2abdc487331e7cccd373c45b9c/external/com_github_pie_<company>_<repo-name>_prettier/v0.0.2.tar.gz: Checksum was 9148ae6fb489b66238cf3b003ae22b107e00ab2583856ee81659967f2245ba46 but wanted 9d64c8d1301b78ddf87ac2774fccbe28006448d000838cb92441cc7997455426

我无法在线找到此错误的可能原因。有人可以指导我什么可能是原因和一个可能的解决方案来修复这个错误?

hsgswve4

hsgswve41#

如果您更改了版本,但保留了旧的sha256,则可能会发生这种情况。最好保持版本号和校验和之间的对应关系。

czq61nw1

czq61nw12#

请仔细阅读错误消息:

Checksum was 9148ae6fb489b66238cf3b003ae22b107e00ab2583856ee81659967f2245ba46 but wanted 9d64c8d1301b78ddf87ac2774fccbe28006448d000838cb92441cc7997455426

WORKSPACEWORKSPACE.bazel文件中有类似的内容-或者这些文件“包含”的内容:

http_archive(
    name = "com_grail_bazel_toolchain",
    sha256 = "9d64c8d1301b78ddf87ac2774fccbe28006448d000838cb92441cc7997455426",
    strip_prefix = "bazel-toolchain-master",
    urls = ["https://github.com/grailbio/bazel-toolchain/archive/master.tar.gz"],
)

只需将sha256校验和更改为Bazel建议的值或删除它。

相关问题