Skip to content

Commit

Permalink
cmd/dist: display first class port status in json output
Browse files Browse the repository at this point in the history
Fixes #38874

Change-Id: I819dd008fd6869d335888b4aa03dcf739da9a9a4
Reviewed-on: https://go-review.googlesource.com/c/go/+/320069
Run-TryBot: Dmitri Shuralyov <[email protected]>
TryBot-Result: Go Bot <[email protected]>
Reviewed-by: Ian Lance Taylor <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
Trust: Daniel Martí <[email protected]>
  • Loading branch information
iwdgo authored and dmitshur committed May 21, 2021
1 parent 4fb10b2 commit e4d7525
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/cmd/dist/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -1607,6 +1607,18 @@ var incomplete = map[string]bool{
"linux/sparc64": true,
}

// List of platforms which are first class ports. See golang.org/issue/38874.
var firstClass = map[string]bool{
"darwin/amd64": true,
"darwin/arm64": true,
"linux/386": true,
"linux/amd64": true,
"linux/arm": true,
"linux/arm64": true,
"windows/386": true,
"windows/amd64": true,
}

func needCC() bool {
switch os.Getenv("CGO_ENABLED") {
case "1":
Expand Down Expand Up @@ -1743,14 +1755,16 @@ func cmdlist() {
GOOS string
GOARCH string
CgoSupported bool
FirstClass bool
}
var results []jsonResult
for _, p := range plats {
fields := strings.Split(p, "/")
results = append(results, jsonResult{
GOOS: fields[0],
GOARCH: fields[1],
CgoSupported: cgoEnabled[p]})
CgoSupported: cgoEnabled[p],
FirstClass: firstClass[p]})
}
out, err := json.MarshalIndent(results, "", "\t")
if err != nil {
Expand Down

0 comments on commit e4d7525

Please sign in to comment.