-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
implement the native operating system version detection for macOS #4583
Copy link
Copy link
Closed
Labels
contributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.This issue is limited in scope and/or knowledge of Zig internals.enhancementSolving this issue will likely involve adding new logic or components to the codebase.Solving this issue will likely involve adding new logic or components to the codebase.frontendTokenization, parsing, AstGen, Sema, and Liveness.Tokenization, parsing, AstGen, Sema, and Liveness.os-macosmacOSmacOSstandard libraryThis issue involves writing Zig code for the standard library.This issue involves writing Zig code for the standard library.
Milestone
Metadata
Metadata
Assignees
Labels
contributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.This issue is limited in scope and/or knowledge of Zig internals.enhancementSolving this issue will likely involve adding new logic or components to the codebase.Solving this issue will likely involve adding new logic or components to the codebase.frontendTokenization, parsing, AstGen, Sema, and Liveness.Tokenization, parsing, AstGen, Sema, and Liveness.os-macosmacOSmacOSstandard libraryThis issue involves writing Zig code for the standard library.This issue involves writing Zig code for the standard library.
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 -productVersiongives 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.