# macos: reimplement OS version detection · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/f2be1fb23edc272c0a310a9ceb9cdff45e011d98)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: f2be1fb23edc272c0a310a9ceb9cdff45e011d98

Requested commit: f2be1fb23edc272c0a310a9ceb9cdff45e011d98

Commit: f2be1fb23edc272c0a310a9ceb9cdff45e011d98

Tree: 0278f7d9f05c2d87ba1b2d10ba6e2a1309931d56

Author: Michael Dusan

Committer: Michael Dusan

## Message

```
macos: reimplement OS version detection

The macOS version is now obtained by parsing `SystemVersion.plist`.

Test cases added for plist files that date back to '2005 Panther and up
to the recent '2020 Big Sur 11.1 release of macOS.

Thus we are now able to reliably identify 10.3...11.1 and higher.

- drop use of kern.osproductversion sysctl
- drop use of kern.osversion sysctl (fallback)
- drop kern.osversion tests
- add `lib.std.zig.system.detect()`
- add minimalistic parser for `SystemVersion.plist`
- add test cases for { 10.3, 10.3.9, 10.15.6, 11.0, 11.1 }

closes #7569

```

## Parents

- [56c03881ebd8617e6506bfad01bf9cfdd4d3df7e](https://git.cafe/gitcafe/zig/commit/56c03881ebd8617e6506bfad01bf9cfdd4d3df7e?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/f2be1fb23edc272c0a310a9ceb9cdff45e011d98?format=markdown)
