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: Go1.15beta1 cannot generate Objective-c bindings #39575

Open
libnat opened this issue Jun 13, 2020 · 7 comments
Open

x/mobile: Go1.15beta1 cannot generate Objective-c bindings #39575

libnat opened this issue Jun 13, 2020 · 7 comments

Comments

@libnat
Copy link

@libnat libnat commented Jun 13, 2020

What version of Go are you using (go version)?

$ go version
go version go1.15beta1 darwin/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GOARCH="amd64"
GOOS="darwin"

What did you do?

Tried three ways, all failed with the same error
gomobile bind -v -target=ios .
gomobile bind -v -target=ios/arm64 .
GOARCH=arm64 gomobile bind -v -target=ios .

What did you expect to see?

Generate objective-c framework

What did you see instead?

gomobile: go [-e -json -compiled=true -test=false -export=false -deps=false -find=true -tags=ios -- mypkg]: exit status 2: cmd/go: unsupported GOOS/GOARCH pair darwin/arm

@davecheney
Copy link
Contributor

@davecheney davecheney commented Jun 13, 2020

Go 1.15 has removed support for darwin/arm. Please see the draft release nots

@davecheney davecheney closed this Jun 13, 2020
@libnat
Copy link
Author

@libnat libnat commented Jun 13, 2020

@davecheney Thanks for your reply. The previous title didn't describe the issue properly. I just tried to generate objective-c bindings.
The error is the same even arch arm64 is specified like:

  1. gomobile bind -v -target=ios/arm64
  2. GOARCH=arm64 gomobile bind -v -target=ios
@libnat libnat changed the title [gomobile] unsupported GOOS/GOARCH pair darwin/arm [gomobile] cannot generate objective-c bindings Jun 13, 2020
@libnat
Copy link
Author

@libnat libnat commented Jun 13, 2020

@davecheney Could you help to review this issue again? I didn't mean it should support darwin/arm. It's just an error message. Now I have changed the issue title. Thanks

@davecheney
Copy link
Contributor

@davecheney davecheney commented Jun 13, 2020

Please reopen the issue and edit the description as appropriate

@libnat
Copy link
Author

@libnat libnat commented Jun 13, 2020

Please reopen the issue and edit the description as appropriate

It seems I am not allowed to reopen this issue.
Github has a rule: Non-collaborator cannot reopen its own issues if a repo collaborator closed them.
@davecheney Could you help to reopen it? Thanks

@libnat libnat changed the title [gomobile] cannot generate objective-c bindings gomobile: 1.15beta1 cannot generate objective-c bindings Jun 13, 2020
@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Jun 13, 2020

I've reopened it but I'm not sure I understand the problem. Are you saying that gomobile requires darwin/arm support in all cases even when not building for darwin/arm? That would be unfortunate.

CC @hyangah

@libnat
Copy link
Author

@libnat libnat commented Jun 13, 2020

@ianlancetaylor Your understanding is correct.
There is a line in golang.org/x/mobile/cmd/gobind/bind.go
config.Env = append(os.Environ(), "GOARCH=arm", "GOOS="+targetOS, "CGO_ENABLED=1")
If I replace "GOARCH=arm" with "GOARCH=arm64", then gomobile bind -target=ios/arm64 works, gomobile bind -target=ios/amd64 still get failed
It looks like x/mobile needs some changes if built with Go 1.15.

@odeke-em odeke-em changed the title gomobile: 1.15beta1 cannot generate objective-c bindings x/mobile: Go1.15beta1 cannot generate Objective-c bindings Jun 14, 2020
@gopherbot gopherbot added the mobile label Jun 14, 2020
@gopherbot gopherbot added this to the Unreleased milestone Jun 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.