From f97abe3f97eb3c14bfe39f32f327e9cf11497748 Mon Sep 17 00:00:00 2001 From: Giles Cope Date: Mon, 15 Jun 2026 06:26:34 +0100 Subject: [PATCH 1/3] ci: retry/back off toolchain downloads (zig, kind, antlr, gcloud, golangci-lint) Signed-off-by: Giles Cope --- Earthfile | 4 +++- ast/parser/Earthfile | 4 ++-- examples/zig/Earthfile | 10 +++++++++- tests/cloud-push-pull/Earthfile | 2 +- tests/with-docker-kind/Earthfile | 8 ++++++-- 5 files changed, 21 insertions(+), 7 deletions(-) diff --git a/Earthfile b/Earthfile index e453a63a6a..60581eca8a 100644 --- a/Earthfile +++ b/Earthfile @@ -124,7 +124,9 @@ lint: RUN apk add --no-cache curl # renovate: datasource=github-releases packageName=golangci/golangci-lint LET golangci_lint_version=2.12.2 - RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/main/install.sh | sh -s -- -b $(go env GOPATH)/bin v$golangci_lint_version + RUN curl -sSfL --retry 7 --retry-all-errors -o /tmp/golangci-install.sh https://raw.githubusercontent.com/golangci/golangci-lint/main/install.sh && \ + sh /tmp/golangci-install.sh -b $(go env GOPATH)/bin v$golangci_lint_version && \ + rm /tmp/golangci-install.sh COPY ./.golangci.yaml . COPY --dir +code/earthly / FOR mod_path IN $(find . -name go.mod -print0 | xargs -0 dirname) diff --git a/ast/parser/Earthfile b/ast/parser/Earthfile index 3b6e9cba80..17a4ef2cc7 100644 --- a/ast/parser/Earthfile +++ b/ast/parser/Earthfile @@ -9,8 +9,8 @@ RUN apk add --no-cache ca-certificates curl openssl go && \ WORKDIR /usr/local/lib # renovate: datasource=github-releases packageName=antlr/antlr4 ARG --global ANTLR_VERSION=4.13.1 -RUN echo curl -O https://www.antlr.org/download/antlr-${ANTLR_VERSION}-complete.jar -RUN curl -O https://www.antlr.org/download/antlr-${ANTLR_VERSION}-complete.jar +RUN echo curl -fSLO --retry 7 --retry-all-errors https://www.antlr.org/download/antlr-${ANTLR_VERSION}-complete.jar +RUN curl -fSLO --retry 7 --retry-all-errors https://www.antlr.org/download/antlr-${ANTLR_VERSION}-complete.jar WORKDIR /earthly parser: diff --git a/examples/zig/Earthfile b/examples/zig/Earthfile index 56c568a488..8b0121b231 100644 --- a/examples/zig/Earthfile +++ b/examples/zig/Earthfile @@ -13,13 +13,21 @@ deps: ARG ZIG_ARCH="aarch64" END RUN echo "Installing Zig $ZIG_VERSION for $ZIG_ARCH" + # ziglang.org throttles/drops CI downloads; on top of wget's own rapid + # retries, back off between attempts — rapid retries hit the same + # throttle and all fail. RUN \ if echo "$ZIG_VERSION" | grep -q -- "-dev"; then \ export URL="https://ziglang.org/builds/zig-$ZIG_ARCH-linux-$ZIG_VERSION.tar.xz"; \ else \ export URL="https://ziglang.org/download/$ZIG_VERSION/zig-$ZIG_ARCH-linux-$ZIG_VERSION.tar.xz"; \ fi && \ - wget --tries=5 --timeout=300 --continue -O zig.tar.xz "$URL" && \ + for i in 1 2 3 4 5; do \ + wget --tries=5 --timeout=300 --continue -O zig.tar.xz "$URL" && break; \ + [ "$i" -lt 5 ] || exit 1; \ + echo "Zig download attempt $i/5 failed; retrying" >&2; \ + sleep $((i * 10)); \ + done && \ mkdir zig && \ tar -xvf zig.tar.xz --strip-components 1 -C zig && \ ln -sf /zig/zig /usr/bin/zig diff --git a/tests/cloud-push-pull/Earthfile b/tests/cloud-push-pull/Earthfile index 4bb6827a6e..f52ef259e9 100644 --- a/tests/cloud-push-pull/Earthfile +++ b/tests/cloud-push-pull/Earthfile @@ -10,7 +10,7 @@ all: BUILD +amazon-elastic-container-registry google-base: - RUN curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-420.0.0-linux-x86_64.tar.gz && \ + RUN curl -fO --retry 7 --retry-all-errors https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-420.0.0-linux-x86_64.tar.gz && \ tar -xvzf google-cloud-sdk-420.0.0-linux-x86_64.tar.gz && \ ./google-cloud-sdk/install.sh -q && \ ls -la /test/google-cloud-sdk diff --git a/tests/with-docker-kind/Earthfile b/tests/with-docker-kind/Earthfile index 8e202bceba..d47aef4e45 100644 --- a/tests/with-docker-kind/Earthfile +++ b/tests/with-docker-kind/Earthfile @@ -14,7 +14,11 @@ all: alpine-kind: ARG DIND_IMAGE=earthbuild/dind:alpine-3.22-docker-28.3.3-r5 FROM $DIND_IMAGE - RUN wget -O ./kind https://kind.sigs.k8s.io/dl/v$KIND_VERSION/kind-linux-amd64 && chmod +x kind + RUN for i in 1 2 3 4 5; do \ + wget -c -T 60 -O ./kind https://kind.sigs.k8s.io/dl/v$KIND_VERSION/kind-linux-amd64 && break; \ + [ "$i" -lt 5 ] || exit 1; \ + sleep $((i * 5)); \ + done && chmod +x kind WITH DOCKER RUN (update-alternatives --set iptables /usr/sbin/iptables-legacy || true) && ./kind create cluster --verbosity 99999 --retain || { \ ./kind export logs ./logs && \ @@ -26,7 +30,7 @@ alpine-kind: ubuntu-kind: ARG DIND_IMAGE=earthbuild/dind:ubuntu-24.04-docker-28.4.0-1 FROM $DIND_IMAGE - RUN curl -Lo ./kind https://kind.sigs.k8s.io/dl/v$KIND_VERSION/kind-linux-amd64 && chmod +x kind + RUN curl -fLo ./kind --retry 7 --retry-all-errors https://kind.sigs.k8s.io/dl/v$KIND_VERSION/kind-linux-amd64 && chmod +x kind WITH DOCKER RUN ./kind create cluster --verbosity 99999 --retain || { \ ./kind export logs ./logs && \ From d63fe6838e2c72d2f8eab0b1332c7b795961a31a Mon Sep 17 00:00:00 2001 From: Squirrel Date: Mon, 15 Jun 2026 06:44:13 +0100 Subject: [PATCH 2/3] Apply suggestion from @gilescope --- ast/parser/Earthfile | 1 - 1 file changed, 1 deletion(-) diff --git a/ast/parser/Earthfile b/ast/parser/Earthfile index 17a4ef2cc7..1f35381a25 100644 --- a/ast/parser/Earthfile +++ b/ast/parser/Earthfile @@ -9,7 +9,6 @@ RUN apk add --no-cache ca-certificates curl openssl go && \ WORKDIR /usr/local/lib # renovate: datasource=github-releases packageName=antlr/antlr4 ARG --global ANTLR_VERSION=4.13.1 -RUN echo curl -fSLO --retry 7 --retry-all-errors https://www.antlr.org/download/antlr-${ANTLR_VERSION}-complete.jar RUN curl -fSLO --retry 7 --retry-all-errors https://www.antlr.org/download/antlr-${ANTLR_VERSION}-complete.jar WORKDIR /earthly From 4053e314bbb75f621a9265c8d29d51c5aa376bc4 Mon Sep 17 00:00:00 2001 From: Squirrel Date: Mon, 15 Jun 2026 06:45:57 +0100 Subject: [PATCH 3/3] Apply suggestion from @gilescope --- examples/zig/Earthfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/zig/Earthfile b/examples/zig/Earthfile index 8b0121b231..8ab27ca795 100644 --- a/examples/zig/Earthfile +++ b/examples/zig/Earthfile @@ -23,7 +23,7 @@ deps: export URL="https://ziglang.org/download/$ZIG_VERSION/zig-$ZIG_ARCH-linux-$ZIG_VERSION.tar.xz"; \ fi && \ for i in 1 2 3 4 5; do \ - wget --tries=5 --timeout=300 --continue -O zig.tar.xz "$URL" && break; \ + wget -t 5 -T 300 -c -O zig.tar.xz "$URL" && break; \ [ "$i" -lt 5 ] || exit 1; \ echo "Zig download attempt $i/5 failed; retrying" >&2; \ sleep $((i * 10)); \