Commit c20e5453 authored by Ian Lance Taylor's avatar Ian Lance Taylor

cmd/go: don't fail on missing runtime/internal/sys/zversion.go

The generated file runtime/internal/sys/zversion.go is deleted by
`go tool cmd dist clean` as part of running clean.bash. Don't treat
a missing file as a reason to stop running the go tool; just treat
is as meaning that runtime/internal/sys is stale.

No test because I don't particularly want to clobber $GOROOT.

Fixes #20385.

Change-Id: I5251a99542cc93c33f627f133d7118df56e18af1
Reviewed-on: https://go-review.googlesource.com/43559
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
parent acc56909
......@@ -1644,7 +1644,10 @@ func computeBuildID(p *Package) {
// different build ID in each Go release.
if p.Standard && p.ImportPath == "runtime/internal/sys" && cfg.BuildContext.Compiler != "gccgo" {
data, err := ioutil.ReadFile(filepath.Join(p.Dir, "zversion.go"))
if err != nil {
if os.IsNotExist(err) {
p.Stale = true
p.StaleReason = fmt.Sprintf("missing zversion.go")
} else if err != nil {
base.Fatalf("go: %s", err)
}
fmt.Fprintf(h, "zversion %q\n", string(data))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment