fix(install): name the required Go version when its toolchain is unavailable

This commit is contained in:
sam committed 2026-10-17 17:19:08 +11:00
1 parent 43977cf16c
commit b293bf5c5c
1 file changed
+8
+8
View File
@@ -103,6 +103,14 @@ if [ "${FROM_SOURCE}" = true ]; then
git clone --quiet --depth=1 "https://github.com/${REPO}.git" "${SRC_DIR}"
fi
echo "==> Building from ${SRC_DIR}..."
# Selects (and under the default GOTOOLCHAIN=auto, downloads) the toolchain
# go.mod requires, so a missing one fails here rather than mid-build.
required="$(sed -n 's/^go //p' "${SRC_DIR}/go.mod")"
if ! out="$(cd "${SRC_DIR}" && go list -m 2>&1)"; then
echo "Error: Archie needs Go ${required}, which is not available: ${out}" >&2
echo "Install Go ${required} from https://go.dev/dl, or allow the download with GOTOOLCHAIN=auto and network access to proxy.golang.org." >&2
exit 1
fi
STAGE="${TMP}/stage"
mkdir -p "${STAGE}"
# A source build is not a release: it says `dev`, and buildType=binary lets