File: compileall.sh

package info (click to toggle)
golang-github-a8m-tree 0.0~git20240104.2c8764a-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 168 kB
  • sloc: sh: 23; makefile: 5
file content (27 lines) | stat: -rwxr-xr-x 692 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash

go tool dist list >/dev/null || {
    echo 1>&2 "go tool dist list not supported - can't check compile"
    exit 0
}

failures=0
while read -r line; do
    parts=(${line//\// })
    export GOOS=${parts[0]}
    export GOARCH=${parts[1]}
    if go tool compile -V >/dev/null 2>&1 ; then
        echo Try GOOS=${GOOS} GOARCH=${GOARCH}
        if ! go install; then
            echo "*** Failed compiling GOOS=${GOOS} GOARCH=${GOARCH}"
            failures=$((failures+1))
        fi
    else
        echo Skipping GOOS=${GOOS} GOARCH=${GOARCH} as not supported
    fi
done < <(go tool dist list)

if [ $failures -ne 0 ]; then
    echo "*** $failures compile failures"
    exit 1
fi