Skip to content

Commit 96d22ca

Browse files
committed
travis: Check compile support for platform before build
`linux/riscv64` platform was added in `go 1.11` but compile was not supported. Therefore buidling with `GOOS=linux GOARCH=riscv64` for `go 1.11` throws error. This check handles above case.
1 parent 972c3aa commit 96d22ca

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

.travis/complie_check.sh

+7
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ dist_list=$(go tool dist list)
55
for dist in ${dist_list}; do
66
GOOS=$(echo ${dist} | cut -d "/" -f 1)
77
GOARCH=$(echo ${dist} | cut -d "/" -f 2)
8+
set +e
9+
GOOS=${GOOS} GOARCH=${GOARCH} go tool compile -V > /dev/null
10+
if [[ $? -ne 0 ]]; then
11+
echo "Compile support for ${GOOS}/${GOARCH} is not provided; skipping"
12+
continue
13+
fi
14+
set -e
815
echo "Building ${GOOS}/${GOARCH}"
916
GOOS=${GOOS} GOARCH=${GOARCH} go build -o /dev/null
1017
done

0 commit comments

Comments
 (0)