-
Notifications
You must be signed in to change notification settings - Fork 18k
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 bind takes too long #28096
Comments
cc @eliasnaur and @hyangah |
What's the steps for reproducing the problem? |
Just get the latest version of gomobile by |
I can't reproduce the problem. I made a trivial change to example/bind/hello/hello.go to avoid caching and ran
and it completed in under 10 seconds. Note that because of the new cmd/go caching in Go 1.10 (and 1.11) the first gomobile bind probably takes quite a while. |
Hey Elias,
and the subsequent one showed this
|
I don't know why, sorry. It's suspicious that real time is more than a minute yet so little time is spent in user and kernel mode. |
Any progress on this? My main issue right now is that gomobile bind recompiles everyhting even if the go sources haven't changed, adding at least 10s to every build in android studio. A build cache / incremental builds would help tremendously in this case. |
Unfortunately no. I'll happily take 10s. But its way more than that. My friend @arunkumar9t2 has done some incremental build solution prototype. Hope he can help! |
I suppose someone has to profile gomobile and figure out an explanation for the discrepancy between my 10s and @vickyramachandra's 2m. The gomobile -x flag might be useful. Also note that the gradle plugin is no longer supported, so a more clumsy but direct workaround is to manually run gomobile only when the Go code has changed. |
@vickyramachandra - Just wanted to circle back and check in on this. Are you still facing this issue ? Could you try with |
Me and @vickyramachandra no longer work on the project, let me check with my peers to see if it has improved. In the mean time, we built our own Gradle plugin to build |
Timed out in state WaitingForInfo. Closing. (I am just a bot, though. Please speak up if this is a mistake or you have the requested information.) |
What version of Go are you using (
go version
)?go version go1.10.3 darwin/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/user/Library/Caches/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/user/Documents/Freshdesk/golang"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.10.3/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.10.3/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/y8/ylh63k1106ldg8t7q3jrl701s3tf0r/T/go-build694332607=/tmp/go-build -gno-record-gcc-switches -fno-common"
What did you do?
I use gomobile for building .aar and .framework for Android and iOS respectively. The
gomobile bind -target=android/ios
usually takes about 10 to 15 seconds. But off late, the process easily takes more than 3 minutesWhat did you expect to see?
Less build time (~10 to 15 secs)
What did you see instead?
Too long (> 3 mins)
The text was updated successfully, but these errors were encountered: