## Part 1: Per-Module Settings in the Build System
This moves many settings f…rom `std.Build.Step.Compile` and into `std.Build.Module`, and then makes them transitive.
In other words, it adds support for exposing Zig modules in packages, which are configured in various ways, such as depending on other link objects, include paths, or even a different optimization mode.
Now, transitive dependencies will be included in the compilation, so you can, for example, make a Zig module depend on some C source code, and expose that Zig module in a package.
closes #14719
## Part 2: Per-Module Settings in the Compiler
This branch also migrates many settings from being per-Compilation to being per-Module in the compiler itself. This required extensive changes to the interaction between the CLI as well as Compilation.
Before, the compiler frontend autogenerated only one `@import("builtin")` module for the entire compilation, however, this branch makes it honor the differences in modules, so that modules can be compiled with different optimization modes, code model, valgrind integration, or even target CPU feature set.
### Part 2A: Yak Shave: Linker Options
This ballooned into an enormous changeset because I decided that the `link.Options` struct should not be stored in `link.File`, and I wanted to make those fields be resolved and set directly in `link.File` (the base struct) or the ObjectFormat-specific structs (such as MachO, Elf, etc.).
This change has been needed for a long time, so this pays off some tech debt. I hope it does not cause too many conflicts.
## Merge Checklist
* [x] Rename `std.zig.CrossTarget` to `std.zig.Target.Query`
* [x] Make the dynamic linker part of `std.Target`
* [x] Introduce `std.Build.ResolvedTarget` to avoid redundantly resolving target queries
* [x] test on a project with a big dependency tree (groovebasin)
* [x] fix regression: race conditions on linux/elf
* [x] fix regression: test-stack-traces on macOS
* [x] fix regression: unable to bootstrap on windows due to error.AccessDenied when writing builtin.zig
* [x] Make sure there's a check and error message for other modules depending on the main module, since that's a scenario the frontend can't currently encode
* [x] Give each module its own `@import("builtin")` that can be different from the root module one.
* [x] Make each function respect the target CPU feature set, even in the LLVM backend.
* [ ] ~Add a test for mixing modules with different optimization modes into the same compilation.~ #978
* [ ] ~Make different optimization modes per function supported in the LLVM backend~ #978
* [x] write the upgrade guide
* [x] make it handle -fno-emit-bin -femit-llvm-bc
* [x] make compilation.create() take an arena
* [ ] add CLI err when requesting hex or binary object format
* [ ] make it so that --shared-memory automatically adds the needed CPU features if not explicitly specified
* [x] update flush and flushModule and other functions to not take Compilation parameter
* [ ] ~put all the modules in a flat array to make them easier to iterate~ unimportant refactor, do it when there are fewer open PRs
* [ ] ~flatten link.File into LinkFile.zig~ unimportant refactor, do it when there are fewer open PRs
* [ ] ~rename bin_file to link_file~ unimportant refactor, do it when there are fewer open PRs
* [x] introduce global -I and global -L args so that they don't get duplicated so many times on the CLI
* [x] pass the update() arena to linker flush()
* [ ] ~regression: aarch64-windows coff dwarf standalone test~ #18427
## Upgrade Guide
* Deprecated API removed: use the new API names
### modules can now be configured in more useful ways
Now, every `Compile` step has a `root_module` field which can be accessed directly.
* Many settings can be configured on a per-module basis now, such as `optimize_mode`, `target` (CPU features), `single_threaded`, and many more.
* Link objects are now attached directly to modules, such as C source files, static libraries, system libraries
* C compiler flags, lib paths, include directories, etc. can now be configured per-module
It's now possible to make a module depend on the main module of a compilation.
Many of these fields were moved from `std.Build.Step.Compile` to `std.Build.Module`. Instead of setting the field of Compile, set it in the options passed to addExecutable, addStaticLibrary, etc., or, change it to set the field of a Compile step's `root_module`.
### `main_mod_path` is removed
There is no replacement. The root source file of a zig module determines the module's root directory - it is the root source file's direct parent. This was done to simplify Zig modules conceptually.
If your code depends on setting `main_mod_path`, here are some ways to transition to the new API:
1. Move your module's root source file so that its parent directory is inside the path you were setting as the `main_mod_path`.
2. Instead of reaching outside of the module's directory tree, make the file(s) that you want to access into a separate module that can be accessed with `@import`.
### Removal of vcpkg integration
Instead of vcpkg, users are encouraged to use the Zig package manager to fulfill dependencies on Windows.
### `std.zig.CrossTarget` renamed to `std.Target.Query`
Now there is a clear delineation using the concept of a target query and a fully resolved target. Here is some example code:
```zig
pub fn build(b: *std.Build) void {
const target_query: std.Target.Query = .{};
const resolved_target: std.Build.ResolvedTarget = b.resolveTargetQuery(target_query);
const target: std.Target = resolved_target.result;
const lib = b.addStaticLibrary(.{
.name = "ffmpeg",
.target = resolved_target,
});
```
I left the types in there for clarity, but in practice it will probably look more like this:
```zig
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const t = target.result;
const lib = b.addStaticLibrary(.{
.name = "ffmpeg",
.target = target,
});
const avconfig_h = b.addConfigHeader(.{
.style = .blank,
.include_path = "libavutil/avconfig.h",
}, .{
.AV_HAVE_BIGENDIAN = @intFromBool(t.cpu.arch.endian() == .big),
.AV_HAVE_FAST_UNALIGNED = @intFromBool(fastUnalignedLoads(t)),
});
lib.addConfigHeader(avconfig_h);
```
### Error Return Tracing in ReleaseSafe Optimization Mode
Before, error return tracing defaulted to **on** in ReleaseSafe mode. Now it defaults to **off** since it is a debugging feature rather than a safety feature. To obtain the previous behavior, one can pass `-ferror-tracing` (CLI) or pass `.error_tracing = true,` to `addExecutable` and similar functions.
Like many other settings, this can now be configured on a per-Module basis.
### CLI
Old syntax: `--mod a:a,b=c:d --deps a,b=c`
New syntax: `--dep a --dep b=c --mod a d`
Note that `--mod` takes *two* parameters. It is the only CLI option that takes two parameters.
All per-module settings on the CLI apply to the *next* `--mod` argument. Global settings are unaffected.
Any `-I` args appearing *after* the final `--mod` argument affect all modules.
All C source files are now attached to a module, as demonstrated by this error message:
```
$ zig build-exe --mod a b hello.c
error: C source file 'hello.c' has no parent module
```
This is fixed by attaching the C source file to the module by putting it first:
```
zig build-exe hello.c --mod a b
```
If there is no `--mod` argument then zig infers one at the end, so this still works fine:
```
zig build-exe hello.c
```
### `--prominent-compile-errors`
This was removed in 986a30e373f6b2f0da2de64570013c83cacc17b6 but it is now added again.
This reintroduced flag makes `zig build` behave the same as before this branch. Without this flag, **the default behavior is now changed** to display compilation errors inline with the rest of error messages and the build tree context.
This behavior is essential for making sense of error logs from projects that have two or more steps emitting compilation errors which is why it is now the default.
As an example, before, you could see something like this:
```
test-c-abi
└─ run test-c-abi-powerpc64le-linux.4.19...6.5.7-musl-ppc64le-ReleaseFast
└─ zig test test-c-abi-powerpc64le-linux.4.19...6.5.7-musl-ppc64le-ReleaseFast ReleaseFast powerpc64le-linux-musl 1 errors
error: the following command failed with 1 compilation errors:
/home/andy/dev/zig/build-release/stage4/bin/zig test -cflags -std=c99 -- /home/andy/dev/zig/test/c_abi/cfuncs.c -OReleaseFast -target powerpc64le-linux-musl -mcpu baseline --mod root /home/andy/dev/zig/test/c_abi/main.zig -lc --cache-dir /home/andy/dev/zig/zig-cache --global-cache-dir /home/andy/.cache/zig --name test-c-abi-powerpc64le-linux.4.19...6.5.7-musl-ppc64le-ReleaseFast -L /home/andy/local/llvm17-assert/lib -I /home/andy/local/llvm17-assert/include -L /nix/store/03grn1z9pl9m8702wkshj5pwnvknazim-zlib-1.2.13-dev/lib -I /nix/store/03grn1z9pl9m8702wkshj5pwnvknazim-zlib-1.2.13-dev/include -L /nix/store/69jpyha5zbll6ppqzhbihhp51lac1hrp-zlib-1.2.13/lib -L /nix/store/fgkwipdckl30pdd80xr4l6hfk5h5qcqf-perf-linux-6.1.53/lib -I /nix/store/fgkwipdckl30pdd80xr4l6hfk5h5qcqf-perf-linux-6.1.53/include -L /nix/store/sp86px3bwaix43ywk194dmkdnf9dvxda-rr-5.6.0/lib -L /nix/store/n5qp1xk9gglc4k07y7sn1wqwk9cbzdbl-wabt-1.0.33/lib -I /nix/store/n5qp1xk9gglc4k07y7sn1wqwk9cbzdbl-wabt-1.0.33/include -L /nix/store/kbyd2711qxdy9r1ghfdk2piyrap8fk7i-bloaty-1.1/lib -L /nix/store/qws26d0bpdw5h7cf4bg29lxxrwhw7cz1-binaryen-112/lib -I /nix/store/qws26d0bpdw5h7cf4bg29lxxrwhw7cz1-binaryen-112/include -L /nix/store/3wdpi7s41ra9cbsc99myvi10cia74dpy-libedit-20221030-3.1-dev/lib -I /nix/store/3wdpi7s41ra9cbsc99myvi10cia74dpy-libedit-20221030-3.1-dev/include -L /nix/store/3j8n1hl92r8bhwzqxgvx3nzpb6h59qm2-ncurses-6.4-dev/lib -I /nix/store/3j8n1hl92r8bhwzqxgvx3nzpb6h59qm2-ncurses-6.4-dev/include -L /nix/store/i6y3vfw18aygsivl29fk7y0pb153j571-ncurses-6.4/lib -L /nix/store/lcf187gr6qq280qn14fdr8k5fjwp6n78-libedit-20221030-3.1/lib -L /nix/store/b0n002j20xja9627550j61f0p6gs4j8w-wasmtime-10.0.1-dev/lib -I /nix/store/b0n002j20xja9627550j61f0p6gs4j8w-wasmtime-10.0.1-dev/include -fno-lto --listen=-
test-c-abi
└─ run test-c-abi-mips-linux.4.19...6.5.7-musl-mips32-ReleaseFast
└─ zig test test-c-abi-mips-linux.4.19...6.5.7-musl-mips32-ReleaseFast ReleaseFast mips-linux-musl 1 errors
error: the following command failed with 1 compilation errors:
/home/andy/dev/zig/build-release/stage4/bin/zig test -cflags -std=c99 -- /home/andy/dev/zig/test/c_abi/cfuncs.c -OReleaseFast -target mips-linux-musl -mcpu baseline --mod root /home/andy/dev/zig/test/c_abi/main.zig -lc --cache-dir /home/andy/dev/zig/zig-cache --global-cache-dir /home/andy/.cache/zig --name test-c-abi-mips-linux.4.19...6.5.7-musl-mips32-ReleaseFast -L /home/andy/local/llvm17-assert/lib -I /home/andy/local/llvm17-assert/include -L /nix/store/03grn1z9pl9m8702wkshj5pwnvknazim-zlib-1.2.13-dev/lib -I /nix/store/03grn1z9pl9m8702wkshj5pwnvknazim-zlib-1.2.13-dev/include -L /nix/store/69jpyha5zbll6ppqzhbihhp51lac1hrp-zlib-1.2.13/lib -L /nix/store/fgkwipdckl30pdd80xr4l6hfk5h5qcqf-perf-linux-6.1.53/lib -I /nix/store/fgkwipdckl30pdd80xr4l6hfk5h5qcqf-perf-linux-6.1.53/include -L /nix/store/sp86px3bwaix43ywk194dmkdnf9dvxda-rr-5.6.0/lib -L /nix/store/n5qp1xk9gglc4k07y7sn1wqwk9cbzdbl-wabt-1.0.33/lib -I /nix/store/n5qp1xk9gglc4k07y7sn1wqwk9cbzdbl-wabt-1.0.33/include -L /nix/store/kbyd2711qxdy9r1ghfdk2piyrap8fk7i-bloaty-1.1/lib -L /nix/store/qws26d0bpdw5h7cf4bg29lxxrwhw7cz1-binaryen-112/lib -I /nix/store/qws26d0bpdw5h7cf4bg29lxxrwhw7cz1-binaryen-112/include -L /nix/store/3wdpi7s41ra9cbsc99myvi10cia74dpy-libedit-20221030-3.1-dev/lib -I /nix/store/3wdpi7s41ra9cbsc99myvi10cia74dpy-libedit-20221030-3.1-dev/include -L /nix/store/3j8n1hl92r8bhwzqxgvx3nzpb6h59qm2-ncurses-6.4-dev/lib -I /nix/store/3j8n1hl92r8bhwzqxgvx3nzpb6h59qm2-ncurses-6.4-dev/include -L /nix/store/i6y3vfw18aygsivl29fk7y0pb153j571-ncurses-6.4/lib -L /nix/store/lcf187gr6qq280qn14fdr8k5fjwp6n78-libedit-20221030-3.1/lib -L /nix/store/b0n002j20xja9627550j61f0p6gs4j8w-wasmtime-10.0.1-dev/lib -I /nix/store/b0n002j20xja9627550j61f0p6gs4j8w-wasmtime-10.0.1-dev/include -fno-lto --listen=-
test-c-abi
└─ run test-c-abi-powerpc-linux.4.19...6.5.7-musl-ppc-ReleaseFast
└─ zig test test-c-abi-powerpc-linux.4.19...6.5.7-musl-ppc-ReleaseFast ReleaseFast powerpc-linux-musl 1 errors
error: the following command failed with 1 compilation errors:
/home/andy/dev/zig/build-release/stage4/bin/zig test -cflags -std=c99 -- /home/andy/dev/zig/test/c_abi/cfuncs.c -OReleaseFast -target powerpc-linux-musl -mcpu baseline --mod root /home/andy/dev/zig/test/c_abi/main.zig -lc --cache-dir /home/andy/dev/zig/zig-cache --global-cache-dir /home/andy/.cache/zig --name test-c-abi-powerpc-linux.4.19...6.5.7-musl-ppc-ReleaseFast -L /home/andy/local/llvm17-assert/lib -I /home/andy/local/llvm17-assert/include -L /nix/store/03grn1z9pl9m8702wkshj5pwnvknazim-zlib-1.2.13-dev/lib -I /nix/store/03grn1z9pl9m8702wkshj5pwnvknazim-zlib-1.2.13-dev/include -L /nix/store/69jpyha5zbll6ppqzhbihhp51lac1hrp-zlib-1.2.13/lib -L /nix/store/fgkwipdckl30pdd80xr4l6hfk5h5qcqf-perf-linux-6.1.53/lib -I /nix/store/fgkwipdckl30pdd80xr4l6hfk5h5qcqf-perf-linux-6.1.53/include -L /nix/store/sp86px3bwaix43ywk194dmkdnf9dvxda-rr-5.6.0/lib -L /nix/store/n5qp1xk9gglc4k07y7sn1wqwk9cbzdbl-wabt-1.0.33/lib -I /nix/store/n5qp1xk9gglc4k07y7sn1wqwk9cbzdbl-wabt-1.0.33/include -L /nix/store/kbyd2711qxdy9r1ghfdk2piyrap8fk7i-bloaty-1.1/lib -L /nix/store/qws26d0bpdw5h7cf4bg29lxxrwhw7cz1-binaryen-112/lib -I /nix/store/qws26d0bpdw5h7cf4bg29lxxrwhw7cz1-binaryen-112/include -L /nix/store/3wdpi7s41ra9cbsc99myvi10cia74dpy-libedit-20221030-3.1-dev/lib -I /nix/store/3wdpi7s41ra9cbsc99myvi10cia74dpy-libedit-20221030-3.1-dev/include -L /nix/store/3j8n1hl92r8bhwzqxgvx3nzpb6h59qm2-ncurses-6.4-dev/lib -I /nix/store/3j8n1hl92r8bhwzqxgvx3nzpb6h59qm2-ncurses-6.4-dev/include -L /nix/store/i6y3vfw18aygsivl29fk7y0pb153j571-ncurses-6.4/lib -L /nix/store/lcf187gr6qq280qn14fdr8k5fjwp6n78-libedit-20221030-3.1/lib -L /nix/store/b0n002j20xja9627550j61f0p6gs4j8w-wasmtime-10.0.1-dev/lib -I /nix/store/b0n002j20xja9627550j61f0p6gs4j8w-wasmtime-10.0.1-dev/include -fno-lto --listen=-
Build Summary: 54/91 steps succeeded; 18 failed (disable with --summary none)
test-c-abi transitive failure
├─ run test-c-abi-mips-linux.4.19...6.5.7-musl-mips32-Debug transitive failure
│ └─ zig test test-c-abi-mips-linux.4.19...6.5.7-musl-mips32-Debug Debug mips-linux-musl 1 errors
├─ run test-c-abi-wasm32-wasi-musl-generic-Debug transitive failure
│ └─ zig test test-c-abi-wasm32-wasi-musl-generic-Debug Debug wasm32-wasi-musl failure
├─ run test-c-abi-powerpc-linux.4.19...6.5.7-musl-ppc-Debug transitive failure
│ └─ zig test test-c-abi-powerpc-linux.4.19...6.5.7-musl-ppc-Debug Debug powerpc-linux-musl 1 errors
...
error: unable to build musl CRT file: ZigLacksTargetSupport
error: unable to build musl CRT file: ZigLacksTargetSupport
error: lld-link: /home/andy/.cache/zig/o/d79adfe179fb1ce97d10290c4e5d9f47/crt2.obj: machine type x86 conflicts with x64
error: lld-link: mingw32.lib(crt0_c.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(gccmain.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(natstart.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(wildcard.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(dllargv.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(_newmode.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(tlssup.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(xncommod.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(cinitexe.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(merr.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(usermatherr.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(CRT_fp10.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(mingw_helpers.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(pseudo-reloc.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(xtxtmode.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(crt_handler.obj): machine type x86 conflicts with x64
error: lld-link: mingwex.lib(mingw_matherr.obj): machine type x86 conflicts with x64
error: lld-link: msvcrt-os.lib(invalid_parameter_handler.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(tlsthrd.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(tlsmcrt.obj): machine type x86 conflicts with x64
error: lld-link: msvcrt-os.lib(acrt_iob_func.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(pesect.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(pseudo-reloc-list.obj): machine type x86 conflicts with x64
error: unable to build musl CRT file: ZigLacksTargetSupport
error: unable to build musl CRT file: ZigLacksTargetSupport
error: lld-link: <root>: undefined symbol: _wWinMainCRTStartup
error: unable to build musl CRT file: ZigLacksTargetSupport
error: lld-link: /home/andy/.cache/zig/o/d79adfe179fb1ce97d10290c4e5d9f47/crt2.obj: machine type x86 conflicts with x64
error: lld-link: mingw32.lib(crt0_c.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(gccmain.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(natstart.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(wildcard.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(dllargv.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(_newmode.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(tlssup.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(xncommod.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(cinitexe.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(merr.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(usermatherr.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(CRT_fp10.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(mingw_helpers.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(pseudo-reloc.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(xtxtmode.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(crt_handler.obj): machine type x86 conflicts with x64
error: lld-link: mingwex.lib(mingw_matherr.obj): machine type x86 conflicts with x64
error: lld-link: msvcrt-os.lib(invalid_parameter_handler.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(tlsthrd.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(tlsmcrt.obj): machine type x86 conflicts with x64
error: lld-link: msvcrt-os.lib(acrt_iob_func.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(pesect.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(pseudo-reloc-list.obj): machine type x86 conflicts with x64
error: unable to build musl CRT file: ZigLacksTargetSupport
error: unable to build musl CRT file: ZigLacksTargetSupport
error: lld-link: <root>: undefined symbol: _wWinMainCRTStartup
error: lld-link: /home/andy/.cache/zig/o/d79adfe179fb1ce97d10290c4e5d9f47/crt2.obj: machine type x86 conflicts with x64
error: lld-link: mingw32.lib(crt0_c.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(gccmain.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(natstart.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(wildcard.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(dllargv.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(_newmode.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(tlssup.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(xncommod.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(cinitexe.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(merr.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(usermatherr.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(CRT_fp10.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(mingw_helpers.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(pseudo-reloc.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(xtxtmode.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(crt_handler.obj): machine type x86 conflicts with x64
error: lld-link: mingwex.lib(mingw_matherr.obj): machine type x86 conflicts with x64
error: lld-link: msvcrt-os.lib(invalid_parameter_handler.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(tlsthrd.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(tlsmcrt.obj): machine type x86 conflicts with x64
error: lld-link: msvcrt-os.lib(acrt_iob_func.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(pesect.obj): machine type x86 conflicts with x64
error: lld-link: mingw32.lib(pseudo-reloc-list.obj): machine type x86 conflicts with x64
error: lld-link: <root>: undefined symbol: _wWinMainCRTStartup
error: unable to build musl CRT file: ZigLacksTargetSupport
error: unable to build musl CRT file: ZigLacksTargetSupport
```
which makes no goddamn sense at all. Now, it looks like this by default:
```
test-c-abi
└─ run test-c-abi-powerpc64le-linux.4.19...6.5.7-musl-ppc64le-ReleaseFast
└─ zig test test-c-abi-powerpc64le-linux.4.19...6.5.7-musl-ppc64le-ReleaseFast ReleaseFast powerpc64le-linux-musl 1 errors
error: unable to build musl CRT file: ZigLacksTargetSupport
error: the following command failed with 1 compilation errors:
/home/andy/dev/zig/build-release/stage4/bin/zig test -cflags -std=c99 -- /home/andy/dev/zig/test/c_abi/cfuncs.c -OReleaseFast -target powerpc64le-linux-musl -mcpu baseline --mod root /home/andy/dev/zig/test/c_abi/main.zig -lc --cache-dir /home/andy/dev/zig/zig-cache --global-cache-dir /home/andy/.cache/zig --name test-c-abi-powerpc64le-linux.4.19...6.5.7-musl-ppc64le-ReleaseFast -L /home/andy/local/llvm17-assert/lib -I /home/andy/local/llvm17-assert/include -L /nix/store/03grn1z9pl9m8702wkshj5pwnvknazim-zlib-1.2.13-dev/lib -I /nix/store/03grn1z9pl9m8702wkshj5pwnvknazim-zlib-1.2.13-dev/include -L /nix/store/69jpyha5zbll6ppqzhbihhp51lac1hrp-zlib-1.2.13/lib -L /nix/store/fgkwipdckl30pdd80xr4l6hfk5h5qcqf-perf-linux-6.1.53/lib -I /nix/store/fgkwipdckl30pdd80xr4l6hfk5h5qcqf-perf-linux-6.1.53/include -L /nix/store/sp86px3bwaix43ywk194dmkdnf9dvxda-rr-5.6.0/lib -L /nix/store/n5qp1xk9gglc4k07y7sn1wqwk9cbzdbl-wabt-1.0.33/lib -I /nix/store/n5qp1xk9gglc4k07y7sn1wqwk9cbzdbl-wabt-1.0.33/include -L /nix/store/kbyd2711qxdy9r1ghfdk2piyrap8fk7i-bloaty-1.1/lib -L /nix/store/qws26d0bpdw5h7cf4bg29lxxrwhw7cz1-binaryen-112/lib -I /nix/store/qws26d0bpdw5h7cf4bg29lxxrwhw7cz1-binaryen-112/include -L /nix/store/3wdpi7s41ra9cbsc99myvi10cia74dpy-libedit-20221030-3.1-dev/lib -I /nix/store/3wdpi7s41ra9cbsc99myvi10cia74dpy-libedit-20221030-3.1-dev/include -L /nix/store/3j8n1hl92r8bhwzqxgvx3nzpb6h59qm2-ncurses-6.4-dev/lib -I /nix/store/3j8n1hl92r8bhwzqxgvx3nzpb6h59qm2-ncurses-6.4-dev/include -L /nix/store/i6y3vfw18aygsivl29fk7y0pb153j571-ncurses-6.4/lib -L /nix/store/lcf187gr6qq280qn14fdr8k5fjwp6n78-libedit-20221030-3.1/lib -L /nix/store/b0n002j20xja9627550j61f0p6gs4j8w-wasmtime-10.0.1-dev/lib -I /nix/store/b0n002j20xja9627550j61f0p6gs4j8w-wasmtime-10.0.1-dev/include -fno-lto --listen=-
test-c-abi
└─ run test-c-abi-powerpc-linux.4.19...6.5.7-musl-ppc-ReleaseFast
└─ zig test test-c-abi-powerpc-linux.4.19...6.5.7-musl-ppc-ReleaseFast ReleaseFast powerpc-linux-musl 1 errors
error: unable to build musl CRT file: ZigLacksTargetSupport
error: the following command failed with 1 compilation errors:
/home/andy/dev/zig/build-release/stage4/bin/zig test -cflags -std=c99 -- /home/andy/dev/zig/test/c_abi/cfuncs.c -OReleaseFast -target powerpc-linux-musl -mcpu baseline --mod root /home/andy/dev/zig/test/c_abi/main.zig -lc --cache-dir /home/andy/dev/zig/zig-cache --global-cache-dir /home/andy/.cache/zig --name test-c-abi-powerpc-linux.4.19...6.5.7-musl-ppc-ReleaseFast -L /home/andy/local/llvm17-assert/lib -I /home/andy/local/llvm17-assert/include -L /nix/store/03grn1z9pl9m8702wkshj5pwnvknazim-zlib-1.2.13-dev/lib -I /nix/store/03grn1z9pl9m8702wkshj5pwnvknazim-zlib-1.2.13-dev/include -L /nix/store/69jpyha5zbll6ppqzhbihhp51lac1hrp-zlib-1.2.13/lib -L /nix/store/fgkwipdckl30pdd80xr4l6hfk5h5qcqf-perf-linux-6.1.53/lib -I /nix/store/fgkwipdckl30pdd80xr4l6hfk5h5qcqf-perf-linux-6.1.53/include -L /nix/store/sp86px3bwaix43ywk194dmkdnf9dvxda-rr-5.6.0/lib -L /nix/store/n5qp1xk9gglc4k07y7sn1wqwk9cbzdbl-wabt-1.0.33/lib -I /nix/store/n5qp1xk9gglc4k07y7sn1wqwk9cbzdbl-wabt-1.0.33/include -L /nix/store/kbyd2711qxdy9r1ghfdk2piyrap8fk7i-bloaty-1.1/lib -L /nix/store/qws26d0bpdw5h7cf4bg29lxxrwhw7cz1-binaryen-112/lib -I /nix/store/qws26d0bpdw5h7cf4bg29lxxrwhw7cz1-binaryen-112/include -L /nix/store/3wdpi7s41ra9cbsc99myvi10cia74dpy-libedit-20221030-3.1-dev/lib -I /nix/store/3wdpi7s41ra9cbsc99myvi10cia74dpy-libedit-20221030-3.1-dev/include -L /nix/store/3j8n1hl92r8bhwzqxgvx3nzpb6h59qm2-ncurses-6.4-dev/lib -I /nix/store/3j8n1hl92r8bhwzqxgvx3nzpb6h59qm2-ncurses-6.4-dev/include -L /nix/store/i6y3vfw18aygsivl29fk7y0pb153j571-ncurses-6.4/lib -L /nix/store/lcf187gr6qq280qn14fdr8k5fjwp6n78-libedit-20221030-3.1/lib -L /nix/store/b0n002j20xja9627550j61f0p6gs4j8w-wasmtime-10.0.1-dev/lib -I /nix/store/b0n002j20xja9627550j61f0p6gs4j8w-wasmtime-10.0.1-dev/include -fno-lto --listen=-
test-c-abi
└─ run test-c-abi-mips-linux.4.19...6.5.7-musl-mips32-ReleaseFast
└─ zig test test-c-abi-mips-linux.4.19...6.5.7-musl-mips32-ReleaseFast ReleaseFast mips-linux-musl 1 errors
error: unable to build musl CRT file: ZigLacksTargetSupport
error: the following command failed with 1 compilation errors:
/home/andy/dev/zig/build-release/stage4/bin/zig test -cflags -std=c99 -- /home/andy/dev/zig/test/c_abi/cfuncs.c -OReleaseFast -target mips-linux-musl -mcpu baseline --mod root /home/andy/dev/zig/test/c_abi/main.zig -lc --cache-dir /home/andy/dev/zig/zig-cache --global-cache-dir /home/andy/.cache/zig --name test-c-abi-mips-linux.4.19...6.5.7-musl-mips32-ReleaseFast -L /home/andy/local/llvm17-assert/lib -I /home/andy/local/llvm17-assert/include -L /nix/store/03grn1z9pl9m8702wkshj5pwnvknazim-zlib-1.2.13-dev/lib -I /nix/store/03grn1z9pl9m8702wkshj5pwnvknazim-zlib-1.2.13-dev/include -L /nix/store/69jpyha5zbll6ppqzhbihhp51lac1hrp-zlib-1.2.13/lib -L /nix/store/fgkwipdckl30pdd80xr4l6hfk5h5qcqf-perf-linux-6.1.53/lib -I /nix/store/fgkwipdckl30pdd80xr4l6hfk5h5qcqf-perf-linux-6.1.53/include -L /nix/store/sp86px3bwaix43ywk194dmkdnf9dvxda-rr-5.6.0/lib -L /nix/store/n5qp1xk9gglc4k07y7sn1wqwk9cbzdbl-wabt-1.0.33/lib -I /nix/store/n5qp1xk9gglc4k07y7sn1wqwk9cbzdbl-wabt-1.0.33/include -L /nix/store/kbyd2711qxdy9r1ghfdk2piyrap8fk7i-bloaty-1.1/lib -L /nix/store/qws26d0bpdw5h7cf4bg29lxxrwhw7cz1-binaryen-112/lib -I /nix/store/qws26d0bpdw5h7cf4bg29lxxrwhw7cz1-binaryen-112/include -L /nix/store/3wdpi7s41ra9cbsc99myvi10cia74dpy-libedit-20221030-3.1-dev/lib -I /nix/store/3wdpi7s41ra9cbsc99myvi10cia74dpy-libedit-20221030-3.1-dev/include -L /nix/store/3j8n1hl92r8bhwzqxgvx3nzpb6h59qm2-ncurses-6.4-dev/lib -I /nix/store/3j8n1hl92r8bhwzqxgvx3nzpb6h59qm2-ncurses-6.4-dev/include -L /nix/store/i6y3vfw18aygsivl29fk7y0pb153j571-ncurses-6.4/lib -L /nix/store/lcf187gr6qq280qn14fdr8k5fjwp6n78-libedit-20221030-3.1/lib -L /nix/store/b0n002j20xja9627550j61f0p6gs4j8w-wasmtime-10.0.1-dev/lib -I /nix/store/b0n002j20xja9627550j61f0p6gs4j8w-wasmtime-10.0.1-dev/include -fno-lto --listen=-
...
Build Summary: 54/91 steps succeeded; 18 failed (disable with --summary none)
test-c-abi transitive failure
├─ run test-c-abi-mips-linux.4.19...6.5.7-musl-mips32-Debug transitive failure
│ └─ zig test test-c-abi-mips-linux.4.19...6.5.7-musl-mips32-Debug Debug mips-linux-musl 1 errors
├─ run test-c-abi-wasm32-wasi-musl-generic-Debug transitive failure
│ └─ zig test test-c-abi-wasm32-wasi-musl-generic-Debug Debug wasm32-wasi-musl failure
├─ run test-c-abi-powerpc-linux.4.19...6.5.7-musl-ppc-Debug transitive failure
│ └─ zig test test-c-abi-powerpc-linux.4.19...6.5.7-musl-ppc-Debug Debug powerpc-linux-musl 1 errors
error: the following build command failed with exit code 1:
/home/andy/dev/zig/zig-cache/o/71ed747cc5906e89b3cc24d2890229f4/build /home/andy/dev/zig/build-release/stage4/bin/zig /home/andy/dev/zig /home/andy/dev/zig/zig-cache /home/andy/.cache/zig --seed 0x8d1ea933 test-c-abi -Denable-llvm -fwasmtime -fqemu
```
and you can get the nonsensical output if you pass `--prominent-compile-errors`.
That paste above is only the first 3, but you can already see how the output is more discernible.