os/mac/diagnostic: check SDK version in SDKSettings matches the path#10552
Merged
Bo98 merged 5 commits intoHomebrew:masterfrom Feb 11, 2021
Merged
os/mac/diagnostic: check SDK version in SDKSettings matches the path#10552Bo98 merged 5 commits intoHomebrew:masterfrom
Bo98 merged 5 commits intoHomebrew:masterfrom
Conversation
Contributor
|
Review period will end on 2021-02-09 at 00:00:00 UTC. |
a74966c to
9ef2763
Compare
MikeMcQuaid
reviewed
Feb 8, 2021
carlocab
reviewed
Feb 8, 2021
carlocab
reviewed
Feb 8, 2021
08f5555 to
403a693
Compare
Contributor
|
Review period ended. |
BrewTestBot
approved these changes
Feb 9, 2021
MikeMcQuaid
reviewed
Feb 9, 2021
carlocab
reviewed
Feb 9, 2021
Bo98
commented
Feb 9, 2021
Comment on lines
47
to
49
Member
Author
There was a problem hiding this comment.
Side note: am I the only one who dislikes this indentation and prefers consistent over special_inside_parentheses?
Member
There was a problem hiding this comment.
Yeh, consistent is much nicer. Can you submit a PR to change the rule and autocorrect?
Member
Author
There was a problem hiding this comment.
Yes, I'll do that separately (maybe after this is merged).
MikeMcQuaid
approved these changes
Feb 10, 2021
Member
MikeMcQuaid
left a comment
There was a problem hiding this comment.
Fine with me 👍🏻. Would like @carlocab to also be 👍🏻 and ideally a few more tests but nothing blocking.
carlocab
approved these changes
Feb 10, 2021
Member
Author
|
Coverage 💯 (ok, it's 97% but is a test on |
Member
|
Great work @Bo98 👏🏻. |
This was referenced Feb 11, 2021
carlocab
added a commit
to carlocab/homebrew-core
that referenced
this pull request
Feb 15, 2021
This reverts commit f4e69f8. It is no longer necessary after the fix to the mismatched Mojave SDK. Context: Homebrew/brew#10552
This was referenced Feb 15, 2021
BrewTestBot
pushed a commit
to Homebrew/homebrew-core
that referenced
this pull request
Feb 17, 2021
This reverts commit f4e69f8. It is no longer necessary after the fix to the mismatched Mojave SDK. Context: Homebrew/brew#10552
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
brew stylewith your changes locally?brew typecheckwith your changes locally?brew testswith your changes locally?brew manlocally and committed any changes?The CLT 10.x -> 11.x upgrade process on 10.14 contained a bug which broke the SDKs. Notably, MacOSX10.14.sdk would indirectly symlink to MacOSX10.15.sdk. This PR is an attempt to detect installations with this broken setup.
The first commit lays the groundwork by redoing the SDK version detection system to be based on SDKSettings rather than solely on paths. The SDKSettings file more accurately describes what the contents of the SDK represent... because it is a part of the said contents. As a result it's now technically possible to have two SDKs with the same version (though working installations shouldn't do), but
brewwill continue to only actually use the first one it finds.Note that
brewwill now ignore SDKs without a SDKSettings file. No official macOS SDK shipped without one so this should not break any unmodified installations.The second commit adds the actual diagnostic. It checks the SDK version (which is now read from SDKSettings) and sees if it matches the version in the path. If it does not, it is a big indication that the SDK installation is broken.
This PR should fail
brew doctoron the 10.14 VMs just now. I hope to fix those VMs as soon as possible (Monday/Tuesday).I have not yet tested this PR on anything other than Mojave.