Modernize the build system
# Summary Git has three different build systems, none of which are ideal: - Makefiles are the primary build system, but are a hassle to maintain and do not integrate well with IDEs. They also require us to manually wire up every single new platform. - Makefiles with autoconf fix the problem of having to manually wire up new platforms, but the autoconf scripts are extremely hard to read and basically unmaintained. We have received several complaints about them not working properly in the past. - CMake fixes those shortcomings, but is not properly wired up into Git and is not an officially supported way of building Git. We should invest the time to introduce a modern build system into Git. This achieves multiple goals: - Better integration with IDEs. - Less of a hassle to maintain build systems going forward. - Proper auto-configuration of platforms, even more esoteric ones. - Enable newcomers to easily discover configuration options. - Enable packagers to rely on standardized options. ## Business case Onboarding engineers into the Git project is hard due to many different reasons, with the build system being one of it. By providing a modern alternative with proper IDE integration we make it easier for people to contribute to Git, which helps both long-term contributors but also helps newcomers to onboard more readily. This helps us to grow the Git community with new talent, which reduces the risk that the project falls into hiatus. ### Status <!-- STATUS NOTE START --> ## Status 2025-05-06 A bunch of topics have been merged, bringing us closer to feature compatibility with our Makefile. There are only two remaining blockers before all use cases can be served via Meson: static analysis via `sparse` and support for Git GUI. Both of these are currently blockers. I am inclined to close this epic. Developers in the Git ecosystem have started to pick up Meson, there are multiple contributors to the Meson instructions outside of our team, many developers inside the Git team have started to use Meson exclusively, and we have rolled out Meson to GitLab.com as well as self-managed customers. There will be a follow-up epic to implement feature compatibility with Makefiles and to deprecate autoconf. :tada: **achievements**: - A fix for Meson has been merged to detect the target system's shell in `/bin/sh` over all the other potential paths. This fixes an issue we have hit with our Omnibus images where the shell may not exist on some self-hosted environments. - The "check-headers" target has been merged to verify that headers compile as standalone code units. This implements one of two remaining static analysis targets. - A couple of cleanups have been sent by Eli Schwartz, maintainer of Meson. This deduplicates some code. We have been collaborating on this together, and it is great to see that he continues to help out with Meson in Git as it enables good collaboration with upstream and benefits both projects. - Performance benchmarks are now supported by Meson. :issue-blocked: **blockers**: - Implementing support for `sparse` is blocked now on an upstream change in Meson to make include directories of dependencies accessible. - Support for Meson in git-gui is stuck in review upstream. The maintainer has mentioned that they don't have the capacity right now to review the change as it is somewhat more involved, but that they will get to it eventually. Supporting git-gui in Meson is the last missing user-facing piece. :arrow_forward: **next**: - Close this epic and create a follow-up epic with the goal of deprecating and removing autoconf. _Copied from https://gitlab.com/groups/gitlab-org/-/epics/16172#note_2485402940_ <!-- STATUS NOTE END -->
epic