Build systems sometimes have chicken-and-egg problems: they may need a version of themselves to get built. This page describes build systems that has this issue and ways to boostrap them properly.
GNU Make is usually built with make, but it actually provides a shell script that breaks the loop!
If you need to build GNU Make and have no other `make' program to use, you can use the shell script `build.sh' instead. To do this, first run `configure' as described in INSTALL. Then, instead of typing `make' to build the program, type `sh build.sh'. This should compile the program in the current directory. Then you will have a Make program that you can use for `./make install', or whatever else.
As you see, you are not in the vicious circle.
Meson and Ninja
Meson is a build system intended to replace ./configure and Make.
It depends on Ninja (another more primitive build system) and is implemented in Python. Python may switch to Meson in the future. In that case there would be a bootstrapping loop, but maybe it's a non issue if ninja files are provided.
Ninja is used to build Google Chrome, parts of Android, LLVM, and can be used in many other projects due to CMake's Ninja backend.
Fortunately because samurai exists and can be built with C and Make; as long as Python core developers refrain from abusing recursive definitions the ninja bootstrap should avoid becoming a loop.
Maven is a build-system and package manager for Java packages. Not only does it depend on itself to get built, most of its dependencies do too! Thanksfully, java packages are typically not very difficult to build using only the javac command. Guix uses a custom ant-build-system that can generate a build.xml file for maven and its dependencies. Using this, it runs ant to build the packages and come up with a working version of Maven. Additionally, some packages require a custom script to generate metadata and resources that are required at runtime, but are normally generated by a dependent package such as maven plugins.
- https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/maven.scm for an implementation of the bootstrap
Fac uses the ptrace system call to track all system calls that a build rule uses. It recognizes those calls that read or write to files or directories.
Could a tool like fac be used in general to break build system bootstrap loops?
Yes in theory but thankfully Gnu Make does a good enough job this isn't actually required.