Compile packages for selected targets
This commit is contained in:
@@ -213,6 +213,7 @@ func installGoShim(t *testing.T, failure string, delayVet bool) string {
|
||||
}
|
||||
directory := t.TempDir()
|
||||
logPath := filepath.Join(directory, "go-commands")
|
||||
envLogPath := filepath.Join(directory, "go-environment")
|
||||
settings := map[string]string{
|
||||
"GOHOSTOS": runtime.GOOS,
|
||||
"GOHOSTARCH": runtime.GOARCH,
|
||||
@@ -250,8 +251,15 @@ if [ "${1-}" = "vet" ] && [ "%s" = "vet" ]; then
|
||||
echo "Go vet failed" >&2
|
||||
exit 2
|
||||
fi
|
||||
if [ "${1-}" = "build" ]; then
|
||||
printf '%%s/%%s|%%s\n' "${GOOS-}" "${GOARCH-}" "${CGO_ENABLED-}" >> "$RELEASEKIT_GO_ENV_LOG"
|
||||
if [ "%s" = "build" ] || [ "%s" = "${GOOS-}/${GOARCH-}" ]; then
|
||||
echo "Go build failed" >&2
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
%s
|
||||
`, failure, failure, failure, vetDelay)
|
||||
`, failure, failure, failure, failure, failure, vetDelay)
|
||||
script := fmt.Sprintf(`#!/bin/sh
|
||||
set -eu
|
||||
printf '%%s\n' "$*" >> "$RELEASEKIT_GO_LOG"
|
||||
@@ -272,6 +280,7 @@ exit 0
|
||||
}
|
||||
t.Setenv("PATH", path)
|
||||
t.Setenv("RELEASEKIT_GO_LOG", logPath)
|
||||
t.Setenv("RELEASEKIT_GO_ENV_LOG", envLogPath)
|
||||
return logPath
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user