Skip to content

Commit 5ec5c57

Browse files
committed
cmd/dist: list only supported platforms
Introduce an incomplete map in dist alongside cgoEnabled and filter out the incomplete ports in 'dist list'. Fixes #28944 Change-Id: I15aae56aec570e1cd9e28906900cd5ba0db77811 Reviewed-on: https://go-review.googlesource.com/c/155839 Run-TryBot: Tobias Klauser <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]>
1 parent 2e217fa commit 5ec5c57

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/cmd/dist/build.go

+10
Original file line numberDiff line numberDiff line change
@@ -1458,6 +1458,13 @@ var cgoEnabled = map[string]bool{
14581458
"windows/arm": false,
14591459
}
14601460

1461+
// List of platforms which are supported but not complete yet. These get
1462+
// filtered out of cgoEnabled for 'dist list'. See golang.org/issue/28944
1463+
var incomplete = map[string]bool{
1464+
"linux/riscv64": true,
1465+
"linux/sparc64": true,
1466+
}
1467+
14611468
func needCC() bool {
14621469
switch os.Getenv("CGO_ENABLED") {
14631470
case "1":
@@ -1576,6 +1583,9 @@ func cmdlist() {
15761583

15771584
var plats []string
15781585
for p := range cgoEnabled {
1586+
if incomplete[p] {
1587+
continue
1588+
}
15791589
plats = append(plats, p)
15801590
}
15811591
sort.Strings(plats)

src/cmd/dist/test.go

+3
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,9 @@ func (t *tester) run() {
212212
if t.failed {
213213
fmt.Println("\nFAILED")
214214
os.Exit(1)
215+
} else if incomplete[goos+"/"+goarch] {
216+
fmt.Println("\nFAILED (incomplete port)")
217+
os.Exit(1)
215218
} else if t.partial {
216219
fmt.Println("\nALL TESTS PASSED (some were excluded)")
217220
} else {

0 commit comments

Comments
 (0)