-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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/cmd/gomobile: gomobile init fails in an empty module #36668
Comments
Change https://golang.org/cl/215419 mentions this issue: |
Updates golang/go#36668 Change-Id: Ic93ea6334dae3fef953bbb928c5246b03279a22f Reviewed-on: https://go-review.googlesource.com/c/mobile/+/215419 Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
CC @matloob |
You're running the go list command from gomubile, right? When you run the command If you want that command to always succeed you can add a package you know always to exist, such as something in the standard library. |
Yes, that's right. I wanted to confirm this was expected. It was a little surprise that just checking the release tag failed in an empty module. |
FYI, the behavior is different between Go 1.14 and older.
|
Change https://golang.org/cl/217700 mentions this issue: |
This change also eliminates a hack for golang/go#36668
This change also eliminates a hack for golang/go#36668 Co-authored-by: Hajime Hoshi <hajimehoshi@gmail.com>
Updates golang/go#36668 Cherry picked from github.com/golang/mobile
go-list without a given module/package tries to analyze the module at the current directory. If the current directory's module doesn't have any Go files and is empty, go-list fails. This is the cause of the problem that gomobile-init fails if the current directory is such module. This CL fixes this issue by giving an arbitrary standard library when executing go-list. Fixes golang/go#36668 Cherry picked from github.com/golang/mobile
Updates golang/go#36668 Cherry picked from github.com/golang/mobile
go-list without a given module/package tries to analyze the module at the current directory. If the current directory's module doesn't have any Go files and is empty, go-list fails. This is the cause of the problem that gomobile-init fails if the current directory is such module. This CL fixes this issue by giving an arbitrary standard library when executing go-list. Fixes golang/go#36668 Cherry picked from github.com/golang/mobile
go-list without a given module/package tries to analyze the module at the current directory. If the current directory's module doesn't have any Go files and is empty, go-list fails. This is the cause of the problem that gomobile-init fails if the current directory is such module. This CL fixes this issue by giving an arbitrary standard library when executing go-list. Fixes golang/go#36668 Change-Id: If72d88081c94c2b9ef19d2870b41956a07102122 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/217700 Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
go-list without a given module/package tries to analyze the module at the current directory. If the current directory's module doesn't have any Go files and is empty, go-list fails. This is the cause of the problem that gomobile-init fails if the current directory is such module. This CL fixes this issue by giving an arbitrary standard library when executing go-list. Fixes golang/go#36668 Change-Id: If72d88081c94c2b9ef19d2870b41956a07102122 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/217700 Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
go-list without a given module/package tries to analyze the module at the current directory. If the current directory's module doesn't have any Go files and is empty, go-list fails. This is the cause of the problem that gomobile-init fails if the current directory is such module. This CL fixes this issue by giving an arbitrary standard library when executing go-list. Fixes golang/go#36668 Change-Id: If72d88081c94c2b9ef19d2870b41956a07102122 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/217700 Run-TryBot: Hajime Hoshi <hajimehoshi@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
No errors.
What did you see instead?
The cause is that go-list fails with an empty module:
With a Go file only with
package main
in the directory, this succeeds.CC @hyangah
The text was updated successfully, but these errors were encountered: