Skip to content

Commit e1e06b8

Browse files
committed
go/internal/gcimporter: temporarily skip the contraints package on the
unified builder Temporary work-around to fix TryBots until the failure can be investigated. Updates golang/go#48595 Change-Id: Ifbc27fc4551195bd9c7427bab7a79076c6ba6392 Reviewed-on: https://go-review.googlesource.com/c/tools/+/352050 Trust: Robert Findley <[email protected]> Run-TryBot: Robert Findley <[email protected]> gopls-CI: kokoro <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Rebecca Stambler <[email protected]>
1 parent 6d1e33f commit e1e06b8

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

go/internal/gcimporter/iexport_test.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import (
3131
"golang.org/x/tools/go/buildutil"
3232
"golang.org/x/tools/go/internal/gcimporter"
3333
"golang.org/x/tools/go/loader"
34+
"golang.org/x/tools/internal/testenv"
3435
)
3536

3637
func readExportFile(filename string) ([]byte, error) {
@@ -83,8 +84,15 @@ func TestIExportData_stdlib(t *testing.T) {
8384
Sizes: types.SizesFor(ctxt.Compiler, ctxt.GOARCH),
8485
},
8586
}
87+
// Temporarily skip packages that use generics on the unified builder, to fix
88+
// TryBots.
89+
//
90+
// TODO(#48595): fix this test with GOEXPERIMENT=unified.
91+
isUnified := os.Getenv("GO_BUILDER_NAME") == "linux-amd64-unified"
8692
for _, path := range buildutil.AllPackages(conf.Build) {
87-
conf.Import(path)
93+
if !(isUnified && testenv.UsesGenerics(path)) {
94+
conf.Import(path)
95+
}
8896
}
8997

9098
// Create a package containing type and value errors to ensure

internal/testenv/testenv.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,3 +297,9 @@ func SkipAfterGo1Point(t Testing, x int) {
297297
t.Skipf("running Go version %q is version 1.%d, newer than maximum 1.%d", runtime.Version(), Go1Point(), x)
298298
}
299299
}
300+
301+
// UsesGenerics reports if the standard library package stdlibPkg uses
302+
// generics.
303+
func UsesGenerics(stdlibPkg string) bool {
304+
return stdlibPkg == "constraints"
305+
}

0 commit comments

Comments
 (0)