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

x/exp: tests consistently failing on linux-amd64-nocgo due to broken golang.org/x/mobile/gl dependency #32837

Closed
bcmills opened this issue Jun 28, 2019 · 7 comments
Labels
Builders x/build issues (builders, bots, dashboards) FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done. Testing An issue that has been verified to require only test changes, not just a test failure.
Milestone

Comments

@bcmills
Copy link
Contributor

bcmills commented Jun 28, 2019

The x/mobile tests are not run on most builders, but the x/exp tests are.

The x/exp build is consistently failing on linux-amd64-nocgo — apparently due to a dependency on the package golang.org/x/mobile/gl, which fails to compile:

# golang.org/x/mobile/gl
../../../../pkg/mod/golang.org/x/mobile@v0.0.0-20190312151609-d3739f865fa6/gl/gl.go:20:12: undefined: context
../../../../pkg/mod/golang.org/x/mobile@v0.0.0-20190312151609-d3739f865fa6/gl/gl.go:29:12: undefined: context
../../../../pkg/mod/golang.org/x/mobile@v0.0.0-20190312151609-d3739f865fa6/gl/gl.go:39:12: undefined: context
../../../../pkg/mod/golang.org/x/mobile@v0.0.0-20190312151609-d3739f865fa6/gl/gl.go:53:12: undefined: context
../../../../pkg/mod/golang.org/x/mobile@v0.0.0-20190312151609-d3739f865fa6/gl/gl.go:63:12: undefined: context
../../../../pkg/mod/golang.org/x/mobile@v0.0.0-20190312151609-d3739f865fa6/gl/gl.go:73:12: undefined: context
../../../../pkg/mod/golang.org/x/mobile@v0.0.0-20190312151609-d3739f865fa6/gl/gl.go:83:12: undefined: context
../../../../pkg/mod/golang.org/x/mobile@v0.0.0-20190312151609-d3739f865fa6/gl/gl.go:93:12: undefined: context
../../../../pkg/mod/golang.org/x/mobile@v0.0.0-20190312151609-d3739f865fa6/gl/gl.go:102:12: undefined: context
../../../../pkg/mod/golang.org/x/mobile@v0.0.0-20190312151609-d3739f865fa6/gl/gl.go:114:12: undefined: context
../../../../pkg/mod/golang.org/x/mobile@v0.0.0-20190312151609-d3739f865fa6/gl/gl.go:114:12: too many errors

We should either fix the x/mobile build or remove the dependency on it from x/exp.

CC @steeve

@bcmills bcmills added Testing An issue that has been verified to require only test changes, not just a test failure. help wanted Builders x/build issues (builders, bots, dashboards) labels Jun 28, 2019
@gopherbot gopherbot added this to the Unreleased milestone Jun 28, 2019
@steeve
Copy link
Contributor

steeve commented Jun 28, 2019

@eliasnaur is probably better suited to answer this.

That said, there is no way for golang.org/x/mobile/gl will build without CGo (it's an OpenGL binding).

@bcmills
Copy link
Contributor Author

bcmills commented Jun 28, 2019

Looks like the problem may be a missing +build constraint in golang.org/x/exp/shiny/driver/gldriver:

~/src/golang.org/x/exp$ go mod why golang.org/x/mobile/gl
# golang.org/x/mobile/gl
golang.org/x/exp/shiny/driver/gldriver
golang.org/x/mobile/gl

CC @nigeltao

@bcmills bcmills added the NeedsFix The path to resolution is known, but the work has not been done. label Jun 28, 2019
@gopherbot
Copy link

Change https://golang.org/cl/184897 mentions this issue: shiny/driver/gldriver: add cgo build tag

@nigeltao nigeltao changed the title x/exp: tests consistently failing on linux-amd64-cgo due to broken golang.org/x/mobile/gl dependency x/exp: tests consistently failing on linux-amd64-nocgo due to broken golang.org/x/mobile/gl dependency Jul 3, 2019
@gopherbot
Copy link

Change https://golang.org/cl/185017 mentions this issue: gl: provide dummy impl when cgo is disabled

@bcmills
Copy link
Contributor Author

bcmills commented Aug 29, 2019

The x/exp tests are still failing. I think we just need to update the go.mod file to pick up the fix in CL 185017.

@bcmills
Copy link
Contributor Author

bcmills commented Aug 29, 2019

Even after picking up that CL, the x/exp build is still broken:

~/src/golang.org/x/exp$ CGO_ENABLED=0 gotip test ./...
ok      golang.org/x/exp/apidiff        (cached)
?       golang.org/x/exp/cmd/apidiff    [no test files]
ok      golang.org/x/exp/cmd/modgraphviz        (cached)
ok      golang.org/x/exp/ebnf   (cached)
?       golang.org/x/exp/ebnflint       [no test files]
ok      golang.org/x/exp/io/i2c (cached)
?       golang.org/x/exp/io/i2c/driver  [no test files]
?       golang.org/x/exp/io/i2c/example/displayip       [no test files]
ok      golang.org/x/exp/io/spi (cached) [no tests to run]
?       golang.org/x/exp/io/spi/driver  [no test files]
ok      golang.org/x/exp/mmap   (cached)
ok      golang.org/x/exp/old/netchan    (cached)
ok      golang.org/x/exp/rand   (cached)
# golang.org/x/exp/shiny/driver/gldriver
shiny/driver/gldriver/context.go:23:10: undefined: surfaceCreate
shiny/driver/gldriver/gldriver.go:26:12: undefined: main
shiny/driver/gldriver/screen.go:125:13: undefined: newWindow
shiny/driver/gldriver/screen.go:136:2: undefined: initWindow
shiny/driver/gldriver/screen.go:142:5: undefined: useLifecycler
shiny/driver/gldriver/screen.go:146:2: undefined: showWindow
shiny/driver/gldriver/window.go:71:5: undefined: handleSizeEventsAtChannelReceive
shiny/driver/gldriver/window.go:115:2: undefined: closeWindow
?       golang.org/x/exp/shiny/driver   [no test files]
ok      golang.org/x/exp/shiny/driver/internal/swizzle  (cached)
ok      golang.org/x/exp/shiny/iconvg   (cached)
ok      golang.org/x/exp/shiny/imageutil        (cached)
ok      golang.org/x/exp/shiny/materialdesign/colornames        (cached)
ok      golang.org/x/exp/shiny/materialdesign/icons     (cached)
ok      golang.org/x/exp/shiny/screen   (cached)
ok      golang.org/x/exp/shiny/text     (cached)
ok      golang.org/x/exp/shiny/widget/flex      0.015s
ok      golang.org/x/exp/shiny/widget/theme     (cached)
ok      golang.org/x/exp/utf8string     (cached)

@bcmills bcmills reopened this Aug 29, 2019
@gopherbot
Copy link

Change https://golang.org/cl/192319 mentions this issue: shiny/driver/gldriver: fix build with CGO_ENABLED=0

@golang golang locked and limited conversation to collaborators Aug 28, 2020
imWildCat pushed a commit to imWildCat/go-mobile that referenced this issue Apr 10, 2021
The dummy implementation doesn't do anything (at runtime), but it does
compile (when CGO_ENABLED=0), which e.g. unbreaks some build bots.

The work_other.go file is new, faking what's in work.go.

The changes to the other (existing) files simply re-order the
GOOS-related build constraints to be in a consistent order (alphabetical
order), the same as the existing order in work.go.

Fixes golang/go#32837

Change-Id: I19a196d4307b9ebc2f770fe41e1aec717a699288
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/185017
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
imWildCat pushed a commit to imWildCat/go-mobile that referenced this issue Apr 11, 2021
The dummy implementation doesn't do anything (at runtime), but it does
compile (when CGO_ENABLED=0), which e.g. unbreaks some build bots.

The work_other.go file is new, faking what's in work.go.

The changes to the other (existing) files simply re-order the
GOOS-related build constraints to be in a consistent order (alphabetical
order), the same as the existing order in work.go.

Fixes golang/go#32837

Change-Id: I19a196d4307b9ebc2f770fe41e1aec717a699288
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/185017
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Builders x/build issues (builders, bots, dashboards) FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done. Testing An issue that has been verified to require only test changes, not just a test failure.
Projects
None yet
Development

No branches or pull requests

3 participants