#!/usr/bin/env sh # Fetch the build.zig.zon dependency tree with backoff. zig gives up on the # first failed download, and the tangled.org archive endpoint rate-limits, so a # cold cache could fail a pipeline before any check ran. set -eu zig="${ZIG:-.ci-cache/zig/zig}" attempt=1 delay=5 while ! "$zig" build --fetch; do if [ "$attempt" -ge 6 ]; then echo "dependency fetch failed after $attempt attempts" >&2 exit 1 fi echo "dependency fetch failed (attempt $attempt); retrying in ${delay}s" >&2 sleep "$delay" attempt=$((attempt + 1)) delay=$((delay * 2)) done