Skip to content

Commit

Permalink
cmd/dist: tolerate macOS writing .DS_Store to GOROOT/bin
Browse files Browse the repository at this point in the history
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 <dmitshur@google.com>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
  • Loading branch information
dmitshur authored and gopherbot committed Aug 1, 2023
1 parent f32e0c3 commit f719de0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/cmd/dist/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f719de0

Please sign in to comment.