moovweb / gvm

Go Version Manager
http://github.com/moovweb/gvm
MIT License
10.18k stars 533 forks source link

Support macOS 11 Big Sur Binary Downloads #380

Closed jeremy-ebler-vineti closed 1 year ago

jeremy-ebler-vineti commented 3 years ago

There was some compatibility code for Golang versions less than 1.4.3 that broke installs on Big Sur. Prior to 1.4.3, there were two versions for osx10.8 and osx10.6. 1.4.3 introduced a unified amd64 version. When OS X changed the major version from 10 to 11, that logic broke.

This patch moves that compatibility logic into the "less than 1.4.3" check, and now checks both the major and minor version of macOS.

I tried a different patch that would download go1.4.2.darwin-amd64-osx10.8.pkg on Big Sur, and it installed successfully, but go version printed a stack trace, so I adjusted the patch to print Binary Go unavailable for this platform. I tested, go1.4.2 and it installs, but also crashes. go1.5 installed and passed my go version test. We could write more code to protect Big Sur users from this, but I doubt many developers are still trying to use a Golang from 2015 on Big Sur, and I don't think my go version test is a comprehensive compatibility test anyways.

PS: I included a whitespace-only commit, as a few lines used spaces for indentation while the overwhelming majority of the file used tabs.

jeremy-ebler-vineti commented 3 years ago

I just noticed that https://github.com/moovweb/gvm/pull/364 is largely the same patch. Moving the macOS specific checks into the 1.4.x check is slightly better (since they only matter if that check passes), but it's a very minor optimization.