Simon Josefsson via Gnulib discussion list <bug-gnulib@gnu.org> writes:

>>> What do you think about this change?
>>> 
>>> - AUTORECONFFLAGS="--verbose --install --force -I $m4_base $ACLOCAL_FLAGS"
>>> + AUTORECONFFLAGS="--verbose --install --force $ACLOCAL_FLAGS"
>>
>> It sounds like 'autoreconf' does a better job at extracting the list of
>> m4 files from configure.ac that 'bootstrap'. gnulib-tool also has code
>> for doing this (see gnulib-tool.sh lines 7322..7342).
>> So: If the extra '-I $m4_base' is not needed, then omit it. But if it is
>> needed, I would be in favour of adding all necessary -I options here, not
>> just one of them.
>
> Great.  I'll patch away this particular '-I' out of libidn2's
> bootstrap-funclib.sh and see if it fixes the problem and doesn't break
> anything else for libidn2.  Later on we can try it with other packages
> too, and maybe change things in gnulib too.

I've used this patch in releases of libidn2 and libidn, and now I ran
into the same problem when making GNU SASL tarballs reproducible too.

So I think the patch is the right solution.  I've pushed the attached
patch so we can see if it breaks any other project.  I can only think
that this could cause problems if the gnulib m4_base is missing from
configure.ac AC_CONFIG_MACRO_DIRS, but that is a fatal error anyway.
Although with these subtle things you never really know for sure, it
seems, at least not until you try.

/Simon
From 54fc57c23dcd833819a7adbdfcc3bd1c805103a8 Mon Sep 17 00:00:00 2001
From: Simon Josefsson <si...@josefsson.org>
Date: Thu, 27 Mar 2025 20:01:28 +0100
Subject: [PATCH] bootstrap: Improve "make dist" tarball reproducability.

* top/bootstrap-funclib.sh (autogen): Don't pass unnecessary -I's when
invoking autoreconf.  The order of M4 include directories is reflected
in Makefile.in content.  Our GNUmakefile _version rule invoke
autoreconf without any extra -I, and this difference in how autoreconf
is invoked results in different tarballs for "make dist" vs "make
release" which is undesirable.
---
 ChangeLog                | 10 ++++++++++
 top/bootstrap-funclib.sh |  4 ++--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a6b62b9f44..53fa2eb158 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2025-03-27  Simon Josefsson  <si...@josefsson.org>
+
+	bootstrap: Improve "make dist" tarball reproducability.
+	* top/bootstrap-funclib.sh (autogen): Don't pass unnecessary -I's
+	when invoking autoreconf.  The order of M4 include directories is
+	reflected in Makefile.in content.  Our GNUmakefile _version rule
+	invoke autoreconf without any extra -I, and this difference in how
+	autoreconf is invoked results in different tarballs for "make
+	dist" vs "make release" which is undesirable.
+
 2025-03-27  Simon Josefsson  <si...@josefsson.org>
 
 	maintainer-makefile: Check spelling using 'codespell'.
diff --git a/top/bootstrap-funclib.sh b/top/bootstrap-funclib.sh
index 47e015bd24..81884cc8b3 100644
--- a/top/bootstrap-funclib.sh
+++ b/top/bootstrap-funclib.sh
@@ -1,6 +1,6 @@
 # A library of shell functions for autopull.sh, autogen.sh, and bootstrap.
 
-scriptlibversion=2025-02-16.12; # UTC
+scriptlibversion=2025-03-27.18; # UTC
 
 # Copyright (C) 2003-2025 Free Software Foundation, Inc.
 #
@@ -1300,7 +1300,7 @@ autogen()
 
   # Invoke autoreconf with --force --install to ensure upgrades of tools
   # such as ylwrap.
-  AUTORECONFFLAGS="--verbose --install --force -I $m4_base $ACLOCAL_FLAGS"
+  AUTORECONFFLAGS="--verbose --install --force $ACLOCAL_FLAGS"
   AUTORECONFFLAGS="$AUTORECONFFLAGS --no-recursive"
 
   # Tell autoreconf not to invoke autopoint or libtoolize; they were run above.
-- 
2.49.0

Attachment: signature.asc
Description: PGP signature

Reply via email to