diff options
author | sago35 <[email protected]> | 2021-04-24 09:59:14 +0900 |
---|---|---|
committer | sago35 <[email protected]> | 2021-04-24 09:59:14 +0900 |
commit | 8a3f96b2210a0cbe03e30c6420e27dc3569db29a (patch) | |
tree | a635f44f864032fa2025186850269a1b5dd910ba | |
parent | b6618823914f3008ae986141a847fec38076bfef (diff) | |
download | tinygo-8a3f96b2210a0cbe03e30c6420e27dc3569db29a.tar.gz tinygo-8a3f96b2210a0cbe03e30c6420e27dc3569db29a.zip |
builder: fixed a problem with multiple process build casesbitcode-path
-rw-r--r-- | builder/build.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/builder/build.go b/builder/build.go index cd292e0bc..e543fedbb 100644 --- a/builder/build.go +++ b/builder/build.go @@ -300,7 +300,13 @@ func Build(pkgName, outpath string, config *compileopts.Config, action func(Buil if err != nil { return err } - return os.Rename(f.Name(), bitcodePath) + + // Rename may fail if another process is trying to write to + // the same file. However, in this case, the failure is + // acceptable because the result of the other process can be + // used. + os.Rename(f.Name(), bitcodePath) + return nil }, } jobs = append(jobs, job) |