os/mac/sdk: parse version from SDKSettings.json#10112
os/mac/sdk: parse version from SDKSettings.json#10112MikeMcQuaid merged 1 commit intoHomebrew:masterfrom carlocab:big-sur-sdk-path-v2
Conversation
|
Review period will end on 2020-12-24 at 13:35:46 UTC. |
|
@Bo98 Not sure if the last fallback to |
MikeMcQuaid
left a comment
There was a problem hiding this comment.
Great work so far! Any thoughts on removing the existing :big_sur logic you mentioned given this too? Interested in @Bo98's thoughts on that too if they have a chance.
There was a problem hiding this comment.
| version = JSON.parse(File.read(sdk_settings_json))["Version"] | |
| version = JSON.parse(File.read(sdk_settings_json))["Version"].presence |
and then I'd suggest using version ||= on the other cases below so it gets set to something even if this version is missing in the JSON.
There was a problem hiding this comment.
Can skip this too once it's only the JSON stuff.
Probably not. I'd much rather reject a SDK if SDKSettings is missing (which should never really happen). |
|
Thanks, @Bo98. Did you have thoughts regarding this brew/Library/Homebrew/os/mac/sdk.rb Lines 57 to 64 in d6692d2 in light of the last PR? |
|
I believe that will still be necessary if the user has, for example, macOS 11.1 installed but hasn't updated Xcode and so still has the 11.0 SDK. |
Thanks @Bo98 👍🏻 |
This implements feedback from #10072.
|
Just to copy over the point from the other PR:
Is this something we want to handle or just assume it won't happen again with the Big Sur versioning system? I reckon it won't happen again so I'm fine with this pull request as-is. |
|
Review period ended. |
brew stylewith your changes locally?brew typecheckwith your changes locally?brew testswith your changes locally?Language::Java::java_homebrew manlocally and committed any changes?This implements feedback from #10072.
We try to use a more sensible version check for the SDK, by querying, in order of priority:
sdk_prefix/MacOSX.sdk/SDKSettings.jsonsdk_prefix/MacOSX.sdk/SDKSettings.plistOS::Mac.sdk_version