| 1 | # shellcheck shell=bash |
| 2 | # One client program's build phase for darwin/arm64 (darwin.nix). GOOS, |
| 3 | # GOARCH and CGO_ENABLED come from the derivation, and so do targets, the |
| 4 | # package's build targets. They are linked, so a symbol Darwin lacks fails |
| 5 | # here as it would on a Mac. go vet runs over every package of this |
| 6 | # repository they are built from: those of the main module and of the |
| 7 | # modules it replaces with their directories beside it. The vetted |
| 8 | # packages are kept for the output. |
| 9 | # shellcheck disable=SC2154,SC2086 # targets and vetted are lists of packages |
| 10 | mkdir -p "$TMPDIR/bin" |
| 11 | go build -o "$TMPDIR/bin/" $targets |
| 12 | vetted="$(go list -deps -f '{{with .Module}}{{if or .Main .Replace}}{{$.ImportPath}}{{end}}{{end}}' $targets)" |
| 13 | go vet $vetted |
| 14 | echo "$vetted" > "$TMPDIR/vetted" |