You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- // +build darwin linux windows+ // +build aaa,bbb
This will require the tags aaa and bbb to be passed in order for it to build. Confirm that it initially doesn't build like so:
$ gomobile build -v -x golang.org/x/mobile/example/basic
...resulting in something like...
gomobile: no buildable Go source files in GOPATH/src/golang.org/x/mobile/example/basic
As expected.
Now supply the required tags. It still fails, and you can see how the tags are getting mangled.
$ gomobile build -v -x -tags "aaa bbb" golang.org/x/mobile/example/basic
...resulting in something like...
can't load package: package golang.org/x/mobile/example/basic: no buildable Go source files in GOPATH/src/golang.org/x/mobile/example/basic
...
gomobile: go build -pkgdir=GOPATH/pkg/gomobile/pkg_android_arm64 -tags="aaa,bbb" -v -x -buildmode=c-shared -o /var/folders/xh/mp5b069545n32zn6ds3dbn100000gn/T/gomobile-work-217015845/lib/arm64-v8a/libtest.so golang.org/x/mobile/example/basic failed: exit status 1
So, the tags should be passed as a separate argument to exec.Command, space-separated. The =, the quoting, and the comma-joining all need to go.
After applying that patch, the code builds as expected.
Impact
We discovered this the hard way and had to hack around it by patching gomobile before building it. This can be seen here. (I'll be filing another bug for the hack below it.)
The text was updated successfully, but these errors were encountered:
The gomobile tool mishandled build tags in two ways, first by
ignoring tags for iOS, second by passing multiple tags along to
the go tool incorrectly. This CL fixes both.
Fixesgolang/go#18523Fixesgolang/go#18515
Change-Id: I28a49c1e23670adb085617d9f5fb5cd5e22a4b65
Reviewed-on: https://go-review.googlesource.com/34955
Reviewed-by: David Crawshaw <[email protected]>
imWildCat
pushed a commit
to imWildCat/go-mobile
that referenced
this issue
Apr 11, 2021
The gomobile tool mishandled build tags in two ways, first by
ignoring tags for iOS, second by passing multiple tags along to
the go tool incorrectly. This CL fixes both.
Fixesgolang/go#18523Fixesgolang/go#18515
Change-Id: I28a49c1e23670adb085617d9f5fb5cd5e22a4b65
Reviewed-on: https://go-review.googlesource.com/34955
Reviewed-by: David Crawshaw <[email protected]>
gomobile build
andbind
are not passing along-tags
properly.What version of Go are you using (
go version
)?go1.7.4
What operating system and processor architecture are you using (
go env
)?darwin/amd64
What did you do?
Modify the "basic" example (
example/basic/main.go
) like so:This will require the tags
aaa
andbbb
to be passed in order for it to build. Confirm that it initially doesn't build like so:As expected.
Now supply the required tags. It still fails, and you can see how the tags are getting mangled.
Note the
-tags="aaa,bbb"
.Here's the fix diff:
So, the tags should be passed as a separate argument to
exec.Command
, space-separated. The=
, the quoting, and the comma-joining all need to go.After applying that patch, the code builds as expected.
Impact
We discovered this the hard way and had to hack around it by patching gomobile before building it. This can be seen here. (I'll be filing another bug for the hack below it.)
The text was updated successfully, but these errors were encountered: