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: Remove gomobile dependency on gobind binary #34708

Open
anjmao opened this issue Oct 5, 2019 · 5 comments

Comments

@anjmao
Copy link

commented Oct 5, 2019

Currently gomobile bind internally depends on gobind command. This is not user friendly and seems unnecessary too complex as user need to build both binaries. I propose to remove cmd/gobind so there is only one binary. As there is difference what gomobile bind and gobind does we can pass extra flag to gomobile bind -gen_only to only generate bindings without compiling to final project.

If cmd/gobind is still needed (not sure why) we can extra all reusable logic to separate package so it can be used directly in both cmd/gomobile and cmd/gobind.

If this make sense I can work on it.

/cc @hajimehoshi @eliasnaur

@gopherbot gopherbot added this to the Unreleased milestone Oct 5, 2019
@gopherbot gopherbot added the mobile label Oct 5, 2019
@hajimehoshi

This comment has been minimized.

Copy link
Contributor

commented Oct 7, 2019

CC @hyangah

I would like to keep separate binaries. gobind generates a source code and gomobile generates an application or a shared library, so they are different.

In the context of Go modules, gobind is obvious how to fix for Go module, while gomobile is not.

@anjmao

This comment has been minimized.

Copy link
Author

commented Oct 7, 2019

Commands go build, go test, go tool pprof etc. are all doing different things but are under one binary. One cmd for gomobile would be more clear as you should not split into separate binaries if you have different output but all commands are related to it's general purpose to compile, link, generate code for mobile native apps.

@hajimehoshi

This comment has been minimized.

Copy link
Contributor

commented Oct 7, 2019

Commands go build, go test, go tool pprof etc. are all doing different things but are under one binary.

Sorry if I'm wrong, but some of the Go tools you mentioned are separated binaries.

https://golang.org/src/cmd/

@anjmao

This comment has been minimized.

Copy link
Author

commented Oct 7, 2019

Here is example https://github.com/golang/go/blob/master/src/cmd/go/main.go#L43 how different tools are used with go command. In the end they can be both as separate binaries and reused for main binary command.

@rsc

This comment has been minimized.

Copy link
Contributor

commented Oct 9, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.