0
Fork 0
mirror of https://codeberg.org/ziglang/zig synced 2026-11-18 07:05:05 +00:00
zig/test
Andrew Kelley b92e30ff0b std.Build.ResolvedTarget: rename target field to result
This change is seemingly insignificant but I actually agonized over this
for three days. Some other things I considered:

* (status quo in master branch) make Compile step creation functions
  accept a Target.Query and delete the ResolvedTarget struct.
  - downside: redundantly resolve target queries many times
* same as before but additionally add a hash map to cache target query
  resolutions.
  - downside: now there is a hash map that doesn't actually need to
    exist, just to make the API more ergonomic.
* add is_native_os and is_native_abi fields to std.Target and use it
  directly as the result of resolving a target query.
  - downside: they really don't belong there. They would be available
    as comptime booleans via `@import("builtin")` but they should not
    be exposed that way.

With this change the downsides are:
* the option name of addExecutable and friends is `target` instead of
  `resolved_target` matching the type name.
  - upside: this does not break compatibility with existing build
    scripts
* you likely end up seeing `target.result.cpu.arch` rather than
  `target.cpu.arch`.
  - upside: this is an improvement over `target.target.cpu.arch` which
    it was before this commit.
  - downside: `b.host.target` is now `b.host.result`.
History 2024-01-01 17:51:18 -07:00
..
behavior zig build system: change target, compilation, and module APIs 2024-01-01 17:51:18 -07:00
c_abi test: update remaining code to fix 'var is never mutated' errors 2023-11-19 09:57:04 +00:00
cases Sema: Initialise want_safety for switch prong child block 2023-12-29 11:42:44 +00:00
link std.Build.ResolvedTarget: rename target field to result 2024-01-01 17:51:18 -07:00
src std.Build.ResolvedTarget: rename target field to result 2024-01-01 17:51:18 -07:00
standalone std.Build.ResolvedTarget: rename target field to result 2024-01-01 17:51:18 -07:00
assemble_and_link.zig migrate from std.Target.current to @import("builtin").target 2021-10-04 23:48:55 -07:00
behavior.zig Zir: add missing extra index for linksection_or_addspace 2023-11-25 11:39:37 +00:00
cases.zig zig build system: change target, compilation, and module APIs 2024-01-01 17:51:18 -07:00
cbe.zig rename std.zig.CrossTarget to std.Target.Query 2024-01-01 17:51:18 -07:00
compare_output.zig test: update remaining code to fix 'var is never mutated' errors 2023-11-19 09:57:04 +00:00
compile_errors.zig zig build system: change target, compilation, and module APIs 2024-01-01 17:51:18 -07:00
gen_h.zig all: zig fmt and rename "@XToY" to "@YFromX" 2023-06-19 12:34:42 -07:00
link.zig test/link: spawn ELF and MachO tests from the same root test/link/link.zig 2023-11-10 13:44:43 +01:00
llvm_targets.zig rename std.zig.CrossTarget to std.Target.Query 2024-01-01 17:51:18 -07:00
nvptx.zig zig build system: change target, compilation, and module APIs 2024-01-01 17:51:18 -07:00
run_translated_c.zig tests: translate-c and run-translated-c to the test harness 2023-10-17 11:55:17 +03:00
stack_traces.zig zig fmt: fix extra whitespace with multiline strings 2022-12-17 00:24:58 +02:00
standalone.zig rename std.zig.CrossTarget to std.Target.Query 2024-01-01 17:51:18 -07:00
tests.zig std.Build.ResolvedTarget: rename target field to result 2024-01-01 17:51:18 -07:00
translate_c.zig rename std.zig.CrossTarget to std.Target.Query 2024-01-01 17:51:18 -07:00