-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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/mobile: build failing when using go modules #27234
Comments
Hi, what's going on this? |
I have the same issue but with some different error message: gomobile: /home/wangyun/dev/gopath/bin/gobind -lang=go,java -outdir=/tmp/gomobile-work-948078978 testaar failed: exit status 1 I'm using go 1.11 and updated gomobile, gobind to the latest version. |
''' |
cc @eliasnaur - some time has elapsed since this issue and I'm not sufficiently up to speed to know whether mobile is now modules-aware. |
Gomobile has not been converted.
ons. 14. nov. 2018 06.25 skrev Paul Jolly <[email protected]>:
… cc @eliasnaur <https://github.com/eliasnaur> - some time has elapsed
since this issue and I'm not sufficiently up to speed to know whether
mobile is now modules-aware.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#27234 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAgCDBmUNHJxqpeDT1Njw9kvu-CzgzI3ks5uu6lJgaJpZM4WMvnl>
.
|
is there work currently being done on this front? |
Not yet, at least not from my side. Partly because of time available, partly because I prefer to wait for module support to mature (GO111MODULE always on, the go/packages package feature complete and so on), but the main stumbling block is that I can't see the gomobile bind mode work as usual in module mode, at least not in its current form. |
I started a conversation about gomobile and modules here: https://groups.google.com/forum/#!topic/golang-dev/C0ip7pFC2Oc One question I would like you to ponder on that thread is whether it would be acceptable to require gomobile users to first generate glue code with the gobind tool and then only let the gomobile tool do the final packaging. |
Change https://golang.org/cl/167180 mentions this issue: |
Change https://golang.org/cl/167179 mentions this issue: |
Updates golang/go#27234 Updates golang/go#30228 Change-Id: Ibe281480398ff9d8c27657f399159885a75f646e Reviewed-on: https://go-review.googlesource.com/c/mobile/+/167179 Run-TryBot: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]>
Commands run: go mod init go mod edit -go=1.11 go mod tidy go list -m all go test ./... Updates golang/go#30228 Updates golang/go#27234 Change-Id: Ibf3b104bfaa037e1a94a5327b5a56983d9744e73 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/167180 Reviewed-by: Brad Fitzpatrick <[email protected]> Run-TryBot: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
Change https://golang.org/cl/167659 mentions this issue: |
Gomobile doesn't support modules. Updates golang/go#27234 Change-Id: I426db1600eafd4a9ddc7eb239f5f264756f1ba35 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/167659 Reviewed-by: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
Hi, I use modules heavily in my projects. Unfortunately, this makes using gomobile rather difficult. When do you expect gomobile to support modules? Any updates on this? |
I was wondering whether packages that use major versions like |
We also need this feature desperately! |
Are there any workarounds for the meantime? |
@balupton / @chrisprobst: I use |
@balupton / @chrisprobst: We basically also use |
A replative path in go.mod works only in the directory of the go.mod. When creating go.mod for gobind, copying relative paths did not work since go.mod is in a different temporary directory. This CL fixes the issue to use Dir, which is an absolute path to the module, instead of Path. Updates golang/go#27234 Change-Id: Ib009ec508aa3ce3d092af14f921a57192feaac61 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/215421 Run-TryBot: Hajime Hoshi <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Hyang-Ah Hana Kim <[email protected]>
Now all the problems I found have been fixed. Let's close this issue (I don't have the right to close this issue though), and file other issues when we find other problems. |
Great work @hajimehoshi ! |
Thanks a lot @hajimehoshi ! |
Forgive my lack of understanding - will this ship with a particular version of Go? I see it’s still part of an “Unreleased” milestone. |
@themartorana |
This is a preparation to use Go modules at gomobile command. Updates golang/go#27234 Cherry picked from github.com/golang/mobile
This CL is a pure refactoring. This removes a global variable ctx, which is a build.Default. Before this change, ctx was used to keep build tags and its state affected go command executions. As the variable is mutable, the code was not readable. This changes introduces another global variable buildTags instead, but this is more consistent with other build flags, and this is immutable. Updates golang/go#27234 Conflict: cmd/gomobile/build.go Cherry picked from github.com/golang/mobile
Before this change, all the gomobile commands forced Go modules to be off internally, regardless of the current Go modules state. After this change, gomobile-init command follows the current Go modules state. The other gomobile commands are not changed. This is also a preparation to support Go modules in gomobile-bind and gomobile-build. Updates golang/go#27234 Cherry picked from github.com/golang/mobile
This CL enables Go modules at gomobile-build command. This CL is a counterpart for the change gomobile-bind: https://golang.org/cl/210380 Updates golang/go#27234 Cherry picked from github.com/golang/mobile
@hajimehoshi Oh wow, so happy to see this closed. Buuut :D, I think I found a tiny case that could use some love. |
Thanks.
That's odd since gomobile just invokes go commands as usual and then module cache and build cache should be used. I was wondering if my fix was the culprit of the issue you reported. Hasn't there been this issue before my fix? |
Isn't gomobile using custom build and cache dirs? The packages are definitely downloaded into the
I can't say, it's been a while since I picked up gomobile. Started doing it today. If you're looking for a painful repro, here's the code I just pushed https://github.com/coronanet/go-coronanet . Though it would possibly make sense to use something smaller to test than this monstrosity. |
Aha, gobind, which is invoked by gomobile, generates a source code from Go packages for binding, and they are not cached indeed. Did you mean 'cache' of them? |
I think the cache issue is not related to this issue #27234, so I'd be happy if you could file a new issue. |
@hajimehoshi Done #37902 |
This is a preparation to use Go modules at gomobile command. Updates golang/go#27234 Cherry picked from github.com/golang/mobile
This CL is a pure refactoring. This removes a global variable ctx, which is a build.Default. Before this change, ctx was used to keep build tags and its state affected go command executions. As the variable is mutable, the code was not readable. This changes introduces another global variable buildTags instead, but this is more consistent with other build flags, and this is immutable. Updates golang/go#27234 Conflict: cmd/gomobile/build.go Cherry picked from github.com/golang/mobile
Before this change, all the gomobile commands forced Go modules to be off internally, regardless of the current Go modules state. After this change, gomobile-init command follows the current Go modules state. The other gomobile commands are not changed. This is also a preparation to support Go modules in gomobile-bind and gomobile-build. Updates golang/go#27234 Cherry picked from github.com/golang/mobile
This CL enables Go modules at gomobile-build command. This CL is a counterpart for the change gomobile-bind: https://golang.org/cl/210380 Updates golang/go#27234 Cherry picked from github.com/golang/mobile
What version of Go are you using (
go version
)?go version go1.11 darwin/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?What did you do?
gomobile bind -target=android .
What did you expect to see?
Normal build as when building inside GOPATH
What did you see instead?
The text was updated successfully, but these errors were encountered: