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: binding doens't seem to reuse build cache for modules #37902
Comments
CC @hyangah |
The temporary directory is created in the following line: https://github.com/golang/mobile/blob/0df4eb2385467a487d418c6358313e9e838256ae/cmd/gomobile/env.go#L61 |
The solution mentioned by @MariusVanDerWijden seems to work. Is this going to be added anytime soon? |
My understanding is that Go's build cache is created somewhere, wherever you build your application. Then the temporary directory should not matter. Is that correct? I believe If so, is the culprit building Java or C files? |
@karalabe I'm sorry for the delay. Is this problem happening in Android or iOS, or both? |
Hi @hajimehoshi I'm having the same issue here. Indeed, I specify the workdir using the flag |
Any chance we can get the solution in https://go-review.googlesource.com/c/mobile/+/273406 merged? PR on Github: golang/mobile#58 (though the discussion is on googlesource) |
you can try this : |
Apologies for not adhering to the default issue template, the issue is not a "bug" per se and not an issue with Go itself, so all those version and env infos would be useless.
gomobile
added module support recently, which works spectacularly. One thing, however, that I did notice, is that if I callgomobile bind
on a package that has heavy dependencies, those get rebuilt from scratch for every build, making the build very painful.E.g. Binding https://github.com/coronanet/go-coronanet will take 30 mins as it needs to build a dependent package that contains a huge C library (Tor). However, trying to call bind again with zero modifications will again take 30 mins. This is in contrast with building simply with Go locally, which will take 5 mins for the first run, but will be ~instantaneous afterwards (only link time is left).
My best guess until now is that
gomobile bind
creates its own temporary working directory/tmp/gomobile-work-xxxxxxxx
and thus all code operations are short circuited into that folder, away from the system caches. This results in all object files produced by one build run to be deleted at the end.Issue opened per @hajimehoshi 's request in #27234 (comment).
Continuing a thread from the above issue:
No, I'm not referring to caching the generated files, rather the module dependencies of them, which should most definitely be cacheable.
The text was updated successfully, but these errors were encountered: