commit | 44a402f9c4912aea880727dfa3e110513042e471 | [log] [tgz] |
---|---|---|
author | Roman Lebedev <lebedev.ri@gmail.com> | Mon Apr 26 15:48:36 2021 +0300 |
committer | Roman Lebedev <lebedev.ri@gmail.com> | Wed Oct 11 00:49:30 2023 +0300 |
tree | f1162be94cf82d0df9d5075d1ec21cd62799b78f | |
parent | b84b3501c63042e72b05c90c76d75e0381daa4cf [diff] |
Reliable ETA and progress percentage. This has been bugging me for *years*. :) Count of finished edges isn't a great statistic, it isn't really obvious if LLVM will take 8 minues to build, or 10 minutes. But, it's actually pretty straight-forward to get some more useful information. We already know how much time each edge has taken, so we could just do the dumb thing, and assume that every edge in the plan takes the same amount of time. Or, we can do better. `.ninja_log` already contains the historical data on how long each edge took to produce it's outs, so we simply need to ensure that we populate edges with that info, and then we can greatly improve our predictions. The math is pretty simple i think. This is largely a port of a similar change i did to LLVM LIT: https://reviews.llvm.org/D99073 With this, i get something quite lovely: ``` llvm-project/build-Clang12$ NINJA_STATUS="[%f/%t %p %P][%w + %W] " /repositories/ninja/build-Clang-debug/ninja opt [288/2527 11% 4%][00:27 + 08:52] Building CXX object lib/DebugInfo/CodeView/CMakeFiles/LLVMDebugInfoCodeView.dir/AppendingTypeTableBuilder.cpp.o ``` I hope people will find this useful, and it could be merged.
Ninja is a small build system with a focus on speed. https://ninja-build.org/
See the manual or doc/manual.asciidoc
included in the distribution for background and more details.
Binaries for Linux, Mac and Windows are available on GitHub. Run ./ninja -h
for Ninja help.
Installation is not necessary because the only required file is the resulting ninja binary. However, to enable features like Bash completion and Emacs and Vim editing modes, some files in misc/ must be copied to appropriate locations.
If you're interested in making changes to Ninja, read CONTRIBUTING.md first.
You can either build Ninja via the custom generator script written in Python or via CMake. For more details see the wiki.
./configure.py --bootstrap
This will generate the ninja
binary and a build.ninja
file you can now use to build Ninja with itself.
cmake -Bbuild-cmake cmake --build build-cmake
The ninja
binary will now be inside the build-cmake
directory (you can choose any other name you like).
To run the unit tests:
./build-cmake/ninja_test