Skip to content

Commit

Permalink
go/internal/gcimporter: temporarily skip the contraints package on the
Browse files Browse the repository at this point in the history
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 <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
  • Loading branch information
findleyr committed Sep 24, 2021
1 parent 6d1e33f commit e1e06b8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
10 changes: 9 additions & 1 deletion go/internal/gcimporter/iexport_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (
"golang.org/x/tools/go/buildutil"
"golang.org/x/tools/go/internal/gcimporter"
"golang.org/x/tools/go/loader"
"golang.org/x/tools/internal/testenv"
)

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

// Create a package containing type and value errors to ensure
Expand Down
6 changes: 6 additions & 0 deletions internal/testenv/testenv.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,3 +297,9 @@ func SkipAfterGo1Point(t Testing, x int) {
t.Skipf("running Go version %q is version 1.%d, newer than maximum 1.%d", runtime.Version(), Go1Point(), x)
}
}

// UsesGenerics reports if the standard library package stdlibPkg uses
// generics.
func UsesGenerics(stdlibPkg string) bool {
return stdlibPkg == "constraints"
}

0 comments on commit e1e06b8

Please sign in to comment.