diff options
author | Brad Fitzpatrick <bradfitz@golang.org> | 2014-12-22 18:28:16 -0800 |
---|---|---|
committer | Brad Fitzpatrick <bradfitz@golang.org> | 2014-12-23 04:55:44 +0000 |
commit | 1e4b642f8d0f2fe594d17700e8f556d2e323036b (patch) | |
tree | 4c387bf7fc46c7c05f78a46cfc6d0274d7e94534 /src/cmd/api | |
parent | e98f2179b17e4d5b4e416bf4856cf68813d17356 (diff) | |
download | go-1e4b642f8d0f2fe594d17700e8f556d2e323036b.tar.gz go-1e4b642f8d0f2fe594d17700e8f556d2e323036b.zip |
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>
Diffstat (limited to 'src/cmd/api')
-rw-r--r-- | src/cmd/api/run.go | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/cmd/api/run.go b/src/cmd/api/run.go index fb4cf78551..b814e8675e 100644 --- a/src/cmd/api/run.go +++ b/src/cmd/api/run.go @@ -150,7 +150,19 @@ func prepGoPath() string { } 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 } |