implement the native operating system version detection for macOS #4583
Labels
contributor friendly
This issue is limited in scope and/or knowledge of Zig internals.
enhancement
Solving this issue will likely involve adding new logic or components to the codebase.
frontend
Tokenization, parsing, AstGen, Sema, and Liveness.
os-macos
standard library
This issue involves writing Zig code for the standard library.
Milestone
This is a follow-up task from #4550.
zig/lib/std/zig/system.zig
Lines 226 to 228 in 7617610
zig/lib/std/target.zig
Lines 115 to 187 in 7617610
sw_vers -productVersion
gives the correct answer, however, it would be better to avoid depending on this binary existing and maintaining this behavior. Furthermore, a peek at the source code (thanks @fengb for finding it) for this file reveals that it depends on the CoreFoundation framework to function, which is another dependency it would be nice to avoid here.It looks like the answer is in
/System/Library/CoreServices/SystemVersion.plist
(thanks @mikdusan for finding it), which is in a simple XML format. Perhaps a prerequisite to this issue would be an XML tokenizer.The text was updated successfully, but these errors were encountered: