From 6a4107b27716511fa8c56c7c327da72996650046 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Tue, 3 Aug 2021 21:34:56 +0300 Subject: [PATCH 1/3] Ticket #4266: fix AC_INIT call for automake >= 1.16.4. FTBFS with following messages: autoreconf: running: aclocal -I m4 --force -I m4 configure.ac:31: error: AC_INIT should be called with package and version arguments /usr/local/Cellar/automake/1.16.4/share/aclocal-1.16/init.m4:29: AM_INIT_AUTOMAKE is expanded from... configure.ac:31: the top level autom4te: error: /usr/local/opt/m4/bin/m4 failed with exit status: 1 aclocal: error: /usr/local/Cellar/autoconf/2.71/bin/autom4te failed with exit status: 1 autoreconf: error: aclocal failed with exit status: 1 Initial changeset: partial revert of 32621b96d118b6ce64c0db3a9f5b136bdab62429. Signed-off-by: Andrew Borodin --- configure.ac | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/configure.ac b/configure.ac index 0d0b56869..49d1027d4 100644 --- a/configure.ac +++ b/configure.ac @@ -5,18 +5,6 @@ dnl dnl 2.64 is required at least for m4_esyscmd_s() AC_PREREQ(2.64) -dnl AC_INIT defines PACKAGE_VERSION and PACKAGE_STRING macros in config.h -dnl and puts a version into them. -dnl Since a) version is changed after `git commit` (and config.h is recreated -dnl as a result) and b) config.h is included in each .c file, the total -dnl recompilation is performed after commit instead of recompilation -dnl of modified files only. -dnl -dnl If AC_PACKAGE_VERSION and AC_PACKAGE_STRING macros are predefined before -dnl AC_INIT call, AC_INIT doesn't redefine them. -dnl As a result, config.h will not contain macros with variable version. -m4_define([AC_PACKAGE_VERSION], []) -m4_define([AC_PACKAGE_STRING], []) AC_INIT([GNU Midnight Commander], m4_esyscmd_s([./version.sh .]), [https://www.midnight-commander.org/wiki/NewTicket], [mc], [https://www.midnight-commander.org/]) From fcfa089b5308a550a452487a51648318deec4e4c Mon Sep 17 00:00:00 2001 From: Andreas Mohr Date: Mon, 2 Aug 2021 13:15:29 +0000 Subject: [PATCH 2/3] version.sh: output short mc git version to prevent full rebuild. When using exact git version in AC_INIT, every git commit result in different AC_PACKAGE_VERSION and AC_PACKAGE_STRING macros at config.h Hence this will cause a full rebuild (see #2252). 4.8.26-217-ge819ed742 -> 4.8.26-git 4.8.27-pre1-1-gcbc214da8 -> 4.8.27-pre1-git TODO: tests needed for final version release workflow! Signed-off-by: Andreas Mohr --- version.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/version.sh b/version.sh index 5d7aa1615..0565b7448 100755 --- a/version.sh +++ b/version.sh @@ -42,7 +42,7 @@ mc_print_version(){ #endif EOF fi - echo "${CURR_MC_VERSION}" + echo "${SHOR_MC_VERSION}" exit } @@ -59,11 +59,13 @@ src_top_dir="$1" VERSION_FILE="${src_top_dir}/mc-version.h" PREV_MC_VERSION="unknown" CURR_MC_VERSION="${PREV_MC_VERSION}" +SHOR_MC_VERSION="${PREV_MC_VERSION}" if [ -r "${VERSION_FILE}" ] then PREV_MC_VERSION=`sed -n 's/^#define MC_CURRENT_VERSION "\(.*\)"$/\1/p' "${VERSION_FILE}"` CURR_MC_VERSION="${PREV_MC_VERSION}" + SHOR_MC_VERSION="${PREV_MC_VERSION}" fi git_head=`git --git-dir "${src_top_dir}/.git" rev-parse --verify HEAD 2>/dev/null` @@ -71,10 +73,16 @@ git_head=`git --git-dir "${src_top_dir}/.git" rev-parse --verify HEAD 2>/dev/nul # try to store sha1 CURR_MC_VERSION="${git_head}" +SHOR_MC_VERSION="${CURR_MC_VERSION}" new_version=`git --git-dir "${src_top_dir}/.git" describe --always 2>/dev/null` [ -z "${new_version}" ] && mc_print_version # store pretty tagged version CURR_MC_VERSION="${new_version}" +SHOR_MC_VERSION="${CURR_MC_VERSION}" + +# stop full rebuild by using not-exact git version string in config.h, see #2252, #4266 +SHOR_MC_VERSION=`git --git-dir "${src_top_dir}/.git" describe --always --abbrev=0 2>/dev/null`-git + mc_print_version From 248213150901ab33966891495011f8ca13abf5ee Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Tue, 3 Aug 2021 21:42:55 +0300 Subject: [PATCH 3/3] doc/NEWS: update. Signed-off-by: Andrew Borodin --- doc/NEWS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/NEWS b/doc/NEWS index 608a33cea..2c31edb9e 100644 --- a/doc/NEWS +++ b/doc/NEWS @@ -7,7 +7,7 @@ Version 4.8.27 * Minimal version of Gettext is 0.18.2 (#3603) * Minimal version of libssh2 is 1.2.8 (#4259) * Reimplement version detection (#3603, #4249) - * Significantly reduce rebuilt time after version change (#2252) + * Significantly reduce rebuilt time after version change (#2252, #4266) * Drop automatic migration of configuration from ~/.mc to XDG-based directories (#3682) * zsh: support custom configuration file: ~/.local/share/mc/.zshrc (#4203) * Widgets: implement WST_VISIBLE state to show/hide widgets (#2919)