From 5c8fb48ad328b69fc944afa1c1331d6b8969dfbd Mon Sep 17 00:00:00 2001 From: Yoshifumi Nakamura Date: Mon, 3 Aug 2026 23:34:34 +0900 Subject: [PATCH] Add Go download fallback for site runner setup Signed-off-by: Yoshifumi Nakamura --- scripts/site/setup_runner.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/site/setup_runner.sh b/scripts/site/setup_runner.sh index 76ceca2..82398d4 100755 --- a/scripts/site/setup_runner.sh +++ b/scripts/site/setup_runner.sh @@ -237,8 +237,16 @@ mkdir -p "$work_dir" install_go() { local go_pkg="go${go_version}.linux-${go_arch}.tar.gz" + local go_url info "Installing Go ${go_version} (${go_arch})" - curl -fsSL "https://go.dev/dl/${go_pkg}" -o "${work_dir}/${go_pkg}" + for go_url in "https://go.dev/dl/${go_pkg}" "https://dl.google.com/go/${go_pkg}"; do + if curl -fsSL "$go_url" -o "${work_dir}/${go_pkg}"; then + break + fi + rm -f "${work_dir}/${go_pkg}" + info "Go download failed from ${go_url}; trying the next mirror" + done + [[ -s "${work_dir}/${go_pkg}" ]] || die "Failed to download ${go_pkg}" tar -C "$work_dir" -xzf "${work_dir}/${go_pkg}" export GOROOT="${work_dir}/go" export GOBIN="${GOROOT}/bin"