mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/api: work around Windows rename issue on the builders
More cmd/api/run.go hell. Fixes #9407 Change-Id: If8fb446a2471d6372beb0534c9ab6824029b404c Reviewed-on: https://go-review.googlesource.com/2054 Reviewed-by: Alex Brainman <alex.brainman@gmail.com> Reviewed-by: Minux Ma <minux@golang.org>
This commit is contained in:
parent
e98f2179b1
commit
1e4b642f8d
1 changed files with 13 additions and 1 deletions
|
|
@ -150,7 +150,19 @@ func prepGoPath() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := os.Rename(tmpDir, finalDir); err != nil {
|
if err := os.Rename(tmpDir, finalDir); err != nil {
|
||||||
log.Fatal(err)
|
if os.IsExist(err) {
|
||||||
|
// A different builder beat us into putting this repo into
|
||||||
|
// its final place. But that's fine; if it's there, it's
|
||||||
|
// the right version and we can use it.
|
||||||
|
//
|
||||||
|
// This happens on the Go project's Windows builders
|
||||||
|
// especially, where we have two builders (386 and amd64)
|
||||||
|
// running at the same time, trying to compete for moving
|
||||||
|
// it into place.
|
||||||
|
os.RemoveAll(tmpDir)
|
||||||
|
} else {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return gopath
|
return gopath
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue