Use external Go in recovery commands
This commit is contained in:
@@ -143,7 +143,7 @@ func selectedPublicationRecoveryCommand(ctx context.Context, result releasekit.P
|
||||
return "", err
|
||||
}
|
||||
if args != nil {
|
||||
prefix := "go -C " + shellQuote(git.DisplayDiagnostic(args.Directory))
|
||||
prefix := "env go -C " + shellQuote(git.DisplayDiagnostic(args.Directory))
|
||||
command := "(export GOWORK=off GOTOOLCHAIN=local && releasekit_host_os=$(" + prefix + " env GOHOSTOS) && releasekit_host_arch=$(" + prefix + " env GOHOSTARCH) && GOOS=\"$releasekit_host_os\" GOARCH=\"$releasekit_host_arch\" " + prefix
|
||||
for _, arg := range args.Args {
|
||||
command += " " + shellQuote(git.DisplayDiagnostic(arg))
|
||||
|
||||
@@ -280,9 +280,10 @@ func TestColdGoToolRecoverySurvivesLauncherExit(t *testing.T) {
|
||||
if scenario.record != "" {
|
||||
selected = strings.Replace(selected, shellQuote(originalRecord), shellQuote(scenario.record), 1)
|
||||
}
|
||||
recovery := exec.Command("sh", "-c", selected)
|
||||
recovery.Dir = t.TempDir()
|
||||
foreignOS, foreignArch := foreignTarget()
|
||||
goFunction := "go() { GOOS=" + shellQuote(foreignOS) + " GOARCH=" + shellQuote(foreignArch) + " command go \"$@\"; }\n"
|
||||
recovery := exec.Command("sh", "-c", goFunction+selected)
|
||||
recovery.Dir = t.TempDir()
|
||||
recovery.Env = setEnvironment(setEnvironment(os.Environ(), "GOOS", foreignOS), "GOARCH", foreignArch)
|
||||
recovered, err := recovery.CombinedOutput()
|
||||
if scenario.status == 0 && err != nil || scenario.status != 0 && (!errors.As(err, &exitError) || exitError.ExitCode() != scenario.status) {
|
||||
|
||||
Reference in New Issue
Block a user