remove redundant cpu
/os
/abi
/object_format
declarations from @import("builtin")
#22267
Labels
Milestone
cpu
/os
/abi
/object_format
declarations from @import("builtin")
#22267
Right now, details of the compilation target can be accessed through
@import("builtin")
in multiple ways:builtin.target.cpu
andbuiltin.cpu
builtin.target.os
andbuiltin.os
builtin.target.abi
andbuiltin.abi
builtin.target.ofmt
andbuiltin.object_format
These are guaranteed to always be equivalent --
target
is actually just defined like this:As such, having both around is entirely redundant, and has no benefit. This is a violation of "Only one obvious way to do things".
Since
builtin.target
bundles these values together in a logical way, it is the more useful declaration (it is easier and more concise to get a field fromtarget
than it is to reconstructtarget
from its fields). Therefore, this is a proposal to remove the following declarations from the generatedbuiltin.zig
source code:cpu
os
abi
object_format
These declarations should be marked as deprecated for one release cycle, and then entirely removed in a following one. I expect that the current definitions of
cpu
,os
,abi
, andobject_format
will just be inlined into the definition oftarget
.The text was updated successfully, but these errors were encountered: