bazelbuild / rules_docker

Rules for building and handling Docker images with Bazel

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SHA of go-containerregistry rule archive changed

tigersoldier opened this issue Β· comments

🐞 bug report

Affected Rule

repositories from go:image.bzl

Is this a regression?

Yes. The SHA of the rules archive it loads has changed.

Description

The sha for com_github_google_go_containerregistry has changed. It's defined here: https://github.com/bazelbuild/rules_docker/blob/master/repositories/go_repositories.bzl#L47

πŸ”¬ Minimal Reproduction

http_archive(
    name = "io_bazel_rules_docker",
    sha256 = "59536e6ae64359b716ba9c46c39183403b01eabfbd57578e84398b4829ca499a",
    strip_prefix = "rules_docker-0.22.0",
    urls = ["https://github.com/bazelbuild/rules_docker/releases/download/v0.22.0/rules_docker-v0.22.0.tar.gz"],
)

load(
    "@io_bazel_rules_docker//repositories:repositories.bzl",
    container_repositories = "repositories",
)

container_repositories()

load(
    "@io_bazel_rules_docker//go:image.bzl",
    go_image_repos = "repositories",
)
go_image_repos()   # <--- Fails here

πŸ”₯ Exception or Error

WARNING: Download from https://github.com/google/go-containerregistry/archive/v0.5.1.tar.gz failed: class com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException Checksum was 3f56ff9d903d76e760620669949ddaee8760e51093f9c2913786c85242075fda but wanted c3e28d8820056e7cc870dbb5f18b4f7f7cbd4e1b14633a6317cef895fdb35203
ERROR: An error occurred during the fetch of repository 'com_github_google_go_containerregistry':
   Traceback (most recent call last):
	File "/home/runner/.cache/bazel/_bazel_runner/e0938f14ce54e0f03d50e903d9231267/external/bazel_gazelle/internal/go_repository.bzl", line 148, column 33, in _go_repository_impl
		ctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Error downloading [https://github.com/google/go-containerregistry/archive/v0.5.1.tar.gz] to /home/runner/.cache/bazel/_bazel_runner/e0938f14ce54e0f03d50e903d9231267/external/com_github_google_go_containerregistry/temp15752699527277308271/v0.5.1.tar.gz: Checksum was 3f56ff9d903d76e760620669949ddaee8760e51093f9c2913786c85242075fda but wanted c3e28d8820056e7cc870dbb5f18b4f7f7cbd4e1b14633a6317cef895fdb35203
ERROR: /runner/_work/go-servers/go-servers/WORKSPACE:202:15: fetching go_repository rule //external:com_github_google_go_containerregistry: Traceback (most recent call last):

🌍 Your Environment

Operating System:

  
MacOS, Linux
  

Output of bazel version:

  
Bazelisk version: development
Build label: 5.4.0
Build target: bazel-out/darwin-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Thu Dec 15 16:22:52 2022 (1671121372)
Build timestamp: 1671121372
Build timestamp as int: 1671121372
  

Rules_docker version:

  
0.22
  

Anything else relevant?

This was https://github.com/orgs/community/discussions/46034

Anyone using GitHub downloads ought to use release artifacts, but I don't think this was a rules_docker bug