zig
zig copied to clipboard
Enhancement: Better build-system compilation logging
Zig Version
0.11.0
Steps to Reproduce and Observed Output
One of my major critiques of the current zig build system is that output when compiling your code just looks kind of gross
steps [3/5] zig build-exe zig Debug native... Semantic Analysis [33208] ...
LLVM Emit Object...
If you are not familiar with the inner workings of a compiler, something like LLVM emit object
feels pretty opaque and uninformative. Compare this to building a project with cmake, which gives you regular compilation progress updates
or Compiling a project in rust
Again, much nicer compilation output
I am aware that passing --summary all
to zig build makes the build summary printed after compilation look a bit better. However, this doesn't change the actual output that happens during compilation. Even though this is just an aesthetic change. Providing high quality and satisfying compilation logs in my opinion makes it feel much better to compile your projects, especially given that zig's current compiler performance could be improved.
This specific use case was one of the main reasons that kept me from using the zig build system over CMake for my C projects. Once the build scripts were all written, when it came down to actually using them, CMake produced more modern and more satisfying output. Since as a developer I spend a lot of time waiting for my code to compile, I think its important to improve the quality of this issue
As far as I am aware, I don't know of any issues tracking this or build system flags that can be passed that improve output
Expected Output
It would be much better if the zig build system had more aesthetically pleasing output when compiling a project. This could either be the default or be a flag you can pass to zig build
The output of both Cmake and Cargo would be possible sources of inspiration. Ideally, the build system would show you which files/libraries/modules/steps are being compiled, and approximately how much still needs to be done before the project finishes building.
related https://github.com/ziglang/zig/issues/9633
on top of being unpleasant in general ive also had times where the current build output causes problems when running zig build run
on a project that prints. sometimes it completely messes up the program's output which i assume wouldnt happen if the progress bar simply used some newlines
Update: from my understanding, the reason zig doesn't create this nice compilation progress output is because it treats all compilation as a single translation unit, rather than compiling files separately.
However, once 13.0 comes around with incremental compilation support, I'd imagine we might get a little more insight into how much has been compiled and what still needs to be done. I think we can still come up with some compilation logging better than
Semantic Analysis [33208] ...