From 742c173a16945fb00df6463b7b8bddc6eef217fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Wed, 8 Jun 2022 19:47:34 +0200 Subject: [PATCH] Fix building with go 1.16 The newly added platform `windows-arm64` isn't available on Go 1.16. In fact, any unsupported "GOOS-GOARCH" pair should be skipped so that we can keep adding platforms in the future without worrying about whether the Go version that an extension author has chosen for their project supports that platform. --- build_and_release.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build_and_release.sh b/build_and_release.sh index 74a15b1..72cec75 100755 --- a/build_and_release.sh +++ b/build_and_release.sh @@ -33,9 +33,15 @@ if [ -n "$GH_EXT_BUILD_SCRIPT" ]; then echo "invoking build script override $GH_EXT_BUILD_SCRIPT" ./"$GH_EXT_BUILD_SCRIPT" "$tag" else + IFS=$'\n' read -d '' -r -a supported_platforms < <(go tool dist list) || true + for p in "${platforms[@]}"; do goos="${p%-*}" goarch="${p#*-}" + if [[ " ${supported_platforms[*]} " != *" ${goos}/${goarch} "* ]]; then + echo "warning: skipping unsupported platform $p" >&2 + continue + fi ext="" if [ "$goos" = "windows" ]; then ext=".exe"