{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/12819","labels_url":"https://api.github.com/repos/golang/go/issues/12819/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/12819/comments","events_url":"https://api.github.com/repos/golang/go/issues/12819/events","html_url":"https://github.com/golang/go/issues/12819","id":109484920,"number":12819,"title":"x/mobile/cmd/gomobile: gomobile bind generates binding code on every execution","user":{"login":"sridharv","id":326998,"avatar_url":"https://avatars.githubusercontent.com/u/326998?v=3","gravatar_id":"","url":"https://api.github.com/users/sridharv","html_url":"https://github.com/sridharv","followers_url":"https://api.github.com/users/sridharv/followers","following_url":"https://api.github.com/users/sridharv/following{/other_user}","gists_url":"https://api.github.com/users/sridharv/gists{/gist_id}","starred_url":"https://api.github.com/users/sridharv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sridharv/subscriptions","organizations_url":"https://api.github.com/users/sridharv/orgs","repos_url":"https://api.github.com/users/sridharv/repos","events_url":"https://api.github.com/users/sridharv/events{/privacy}","received_events_url":"https://api.github.com/users/sridharv/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/golang/go/milestones/22","html_url":"https://github.com/golang/go/milestones/Unreleased","labels_url":"https://api.github.com/repos/golang/go/milestones/22/labels","id":1067491,"number":22,"title":"Unreleased","description":"Issues that do not affect released Go code and binaries.\r\n","creator":{"login":"rsc","id":104030,"avatar_url":"https://avatars.githubusercontent.com/u/104030?v=3","gravatar_id":"","url":"https://api.github.com/users/rsc","html_url":"https://github.com/rsc","followers_url":"https://api.github.com/users/rsc/followers","following_url":"https://api.github.com/users/rsc/following{/other_user}","gists_url":"https://api.github.com/users/rsc/gists{/gist_id}","starred_url":"https://api.github.com/users/rsc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsc/subscriptions","organizations_url":"https://api.github.com/users/rsc/orgs","repos_url":"https://api.github.com/users/rsc/repos","events_url":"https://api.github.com/users/rsc/events{/privacy}","received_events_url":"https://api.github.com/users/rsc/received_events","type":"User","site_admin":false},"open_issues":381,"closed_issues":271,"state":"open","created_at":"2015-04-14T18:48:22Z","updated_at":"2015-10-28T08:05:39Z","due_on":"2099-12-31T05:00:00Z","closed_at":null},"comments":2,"created_at":"2015-10-02T12:49:10Z","updated_at":"2015-10-28T12:39:08Z","closed_at":null,"body":"This can't really be called a bug, but it is potentially sub-par behaviour. It is a follow on from a suggestion I made in https://github.com/golang/go/issues/12245.\r\n\r\n`gomobile bind` currently generates binding code every time it is run. This has the following side effects:\r\n\r\n   * __Access to source for debugging:__ When debugging application errors in the wild, it is useful to have the source available. In the case of native libraries, we can use vendoring or the native package manager for versioning. With `gobind` however, the source is not easily available. It can be generated by manually running `gobind`, but there are a few concerns with this approach.\r\n      * _The options passed to `gobind` are opaque to the user:_ Currently there are no options, but if this changes in the future it becomes a guessing game.\r\n      * _Upgrades of the `gobind` tool can result in source changes:_ For production releases we will need to track the exact version of `gomobile` used to generate the library. This is fine once `gobind` is stable (for example with cgo now). However, it is problematic for early adopters since changes are being made to `gobind` on a regular basis.\r\n\r\n   * __Incremental builds:__ In an SDK app, `gomobile bind` must be run on source changes to regenerate the new framework/aar. There are two ways of approaching this. Manually run `gomobile bind` or have the IDE (XCode/Android Studio) invoke it before compiling the ObjC/Java source. The former, while not a chore, can be error prone. The latter is more robust, but results in the framework/aar being rebuilt even if no go source is changed. This adds delays to the code -> compile -> test cycle and negatively impacts our workflow. It also takes away one of the advantages of go which are its near instantaneous build times.\r\n\r\nOne solution would be for `gomobile bind` to accept a command line flag which specifies the directory in which to generate code and then skip regenerating code on every run.\r\n\r\nThis is more a nice to have rather than a need to have since there are workarounds present.\r\n"},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/151831308","html_url":"https://github.com/golang/go/issues/12819#issuecomment-151831308","issue_url":"https://api.github.com/repos/golang/go/issues/12819","id":151831308,"user":{"login":"jeffallen","id":1131456,"avatar_url":"https://avatars.githubusercontent.com/u/1131456?v=3","gravatar_id":"","url":"https://api.github.com/users/jeffallen","html_url":"https://github.com/jeffallen","followers_url":"https://api.github.com/users/jeffallen/followers","following_url":"https://api.github.com/users/jeffallen/following{/other_user}","gists_url":"https://api.github.com/users/jeffallen/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffallen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffallen/subscriptions","organizations_url":"https://api.github.com/users/jeffallen/orgs","repos_url":"https://api.github.com/users/jeffallen/repos","events_url":"https://api.github.com/users/jeffallen/events{/privacy}","received_events_url":"https://api.github.com/users/jeffallen/received_events","type":"User","site_admin":false},"created_at":"2015-10-28T12:39:08Z","updated_at":"2015-10-28T12:39:08Z","body":"Yes please. My Android Studio build times went from 2 secs to 10 secs by adding a Go module to my project. For a language with a reputation for fast build times, it's beyond ironic and really unfortunate that Go is making *Java* builds slower!"}}