Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bazel: nogo build fails on upstream dependencies containing go 1.18 templates #87420

Open
knz opened this issue Sep 6, 2022 · 4 comments
Open
Labels
A-build-system C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.

Comments

@knz
Copy link
Contributor

knz commented Sep 6, 2022

Describe the problem

An earlier version of PR #86457 imported github.com/rivo/uniseg at version 0.3, which uses go 1.18 templates (in its source file properties.go).

When this code is imported inside crdb, the CI build fails with:

[09:54:29]W:			 [UnusedLint] ERROR: /home/roach/.cache/bazel/_bazel_roach/c5a4e7d36696d9cd970af2045211a7df/external/com_github_rivo_uniseg/BUILD.bazel:3:11: GoCompilePkg external/com_github_rivo_uniseg/uniseg.a failed: (Exit 1): builder failed: error executing command bazel-out/k8-opt-exec-2B5CBBC6-ST-9cec1ec31dd7/bin/external/go_sdk/builder compilepkg -sdk external/go_sdk -installsuffix linux_amd64 -tags acceptance,bazel,gss,bazel,gss -src ... (remaining 53 arguments skipped)
[09:54:29]W:			 [UnusedLint] 
[09:54:29]W:			 [UnusedLint] Use --sandbox_debug to see verbose messages from the sandbox
[09:54:29]W:			 [UnusedLint] compilepkg: panic: 0: got 0 arguments but 1 type parameters
[09:54:29]W:			 [UnusedLint] 
[09:54:29]W:			 [UnusedLint] goroutine 339 [running]:
[09:54:29]W:			 [UnusedLint] go/types.(*Checker).validateTArgLen(0xc000d12040?, 0xc0064b6270?, 0x1, 0x0)
[09:54:29]W:			 [UnusedLint] 	GOROOT/src/go/types/instantiate.go:131 +0x1b4
[09:54:29]W:			 [UnusedLint] go/types.(*Checker).instance(0x0, 0x0, {0xbc0ce0?, 0xc001adbe40?}, {0xfbeec0?, 0x0, 0x0}, 0xc000d12040)
[09:54:29]W:			 [UnusedLint] 	GOROOT/src/go/types/instantiate.go:89 +0x1a5
[09:54:29]W:			 [UnusedLint] go/types.Instantiate(0xc0064e3400?, {0xbc0ce0?, 0xc001adbe40?}, {0xfbeec0?, 0x40ed14?, 0xc006491598?}, 0x30?)
[09:54:29]W:			 [UnusedLint] 	GOROOT/src/go/types/instantiate.go:59 +0x2e9
[09:54:29]W:			 [UnusedLint] golang.org/x/tools/internal/typeparams.Instantiate(...)
[09:54:29]W:			 [UnusedLint] 	golang.org/x/tools/internal/typeparams/external/org_golang_x_tools/internal/typeparams/typeparams_go118.go:150
[09:54:29]W:			 [UnusedLint] golang.org/x/tools/go/ssa.createInstance(0xc000c321a0, {0xfbeec0?, 0x0, 0x0}, 0xc0005e8690, {0xbc0588?, 0xc000928240}, 0xc0001a43e0)
[09:54:29]W:			 [UnusedLint] 	golang.org/x/tools/go/ssa/external/org_golang_x_tools/go/ssa/instantiate.go:128 +0x105
[09:54:29]W:			 [UnusedLint] golang.org/x/tools/go/ssa.(*instanceSet).lookupOrCreate(0xc0004dc4e0, {0xfbeec0, 0x0, 0x0}, 0xc0064907c8?)
[09:54:29]W:			 [UnusedLint] 	golang.org/x/tools/go/ssa/external/org_golang_x_tools/go/ssa/instantiate.go:110 +0x105
[09:54:29]W:			 [UnusedLint] golang.org/x/tools/go/ssa.(*Program).needsInstance(0xa29280?, 0x0?, {0xfbeec0, 0x0, 0x0}, 0xaaaaaaaaaaa?)
[09:54:29]W:			 [UnusedLint] 	golang.org/x/tools/go/ssa/external/org_golang_x_tools/go/ssa/instantiate.go:85 +0xfb
[09:54:29]W:			 [UnusedLint] golang.org/x/tools/go/ssa.(*builder).expr0(0xc006491a28, 0xc000c32340, {0xbc3438?, 0xc000926e80?}, {0x7, {0xbc0ce0, 0xc0007afa00}, {0x0, 0x0}})
[09:54:29]W:			 [UnusedLint] 	golang.org/x/tools/go/ssa/external/org_golang_x_tools/go/ssa/builder.go:781 +0xc07
[09:54:29]W:			 [UnusedLint] golang.org/x/tools/go/ssa.(*builder).expr(0x203001?, 0xc000c32340, {0xbc3438?, 0xc000926e80?})
[09:54:29]W:			 [UnusedLint] 	golang.org/x/tools/go/ssa/external/org_golang_x_tools/go/ssa/builder.go:610 +0x18e
[09:54:29]W:			 [UnusedLint] golang.org/x/tools/go/ssa.(*builder).setCallFunc(0x7f4c0b228948?, 0x80?, 0xc000184400?, 0xc0064e8040)
[09:54:29]W:			 [UnusedLint] 	golang.org/x/tools/go/ssa/external/org_golang_x_tools/go/ssa/builder.go:1006 +0x316
[09:54:29]W:			 [UnusedLint] golang.org/x/tools/go/ssa.(*builder).setCall(0xa27060?, 0xc000395e90?, 0xc0009132c0, 0xc0064e8040)
[09:54:29]W:			 [UnusedLint] 	golang.org/x/tools/go/ssa/external/org_golang_x_tools/go/ssa/builder.go:1085 +0x34
[09:54:29]W:			 [UnusedLint] golang.org/x/tools/go/ssa.(*builder).expr0(0xc006491a28, 0xc000c32340, {0xbc3138?, 0xc0009132c0?}, {0x7, {0xbc0ba0, 0xc0005e4fa8}, {0x0, 0x0}})
[09:54:29]W:			 [UnusedLint] 	golang.org/x/tools/go/ssa/external/org_golang_x_tools/go/ssa/builder.go:686 +0x27d3
[09:54:29]W:			 [UnusedLint] golang.org/x/tools/go/ssa.(*builder).expr(0xc000c32340?, 0xc000c32340, {0xbc3138?, 0xc0009132c0?})
[09:54:29]W:			 [UnusedLint] 	golang.org/x/tools/go/ssa/external/org_golang_x_tools/go/ssa/builder.go:610 +0x18e
[09:54:29]W:			 [UnusedLint] golang.org/x/tools/go/ssa.(*builder).expr0(0xc006491a28, 0xc000c32340, {0xbc34f8?, 0xc000928360?}, {0x7, {0xbc0bc8, 0xf76060}, {0x0, 0x0}})
[09:54:29]W:			 [UnusedLint] 	golang.org/x/tools/go/ssa/external/org_golang_x_tools/go/ssa/builder.go:862 +0x1a10
[09:54:29]W:			 [UnusedLint] golang.org/x/tools/go/ssa.(*builder).expr(0x2?, 0xc000c32340, {0xbc34f8?, 0xc000928360?})
[09:54:29]W:			 [UnusedLint] 	golang.org/x/tools/go/ssa/external/org_golang_x_tools/go/ssa/builder.go:610 +0x18e
[09:54:29]W:			 [UnusedLint] golang.org/x/tools/go/ssa.(*builder).stmt(0x44c014?, 0xc000c32340, {0xbc3678?, 0xc000926f20?})
[09:54:29]W:			 [UnusedLint] 	golang.org/x/tools/go/ssa/external/org_golang_x_tools/go/ssa/builder.go:2161 +0x157e
[09:54:29]W:			 [UnusedLint] golang.org/x/tools/go/ssa.(*builder).stmtList(0x1?, 0xc0064cf590?, {0xc00072d530?, 0x1, 0xc000184400?})
[09:54:29]W:			 [UnusedLint] 	golang.org/x/tools/go/ssa/external/org_golang_x_tools/go/ssa/builder.go:911 +0x67
[09:54:29]W:			 [UnusedLint] golang.org/x/tools/go/ssa.(*builder).stmt(0xc000c32340?, 0xc000c32340, {0xbc30d8?, 0xc000928390?})
[09:54:29]W:			 [UnusedLint] 	golang.org/x/tools/go/ssa/external/org_golang_x_tools/go/ssa/builder.go:2218 +0x9d1
[09:54:29]W:			 [UnusedLint] golang.org/x/tools/go/ssa.(*builder).buildFunctionBody(0x729051?, 0xc000c32340)
[09:54:29]W:			 [UnusedLint] 	golang.org/x/tools/go/ssa/external/org_golang_x_tools/go/ssa/builder.go:2327 +0x472
[09:54:29]W:			 [UnusedLint] golang.org/x/tools/go/ssa.(*builder).buildFunction(0x7290a0?, 0xc000c32340)
[09:54:29]W:			 [UnusedLint] 	golang.org/x/tools/go/ssa/external/org_golang_x_tools/go/ssa/builder.go:2267 +0x2e
[09:54:29]W:			 [UnusedLint] golang.org/x/tools/go/ssa.(*builder).buildCreated(0xc006491a28)
[09:54:29]W:			 [UnusedLint] 	golang.org/x/tools/go/ssa/external/org_golang_x_tools/go/ssa/builder.go:2349 +0x25
[09:54:29]W:			 [UnusedLint] golang.org/x/tools/go/ssa.(*Package).build(0xc0001a4380)
[09:54:29]W:			 [UnusedLint] 	golang.org/x/tools/go/ssa/external/org_golang_x_tools/go/ssa/builder.go:2529 +0xca5
[09:54:29]W:			 [UnusedLint] sync.(*Once).doSlow(0xc00027e0c0?, 0xc0005e86e0?)
[09:54:29]W:			 [UnusedLint] 	GOROOT/src/sync/once.go:68 +0xc2
[09:54:29]W:			 [UnusedLint] sync.(*Once).Do(...)
[09:54:29]W:			 [UnusedLint] 	GOROOT/src/sync/once.go:59
[09:54:29]W:			 [UnusedLint] golang.org/x/tools/go/ssa.(*Package).Build(...)
[09:54:29]W:			 [UnusedLint] 	golang.org/x/tools/go/ssa/external/org_golang_x_tools/go/ssa/builder.go:2413
[09:54:29]W:			 [UnusedLint] golang.org/x/tools/go/analysis/passes/buildssa.run(0xc000341c70)
[09:54:29]W:			 [UnusedLint] 	golang.org/x/tools/go/analysis/passes/buildssa/external/org_golang_x_tools/go/analysis/passes/buildssa/buildssa.go:73 +0x1a8
[09:54:29]W:			 [UnusedLint] main.(*action).execOnce(0xc0001cc510)
[09:54:29]W:			 [UnusedLint] 	main/external/io_bazel_rules_go/go/tools/builders/nogo_main.go:392 +0x817
[09:54:29]W:			 [UnusedLint] sync.(*Once).doSlow(0x0?, 0x0?)
[09:54:29]W:			 [UnusedLint] 	GOROOT/src/sync/once.go:68 +0xc2
[09:54:29]W:			 [UnusedLint] sync.(*Once).Do(...)
[09:54:29]W:			 [UnusedLint] 	GOROOT/src/sync/once.go:59
[09:54:29]W:			 [UnusedLint] main.(*action).exec(0x0?)
[09:54:29]W:			 [UnusedLint] 	main/external/io_bazel_rules_go/go/tools/builders/nogo_main.go:336 +0x3d
[09:54:29]W:			 [UnusedLint] main.execAll.func1(0x0?)
[09:54:29]W:			 [UnusedLint] 	main/external/io_bazel_rules_go/go/tools/builders/nogo_main.go:330 +0x54
[09:54:29]W:			 [UnusedLint] created by main.execAll
[09:54:29]W:			 [UnusedLint] 	main/external/io_bazel_rules_go/go/tools/builders/nogo_main.go:328 +0x47
[09:54:29]W:			 [UnusedLint] INFO: Elapsed time: 146.194s, Critical Path: 39.33s
[09:54:29]W:			 [UnusedLint] INFO: 3980 processes: 977 internal, 3003 processwrapper-sandbox.
[09:54:29]W:			 [UnusedLint] FAILED: Build did NOT complete successfully
[09:54:29]W:			 [UnusedLint] FAILED: Build did NOT complete successfully

Please describe the issue you observed, and any steps we can take to reproduce it:

Expected behavior

Upstream dependencies containing go 1.18 templates should not cause a nogo failure.

Jira issue: CRDB-19339
Epic CRDB-17171

@knz knz added C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. A-build-system labels Sep 6, 2022
@rickystewart
Copy link
Collaborator

I wonder if our 1.17 version in our go.mod means that some libraries we're pulling in aren't getting appropriately upgraded versions (of golang.org/x/tools for example?) that can deal with 1.18+ features.

@knz
Copy link
Contributor Author

knz commented Sep 6, 2022

I think we'd be comfortable upgrading go.mod to use 1.18 as ver requirement after we get #86049 merged. That would tell us more.

@rickystewart
Copy link
Collaborator

#89702 (comment)

Copy link

github-actions bot commented May 1, 2024

We have marked this issue as stale because it has been inactive for
18 months. If this issue is still relevant, removing the stale label
or adding a comment will keep it active. Otherwise, we'll close it in
10 days to keep the issue queue tidy. Thank you for your contribution
to CockroachDB!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-build-system C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
Projects
None yet
Development

No branches or pull requests

3 participants