@@ -1314,17 +1314,25 @@ func cmdbootstrap() {
1314
1314
1315
1315
var noBanner , noClean bool
1316
1316
var debug bool
1317
+ var force bool
1317
1318
flag .BoolVar (& rebuildall , "a" , rebuildall , "rebuild all" )
1318
1319
flag .BoolVar (& debug , "d" , debug , "enable debugging of bootstrap process" )
1319
1320
flag .BoolVar (& noBanner , "no-banner" , noBanner , "do not print banner" )
1320
1321
flag .BoolVar (& noClean , "no-clean" , noClean , "print deprecation warning" )
1322
+ flag .BoolVar (& force , "force" , force , "build even if the port is marked as broken" )
1321
1323
1322
1324
xflagparse (0 )
1323
1325
1324
1326
if noClean {
1325
1327
xprintf ("warning: --no-clean is deprecated and has no effect; use 'go install std cmd' instead\n " )
1326
1328
}
1327
1329
1330
+ // Don't build broken ports by default.
1331
+ if broken [goos + "/" + goarch ] && ! force {
1332
+ fatalf ("build stopped because the port %s/%s is marked as broken\n \n " +
1333
+ "Use the -force flag to build anyway.\n " , goos , goarch )
1334
+ }
1335
+
1328
1336
// Set GOPATH to an internal directory. We shouldn't actually
1329
1337
// need to store files here, since the toolchain won't
1330
1338
// depend on modules outside of vendor directories, but if
@@ -1674,12 +1682,18 @@ var cgoEnabled = map[string]bool{
1674
1682
}
1675
1683
1676
1684
// List of platforms which are supported but not complete yet. These get
1677
- // filtered out of cgoEnabled for 'dist list'. See golang.org /issue/28944
1685
+ // filtered out of cgoEnabled for 'dist list'. See go.dev /issue/28944.
1678
1686
var incomplete = map [string ]bool {
1679
1687
"linux/sparc64" : true ,
1680
1688
}
1681
1689
1682
- // List of platforms which are first class ports. See golang.org/issue/38874.
1690
+ // List of platforms that are marked as broken ports.
1691
+ // These require -force flag to build, and also
1692
+ // get filtered out of cgoEnabled for 'dist list'.
1693
+ // See go.dev/issue/56679.
1694
+ var broken = map [string ]bool {}
1695
+
1696
+ // List of platforms which are first class ports. See go.dev/issue/38874.
1683
1697
var firstClass = map [string ]bool {
1684
1698
"darwin/amd64" : true ,
1685
1699
"darwin/arm64" : true ,
@@ -1825,7 +1839,7 @@ func cmdlist() {
1825
1839
1826
1840
var plats []string
1827
1841
for p := range cgoEnabled {
1828
- if incomplete [p ] {
1842
+ if broken [ p ] || incomplete [p ] {
1829
1843
continue
1830
1844
}
1831
1845
plats = append (plats , p )
0 commit comments