Skip to content
This repository has been archived by the owner on Mar 6, 2020. It is now read-only.

Commit

Permalink
cmd/gb: only run race detector on supported platforms.
Browse files Browse the repository at this point in the history
  • Loading branch information
davecheney committed Dec 16, 2015
1 parent 21b03e9 commit c0e9d85
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cmd/gb/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,17 @@ func main() {
return nil
}

// check this is a supported platform
if runtime.GOARCH != "amd64" {
fatalf("race detector not supported on %s/%s", runtime.GOOS, runtime.GOARCH)
}
switch runtime.GOOS {
case "linux", "windows", "darwin", "freebsd":
// supported
default:
fatalf("race detector not supported on %s/%s", runtime.GOOS, runtime.GOARCH)
}

// check the race runtime is built
_, err := os.Stat(filepath.Join(runtime.GOROOT(), "pkg", fmt.Sprintf("%s_%s_race", runtime.GOOS, runtime.GOARCH), "runtime.a"))
if os.IsNotExist(err) || err != nil {
Expand Down

0 comments on commit c0e9d85

Please sign in to comment.