[PATCH RFC 2/2] Makefile: deprecate autoconf build infrastructure
Git currently ships with three-and-a-half build systems:
- Our plain Makefile.
- Meson, which has been introduced rather recently.
- CMake, which is part of "contrib/" and used for Git for Windows
development. - autoconf, which only counts as half a build system as it is
integrated with our Makefile.Out of these, the autoconf infrastructure is probably by far the most unloved one. Its syntax is arcane, it has bugs, and it is generally not recommended to use it. This has led to a rather long discussion [1], where the project had general consensus that this infrastructure is not exactly loved and that it'd rather want to get rid of it in the long term.
This discussion eventually led to the addition of Meson as a modern replacement that can cover the autoconfiguration part of our autoconf infrastructure. Meson has by now been around for a bit and has generally stabilized over the last couple releases. With the recent addition of support for gitk and git-gui it should now support all features that are required by distributions to use it. In fact, some distributions like Gentoo use Meson already, and GitLab uses Meson for its production builds of Git. So it should overall be ready for distributions to use.
Deprecate the autoconf infrastructure so that we error out by default with a hint what packagers are expected to use instead. This behaviour can be overridden by passing "--disable-autoconf-deprecation", so that distros have time to adapt to the change. Furthermore, packagers are told to send us an email in case they cannot use neither the Makefile, nor the Meson build system, with a hint why that is.
Note that the date for removal is set to Git 2.55 for now. As the change is generally not user-facing but rather packager-facing it is not considered to be a breaking change. That being said, depending on the feedback we get from packagers we may adjust the timeline to match their reality.
[1]: https://lore.kernel.org/git/GV1PR02MB848925A79A9DD733848182D58D662@GV1PR02MB8489.eurprd02.prod.outlook.com/
Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
configure.ac | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
Show changes to configure.ac +32 −0
diff --git a/configure.ac b/configure.ac
index cfb50112bf..d7e221f62d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -148,6 +148,38 @@ AC_CONFIG_SRCDIR([git.c])
config_file=config.mak.autogen
config_in=config.mak.in
+#
+# Deprecation warning for the autoconf build system
+AC_ARG_ENABLE([autoconf-deprecation],
+ AS_HELP_STRING([--disable-autoconf-deprecation],
+ [allow use of the deprecated autoconf build system (use Make or Meson instead)]),
+ [autoconf_deprecation=$enableval],
+ [autoconf_deprecation=yes])
+
+AS_IF([test "x$autoconf_deprecation" = "xyes"],
+ [AC_MSG_ERROR([The autoconf build system is deprecated and will be removed in
+Git 2.55. The autoconf infrastructure had been generally neglected for a long
+time: it is missing features exposed by our Makefile and has bugs that went
+unfixed, and its use has generally been discouraged.
+
+Alternatively, you can either use the Makefile directly, or use Meson in case
+you depend on autoconfiguration for your system:
+
+ meson setup build
+ meson compile -C build
+ meson install -C build
+
+To override this error and proceed anyway, re-run with:
+
+ ./configure --disable-autoconf-deprecation
+
+Please note that the autoconf infrastructure will be removed soon, and at this
+point the workaround will stop working. If you have strong reasons why you can
+use neither the Makefile nor Meson, then please send us an email to tell us
+about your specific use case.
+])])
+
+AC_MSG_WARN([The autoconf build system is deprecated. Continuing anyway at your own risk.])
GIT_CONF_SUBST([AUTOCONFIGURED], [YesPlease])
--
2.53.0.697.g625c4fb2da.dirty