Skip to content

Add back windows checksums - #578

Merged
tianon merged 1 commit into
docker-library:masterfrom
infosiftr:windows-fix
Jul 30, 2026
Merged

Add back windows checksums#578
tianon merged 1 commit into
docker-library:masterfrom
infosiftr:windows-fix

Conversation

@yosifkit

Copy link
Copy Markdown
Member

With the 0.36.0 buildx release, the Windows builds moved to a separate checksums file (with darwin). Most of the change to versions.sh is whitespace.

ref docker/buildx#3978

Comment thread versions.sh Outdated
Comment on lines +69 to +71
if checksums="$(_curl "https://github.com/docker/buildx/releases/download/v${buildxVersion}/checksums.txt")"; then
buildx="$(jq <<<"$checksums" -csR --arg version "$buildxVersion" '
rtrimstr("\n") | split("\n")
| map(
split(" [ *]?"; "")
checksums+=$'\n' # add back trailing newline to separate the two checksums files
if checksums+="$(_curl "https://github.com/docker/buildx/releases/download/v${buildxVersion}/checksums-signed.txt")"; then

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't love how deeply nested this makes everything -- why not capture both, with an echo in between if necessary?

Suggested change
if checksums="$(_curl "https://github.com/docker/buildx/releases/download/v${buildxVersion}/checksums.txt")"; then
buildx="$(jq <<<"$checksums" -csR --arg version "$buildxVersion" '
rtrimstr("\n") | split("\n")
| map(
split(" [ *]?"; "")
checksums+=$'\n' # add back trailing newline to separate the two checksums files
if checksums+="$(_curl "https://github.com/docker/buildx/releases/download/v${buildxVersion}/checksums-signed.txt")"; then
if checksums="$(
set -Eeuo pipefail
_curl "https://github.com/docker/buildx/releases/download/v${buildxVersion}/checksums.txt"
echo
_curl "https://github.com/docker/buildx/releases/download/v${buildxVersion}/checksums-signed.txt"
)"; then

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to make sure that either file not existing would fail so that we don't end up in the partial state again with missing windows urls. Even with set -Eeuo pipefail in the subshell, it doesn't fail early and still runs every command in it.

	if checksums="$(set -x -Eeuo pipefail 
		_curl "https://github.com/docker/buildx/releases/download/v${buildxVersion}/checksums.txt"
		_curl 'http://github.com/something-that-doesnt-exist'
		_curl "https://github.com/docker/buildx/releases/download/v${buildxVersion}/checksums-signed.txt")"; then
++ _curl https://github.com/docker/buildx/releases/download/v0.36.0/checksums.txt
++ exec
++ local code
+++ curl --silent --location -o /dev/fd/42 --write-out '%{http_code}' https://github.com/docker/buildx/releases/download/v0.36.0/checksums.txt
++ code=200
++ case "$code" in
++ return 0
++ _curl http://github.com/something-that-doesnt-exist
++ exec
++ local code
+++ curl --silent --location -o /dev/fd/42 --write-out '%{http_code}' http://github.com/something-that-doesnt-exist
++ code=404
++ case "$code" in
++ return 1
++ _curl https://github.com/docker/buildx/releases/download/v0.36.0/checksums-signed.txt
++ exec
++ local code
+++ curl --silent --location -o /dev/fd/42 --write-out '%{http_code}' https://github.com/docker/buildx/releases/download/v0.36.0/checksums-signed.txt
++ code=200
++ case "$code" in
++ return 0
jq: error (at <stdin>:56): failed to parse os-arch from filename: Found8a75be22ecf40f633fe0a0199be48fa304c0446a0d7fa8a53d7c71b1d0093028

@yosifkit yosifkit Jul 30, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this would work for a single if.

if checksums="$(_curl "https://github.com/docker/buildx/releases/download/v${buildxVersion}/checksums.txt")"  \
	&& checksums+=$'\n'"$(_curl "https://github.com/docker/buildx/releases/download/v${buildxVersion}/checksums-signed.txt")"; then

Edit: I am unsure how to make nice whitespace with it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, that's probably the set -e propagation (or rather, lack thereof) inside our function -- I think it needs || return 1 on curl 🤔

$ bash -Eeuo pipefail -xc 'foo="$( echo yes; false; echo no )"; echo "$foo"'
++ echo yes
++ false
++ echo no
+ foo='yes
no'
+ echo 'yes
no'
yes
no

$ bash -Eeuo pipefail -xc 'foo="$( set -Eeuo pipefail; echo yes; false; echo no )"; echo "$foo"'
++ set -Eeuo pipefail
++ echo yes
++ false
+ foo=yes
$ # we fail on `foo=` because the whole line ends up returning `false`

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$ bash -Eeuo pipefail -xc 'if foo="$( set -Eeuo pipefail; echo yes; false; echo no )"; then echo "$foo"; fi'
++ set -Eeuo pipefail
++ echo yes
++ false
++ echo no
+ foo='yes
no'
+ echo 'yes
no'
yes
no

😢 😭

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oof; here's how I'd probably handle the whitespace in your suggested two-parter:

Suggested change
if checksums="$(_curl "https://github.com/docker/buildx/releases/download/v${buildxVersion}/checksums.txt")"; then
buildx="$(jq <<<"$checksums" -csR --arg version "$buildxVersion" '
rtrimstr("\n") | split("\n")
| map(
split(" [ *]?"; "")
checksums+=$'\n' # add back trailing newline to separate the two checksums files
if checksums+="$(_curl "https://github.com/docker/buildx/releases/download/v${buildxVersion}/checksums-signed.txt")"; then
if \
checksums="$(_curl "https://github.com/docker/buildx/releases/download/v${buildxVersion}/checksums.txt")" \
&& checksums+=$'\n' \
&& checksums+="$(_curl "https://github.com/docker/buildx/releases/download/v${buildxVersion}/checksums-signed.txt")" \
; then

@tianon
tianon merged commit bb87f1b into docker-library:master Jul 30, 2026
5 checks passed
@tianon
tianon deleted the windows-fix branch July 30, 2026 23:46
docker-library-bot added a commit to docker-library-bot/official-images that referenced this pull request Jul 30, 2026
Changes:

- docker-library/docker@bb87f1b: Merge pull request docker-library/docker#578 from infosiftr/windows-fix
- docker-library/docker@6e14e9f: Add back windows checksums
- docker-library/docker@5145971: Update 29-rc
- docker-library/docker@1be6a77: Update 29 to 29.7.0
- docker-library/docker@b0d5cfc: Update 29-rc to buildx 0.36.0
- docker-library/docker@0ddcd31: Update 29 to buildx 0.36.0
yosifkit pushed a commit to docker-library/official-images that referenced this pull request Jul 31, 2026
Changes:

- docker-library/docker@bb87f1b: Merge pull request docker-library/docker#578 from infosiftr/windows-fix
- docker-library/docker@6e14e9f: Add back windows checksums
- docker-library/docker@5145971: Update 29-rc
- docker-library/docker@1be6a77: Update 29 to 29.7.0
- docker-library/docker@b0d5cfc: Update 29-rc to buildx 0.36.0
- docker-library/docker@0ddcd31: Update 29 to buildx 0.36.0

Co-authored-by: Docker Library Bot <doi+docker-library-bot@docker.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants