Compile packages for selected targets

This commit is contained in:
2026-10-07 22:27:31 +00:00
parent 1c41f7a0d1
commit cabc56b134
20 changed files with 406 additions and 40 deletions

View File

@@ -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
}