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

runtime: tracking bug for ARM-based macOS and GOOS/GOARCH values #38485

Open
bradfitz opened this issue Apr 16, 2020 · 8 comments
Open

runtime: tracking bug for ARM-based macOS and GOOS/GOARCH values #38485

bradfitz opened this issue Apr 16, 2020 · 8 comments

Comments

@bradfitz
Copy link
Contributor

@bradfitz bradfitz commented Apr 16, 2020

The ARM-based Mac rumors of the past couple years continue to heat up (e.g. https://www.theverge.com/2020/3/27/21196611/arm-macbook-desktop-apple-2021-release-date)

Has anybody given any thought to what we're going to do with runtime.GOOS and runtime.GOARCH if/when that happens, so we don't add ambiguity between darwin/arm64 (which currently means iOS only) and darwin/arm64 (which might also mean macOS in the future)?

Changing GOARCH seems out.

Adding GOOS=macos would break any code that switches on those values.

Perhaps some magic behavior like we did for GOOS=android (implies linux build tags) and GOOS=illumos (implies solaris build tags)? But what would still break code that checks runtime.GOOS.

Perhaps keep darwin/arm64 on both iOS and macOS but add some some runtime exported const DarwinOS = {"macos", "ios", ""} that people could switch on when it matters?

If there's new API, might be nice to get that in earlier. But OTOH, don't want to jump the gun if rumors don't pan out.

@andybons andybons added this to the Unplanned milestone Apr 16, 2020
@rsc
Copy link
Contributor

@rsc rsc commented Apr 27, 2020

If darwin/arm64 doesn't work for macos,
then I think we should reclaim it for macos
and move ios over to ios/arm64, much as we have
android as an almost-synonym for Linux on mobile.
(Many fewer GOOS=darwin users on mobile than desktop.)

I've thought about whether we should have GOOS=macos
independently of this issue, but it seems like too much churn
for too little benefit.

Interesting to note that way back when, we could have done
GOOS=osx and we'd be in the same boat of having the wrong
name. Moving to GOOS=macos will only match Apple terminology
until the next OS rename.

@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented May 1, 2020

I think the suggestion here is:

  1. add ios as a valid GOOS value
  2. let ios imply darwin much as android implies linux

This will potentially break any existing mobile programs that test runtime.GOOS and expect to see darwin. After this change they will see ios.

This suggests that for 1.15 we should

  1. add ios as a valid build tag that implies darwin
  2. announce in the release notes that we plan to change to GOOS=ios in a future release
@ianlancetaylor ianlancetaylor modified the milestones: Unplanned, Go1.15 May 1, 2020
@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented May 1, 2020

@cherrymui
Copy link
Contributor

@cherrymui cherrymui commented May 1, 2020

I think (but not sure) gomobile sets ios tag, to distinguish iOS emulator on x86 vs. macOS.

@hyangah
Copy link
Contributor

@hyangah hyangah commented May 1, 2020

@networkimprov
Copy link

@networkimprov networkimprov commented May 1, 2020

@dmitshur
Copy link
Member

@dmitshur dmitshur commented May 4, 2020

Interesting to note that way back when, we could have done
GOOS=osx and we'd be in the same boat of having the wrong
name. Moving to GOOS=macos will only match Apple terminology
until the next OS rename.

Also interesting is that Apple currently has macOS, iOS, iPadOS, tvOS, and watchOS.

@hajimehoshi
Copy link
Contributor

@hajimehoshi hajimehoshi commented May 9, 2020

As far as I know about mobile application developing, there should be no problem to add ios to GOOS :-)

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
9 participants
You can’t perform that action at this time.