Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

cmd/gomobile: improve support for macOS and Catalyst #70

Closed
wants to merge 32 commits into from

Conversation

ydnar
Copy link
Contributor

@ydnar ydnar commented Jul 14, 2021

This is is a follow-up from my previous PR (#65). It makes gomobile
aware of GOOS=ios and adds support for specifying specific Apple
platforms, instead of overloading the "ios" platform.

Supported platforms: ios, iossimulator, macos, and maccatalyst

These can now be specified the -target argument to gomobile, e.g.:
gomobile build -target=ios,iossimulator,macos,maccatalyst

It preserves the current behavior of -target=ios, which will build for
ios and iossimulator on supported architectures (arm64 and amd64).

It adds platform-specific build tags so Go code can discriminate between
different Apple platforms like maccatalyst (UIKit on macOS).

This PR also fixes a number of broken tests.

TODO: cgo has a bug where c-archive builds targeting Catalyst will fail
unless -tags=ios is supplied. See https://golang.org/issues/47228

Fixes https://golang.org/issues/47212
Updates https://golang.org/issues/47228

@google-cla google-cla bot added the cla: yes label Jul 14, 2021
@ydnar
Copy link
Contributor Author

ydnar commented Jul 14, 2021

Working to fix bug noted here: golang/go#36856

cc @hajimehoshi

@gopherbot
Copy link
Contributor

This PR (HEAD: c7287ff) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/mobile/+/334689 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Hajime Hoshi:

Patch Set 1: Run-TryBot+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/334689.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go Bot:

Patch Set 1:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/334689.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go Bot:

Patch Set 1: TryBot-Result-1

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/334689.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Hajime Hoshi:

Patch Set 1:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/334689.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Randy Reddig:

Patch Set 1:

(3 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/334689.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Randy Reddig:

Patch Set 1:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/334689.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR (HEAD: 9444da2) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/mobile/+/334689 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Hajime Hoshi:

Patch Set 2:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/334689.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Randy Reddig:

Patch Set 2:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/334689.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Hajime Hoshi:

Patch Set 2:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/334689.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Randy Reddig:

Patch Set 2:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/334689.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR (HEAD: 8b6abc2) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/mobile/+/334689 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Hajime Hoshi:

Patch Set 3:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/334689.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR (HEAD: 5527f9f) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/mobile/+/334689 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Randy Reddig:

Patch Set 4:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/334689.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR (HEAD: 77eab9e) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/mobile/+/334689 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

This PR (HEAD: 708f5c6) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/mobile/+/334689 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

This PR (HEAD: 59bb063) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/mobile/+/334689 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@ydnar ydnar changed the title cmd/gomobile: support GOOS=ios cmd/gomobile: improve support for macOS and Catalyst Jul 15, 2021
@gopherbot
Copy link
Contributor

Message from Randy Reddig:

Patch Set 8:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/334689.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR (HEAD: 2f07876) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/mobile/+/334689 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@google-cla
Copy link

google-cla bot commented Jul 16, 2021

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added cla: no and removed cla: yes labels Jul 16, 2021
@google-cla
Copy link

google-cla bot commented Jul 16, 2021

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

1 similar comment
@google-cla
Copy link

google-cla bot commented Jul 16, 2021

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@gopherbot
Copy link
Contributor

Message from Randy Reddig:

Patch Set 26:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/334689.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Hyang-Ah Hana Kim:

Patch Set 26: Run-TryBot+1 Code-Review+2 Trust+1

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/334689.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go Bot:

Patch Set 26:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/334689.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go Bot:

Patch Set 26: TryBot-Result+1

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/334689.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Randy Reddig:

Patch Set 26:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/334689.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Hajime Hoshi:

Patch Set 26: Trust+1

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/334689.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR (HEAD: 4ca2ca5) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/mobile/+/334689 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

This PR (HEAD: b08c472) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/mobile/+/334689 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Randy Reddig:

Patch Set 27:

(3 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/334689.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Hajime Hoshi:

Patch Set 28: Run-TryBot+1 Trust+1

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/334689.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go Bot:

Patch Set 28:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/334689.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Hyang-Ah Hana Kim:

Patch Set 28: Code-Review+2 Trust+1

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/334689.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go Bot:

Patch Set 28:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/334689.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go Bot:

Patch Set 28: TryBot-Result+1

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/334689.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Randy Reddig:

Patch Set 28:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/334689.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR (HEAD: 01ab28e) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/mobile/+/334689 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Randy Reddig:

Patch Set 28:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/334689.
After addressing review feedback, remember to publish your drafts!

gopherbot pushed a commit that referenced this pull request Sep 17, 2021
This is is a follow-up from my previous PR (#65). It makes gomobile
aware of GOOS=ios and adds support for specifying specific Apple
platforms, instead of overloading the "ios" platform.

Supported platforms: ios, iossimulator, macos, and maccatalyst

These can now be specified the -target argument to gomobile, e.g.:
gomobile build -target=ios,iossimulator,macos,maccatalyst

It preserves the current behavior of -target=ios, which will build for
ios and iossimulator on supported architectures (arm64 and amd64).

It adds platform-specific build tags so Go code can discriminate between
different Apple platforms like maccatalyst (UIKit on macOS).

This PR also fixes a number of broken tests.

TODO: cgo has a bug where c-archive builds targeting Catalyst will fail
unless -tags=ios is supplied. See https://golang.org/issues/47228

Fixes https://golang.org/issues/47212
Updates https://golang.org/issues/47228

Change-Id: Ib1a2f5302c5edd0704c13ffbe8f4061211f50d4e
GitHub-Last-Rev: 01ab28e
GitHub-Pull-Request: #70
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/334689
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Trust: Hyang-Ah Hana Kim <hyangah@gmail.com>
Trust: Hajime Hoshi <hajimehoshi@gmail.com>
@gopherbot
Copy link
Contributor

This PR is being closed because golang.org/cl/334689 has been merged.

@gopherbot gopherbot closed this Sep 17, 2021
ydnar added a commit to alta/quic-go-mobile-example that referenced this pull request Sep 17, 2021
ydnar added a commit to alta/go-mobile-swift-package-example that referenced this pull request Sep 27, 2021
This breaks out the Swift Package Manager example from
golang/mobile#71 into a separate repo.

See https://golang.org/cl/350150 for additional info.

Depends on https://golang.org/cl/334689 (golang/mobile#70).
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants