From: Dmitri Shuralyov Date: Sat, 29 Jul 2023 20:33:13 +0000 (-0400) Subject: cmd/dist: tolerate macOS writing .DS_Store to GOROOT/bin X-Git-Tag: go1.22rc1~1450 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=f719de079871f51998e735fc51b3891d50217262;p=gostls13.git cmd/dist: tolerate macOS writing .DS_Store to GOROOT/bin I was trying out gorebuild (a program that runs make.bash many times) on a macOS system. Unfortunately there were a few failed invocations on my first try, but not with a very good or interesting reason: go tool dist: unexpected new file in $GOROOT/bin: .DS_Store Tolerate it since it's not unexpected, and will not affect the build. Change-Id: I656536b896098c2ba934667196d4ce82e706c8da Reviewed-on: https://go-review.googlesource.com/c/go/+/513763 Reviewed-by: Dmitri Shuralyov Run-TryBot: Dmitri Shuralyov Reviewed-by: Russ Cox TryBot-Result: Gopher Robot Auto-Submit: Dmitri Shuralyov --- diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go index 8973a87168..0afa5f062e 100644 --- a/src/cmd/dist/build.go +++ b/src/cmd/dist/build.go @@ -1577,6 +1577,9 @@ func cmdbootstrap() { ok[f] = true } for _, f := range binFiles { + if gohostos == "darwin" && filepath.Base(f) == ".DS_Store" { + continue // unfortunate but not unexpected + } elem := strings.TrimSuffix(filepath.Base(f), ".exe") if !ok[f] && elem != "go" && elem != "gofmt" && elem != goos+"_"+goarch { fatalf("unexpected new file in $GOROOT/bin: %s", elem)