AFAIK this is not (easily) possilbe withbuild-exe and companions. And I also can’t check currently.
If you use build.zig (for instance after a zig init) and then do zig build test for example you can pass the --webui and optionally --time-report to see an overview.
While I hope to view logs like what we got in make V=1 or ninja -v when working on C projects, where I usually use make V=1 2>&1 | tee make.log to collect logs for review later.
error(web_server): failed to listen to port 0: AddressFamilyUnsupported
error: failed to start web server: AlreadyReported
error: the following build command failed with exit code 1:
.cache/o/ab1e9b95b6421f173429fc9451b91309/build /opt/zig-0.16.0/zig /home/yf/Projects/ziglang/lib /home/yf/Projects/fmtz .cache /tmp/.cache --seed 0xac0718e1 -Zb5d734085ec609de -p . -j8 --time-report
My host have IPv6 disabled, would this be the reason?
Update: I can see reports via zig build --webui=127.0.0.1 --time-report now.
However, it isn’t like traditional make.log or ninja.log where each invocation of compiler or linker commands are logged with command line details.
Maybe this is because Zig has only one compilation unit (i.e. one compile invocation)? But even so there should be compilation and link command line details?
Yes, it only outputs zig commands, however some of these flags are passed to the linker.
I just double checked the --help output and you could pass the following flags
--verbose-link Enable compiler debug output for linking
--verbose-air Enable compiler debug output for Zig AIR
--verbose-llvm-ir[=file] Enable compiler debug output for LLVM IR
--verbose-llvm-bc=[file] Enable compiler debug output for LLVM BC
--verbose-cimport Enable compiler debug output for C imports
--verbose-cc Enable compiler debug output for C compilation
--verbose-llvm-cpu-features Enable compiler debug output for LLVM CPU features
But, It seems to only print once during compilation, when using zig build with zig build-exe it always prints.
for a fresh zig init running zig build --verbose-link