Skip to content

Commit

Permalink
Fix building with go 1.16
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mislav committed Jun 8, 2022
1 parent 95edaf7 commit 742c173
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions build_and_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 742c173

Please sign in to comment.