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/mobile: gomobile install fails when using a vendor directory #22152

Closed
rucuriousyet opened this issue Oct 5, 2017 · 5 comments

Comments

Projects
None yet
5 participants
@rucuriousyet
Copy link

commented Oct 5, 2017

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go1.9 linux/amd64

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

linux/amd64 (arch linux)

What did you do?

running gomobile install <package name> fails when using a vendor directory to manage deps with the following error:

gomobile: gitlab.com/stackmesh/network does not import "golang.org/x/mobile/app"

This has been tested for both the included x/mobile examples and custom projects.

If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.

https://play.golang.org/p/HMsmNBlfwJ
run glide init && glide update (should place a vendor dir in the project root),
run gomobile install <package name/gopath>

What did you expect to see?

The normal apk building messages and the upload logging.

What did you see instead?

gomobile: gitlab.com/stackmesh/network does not import "golang.org/x/mobile/app"

@gopherbot gopherbot added this to the Unreleased milestone Oct 5, 2017

@gopherbot gopherbot added the mobile label Oct 5, 2017

@mvdan mvdan changed the title x/mobile: x/mobile: gomobile install fails when using a vendor directory Jan 6, 2018

@aYosukeAkatsuka

This comment has been minimized.

Copy link

commented Jan 15, 2018

From https://github.com/golang/mobile/blob/master/cmd/gomobile/build.go#L137 ,

var nmRE = regexp.MustCompile(`[0-9a-f]{8} t (golang.org/x.*/[^.]*)`)

This regex is used to lookup "golang.org/x/..." package from shared object generated by gomobile using nm, but I guess it is not consider the "golang/x/..." package is placed under vendor directory.
I don't see any reason why the package cannot be placed on vendor directory. I guess this should be like this to allow put them under vendor.

var nmRE = regexp.MustCompile(`[0-9a-f]{8} t .*(golang.org/x.*/[^.]*)`)

If it is acceptable change, I'll create CL. :)
Thanks!

@eliasnaur

This comment has been minimized.

Copy link
Contributor

commented Mar 15, 2018

That seems like a reasonable change. Please send a CL.

@eliasnaur

This comment has been minimized.

Copy link
Contributor

commented Mar 16, 2018

Dup of: #18903

@gopherbot

This comment has been minimized.

Copy link

commented Mar 22, 2018

Change https://golang.org/cl/102095 mentions this issue: cmd/gomobile: allow to put "golang.org/x/..." package under vendor

@pankona

This comment has been minimized.

Copy link

commented Mar 22, 2018

@eliasnaur
Thank you for your comment!
I just sent a CL, please check it 💯

@golang golang locked and limited conversation to collaborators Mar 23, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.