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

Work-around for go >= 1.16 #36

Open
ggwpez opened this issue Nov 5, 2021 · 0 comments
Open

Work-around for go >= 1.16 #36

ggwpez opened this issue Nov 5, 2021 · 0 comments

Comments

@ggwpez
Copy link
Contributor

ggwpez commented Nov 5, 2021

Problem

The installation instructions for go-mobile do not work anymore with the specified minimum version of 1.16:

go install golang.org/x/mobile/cmd/gomobile@latest
gomobile init

This line seems to be responsible for the error:

go: downloading golang.org/x/mobile v0.0.0-20211103151657-e68c98865fb2
go: downloading golang.org/x/mod v0.4.2
go: downloading golang.org/x/tools v0.1.8-0.20211022200916-316ba0b74098
go: downloading golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
go: downloading golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e
gomobile: go install golang.org/x/mobile/cmd/gobind failed: exit status 1
go install: version is required when current directory is not in a module
	Try 'go install golang.org/x/mobile/cmd/gobind@latest' to install the latest version

My current work-around is to run:

go mod init example.com/m
go mod tidy
GO111MODULE=on  go get golang.org/x/mobile/cmd/...
GO111MODULE=on  go mod download golang.org/x/exp
GO111MODULE=off go get -d golang.org/x/mobile/cmd/gobind
gomobile init 

And then go mod download golang.org/x/mobile in the docker image before building the bindings.
However, this does not work anymore in go 1.17 🤡.

We can hopefully remove this when golang/go#46943 is fixed.
I will not open a MR on x/mobile because of the tedious dev process for external contributors.

@ggwpez ggwpez changed the title Work-around for new go >= 1.16 Work-around for go >= 1.16 Nov 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant