[pacman-dev] [PATCH] Add AM_MAINTAINER_MODE to configure.ac and disable by default
We had issues with people trying to build the 4.2.0 tarball while not having automake-1.14 installed. This appears to be due to timestamp issues resulting in autotools trying to regenerate various files and then the Makefiles deciding they need specific versions of automake. This can be fixed by adding AM_MAINTAINER_MODE([disable]) to configure.ac, which means that any build will not try and rebuild any build scripts unless explicitly requested. Pacman developers can consider using --enable-maintainer-mode when running configure to use autotools to update build scripts as needed. Signed-off-by: Allan McRae <allan@archlinux.org> --- That is a long explanation for a single line change! configure.ac | 1 + 1 file changed, 1 insertion(+) diff --git a/configure.ac b/configure.ac index e0ed3cf..f17ae89 100644 --- a/configure.ac +++ b/configure.ac @@ -62,6 +62,7 @@ AC_REQUIRE_AUX_FILE([tap-driver.sh]) AC_CANONICAL_HOST AM_INIT_AUTOMAKE([1.11 foreign]) AM_SILENT_RULES([yes]) +AM_MAINTAINER_MODE([disable]) LT_INIT LIB_VERSION=`expr lib_current - lib_age`.lib_age.lib_revision -- 2.2.2
On 03/02/15 12:11, Allan McRae wrote:
We had issues with people trying to build the 4.2.0 tarball while not having automake-1.14 installed. This appears to be due to timestamp issues resulting in autotools trying to regenerate various files and then the Makefiles deciding they need specific versions of automake.
This can be fixed by adding AM_MAINTAINER_MODE([disable]) to configure.ac, which means that any build will not try and rebuild any build scripts unless explicitly requested.
Pacman developers can consider using --enable-maintainer-mode when running configure to use autotools to update build scripts as needed.
Signed-off-by: Allan McRae <allan@archlinux.org> ---
That is a long explanation for a single line change!
It turns out the bug is due to the TESTS file being updated due to sync200.py.in creating sync200.py. This patch is a workaround, but not a real fix (not sure what a real fix is...). It does require developers to use --enable-maintainer-mode when configuring to get all the auto-regen goodness. Are there objections to applying this patch - at least until a proper solution is found?
configure.ac | 1 + 1 file changed, 1 insertion(+)
diff --git a/configure.ac b/configure.ac index e0ed3cf..f17ae89 100644 --- a/configure.ac +++ b/configure.ac @@ -62,6 +62,7 @@ AC_REQUIRE_AUX_FILE([tap-driver.sh]) AC_CANONICAL_HOST AM_INIT_AUTOMAKE([1.11 foreign]) AM_SILENT_RULES([yes]) +AM_MAINTAINER_MODE([disable])
LT_INIT LIB_VERSION=`expr lib_current - lib_age`.lib_age.lib_revision
On Mon, Feb 9, 2015 at 2:45 AM, Allan McRae <allan@archlinux.org> wrote:
Are there objections to applying this patch - at least until a proper solution is found?
A few years ago there was a bit of drama in GNOME about projects disabling maintainer mode. Might be worth reading and looking further. http://blogs.gnome.org/desrt/2011/09/08/am_maintainer_mode-is-not-cool/ (AM_MAINTAINER_MODE without parameters is equivalent to ([disable]))
On 09/02/15 12:27, Jan Alexander Steffens wrote:
On Mon, Feb 9, 2015 at 2:45 AM, Allan McRae <allan@archlinux.org> wrote:
Are there objections to applying this patch - at least until a proper solution is found?
A few years ago there was a bit of drama in GNOME about projects disabling maintainer mode. Might be worth reading and looking further.
http://blogs.gnome.org/desrt/2011/09/08/am_maintainer_mode-is-not-cool/
(AM_MAINTAINER_MODE without parameters is equivalent to ([disable]))
I am quite aware of this and think that blog post is wrong :P We want the TESTS file automatically updated. So there is the option between: 1) having AM_MAINTAINER_MODE([disable]) added 2) requiring the specific version of automake/aclocal I used to make the tarball to build pacman 3) removing/altering the *.in pactest to not require dynamically generating it. Not sure how we would do 3), and 2) is a non-option. That leaves 1). The only effect (apart from fixing the build...) that adding AM_MAINTAINER_MODE([disable]) has on the build process is that if you patch configure.ac/Makefile.am, you have to run ./autogen.sh to update the build scripts. Allan
On 02/09/15 at 12:44pm, Allan McRae wrote:
On 09/02/15 12:27, Jan Alexander Steffens wrote:
On Mon, Feb 9, 2015 at 2:45 AM, Allan McRae <allan@archlinux.org> wrote:
Are there objections to applying this patch - at least until a proper solution is found?
A few years ago there was a bit of drama in GNOME about projects disabling maintainer mode. Might be worth reading and looking further.
http://blogs.gnome.org/desrt/2011/09/08/am_maintainer_mode-is-not-cool/
(AM_MAINTAINER_MODE without parameters is equivalent to ([disable]))
I am quite aware of this and think that blog post is wrong :P
We want the TESTS file automatically updated. So there is the option between: 1) having AM_MAINTAINER_MODE([disable]) added 2) requiring the specific version of automake/aclocal I used to make the tarball to build pacman 3) removing/altering the *.in pactest to not require dynamically generating it.
Not sure how we would do 3), and 2) is a non-option. That leaves 1).
The only effect (apart from fixing the build...) that adding AM_MAINTAINER_MODE([disable]) has on the build process is that if you patch configure.ac/Makefile.am, you have to run ./autogen.sh to update the build scripts.
Allan
We could move the substitution out of the test file into an external file to be read in by pactest.py. apg
LIBCURL was never set in the Makefile so XferCommand was always being set in the test file. This removes the only substitution in our test files which will prevent the TESTS file from being rebuilt every time configure is run. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> --- Makefile.am | 4 ++-- test/pacman/tests/.gitignore | 1 - test/pacman/tests/Makefile.am | 20 +------------------- test/pacman/tests/sync200.py | 17 +++++++++++++++++ test/pacman/tests/sync200.py.in | 18 ------------------ 5 files changed, 20 insertions(+), 40 deletions(-) delete mode 100644 test/pacman/tests/.gitignore create mode 100644 test/pacman/tests/sync200.py delete mode 100644 test/pacman/tests/sync200.py.in diff --git a/Makefile.am b/Makefile.am index 34489df..3f10d15 100644 --- a/Makefile.am +++ b/Makefile.am @@ -23,8 +23,8 @@ dist_pkgdata_DATA = \ proto/PKGBUILD-vcs.proto \ proto/proto.install -$(top_srcdir)/test/pacman/tests/TESTS: $(wildcard test/pacman/tests/*.py*) - @printf "TESTS += %s\n" $^ | sed -e "s/\.py\.in/.py/" | LC_ALL=C sort -u > "$@" +$(top_srcdir)/test/pacman/tests/TESTS: $(wildcard test/pacman/tests/*.py) + @printf "TESTS += %s\n" $^ | LC_ALL=C sort -u > "$@" TESTS = test/scripts/parseopts_test.sh \ test/scripts/human_to_size_test.sh \ diff --git a/test/pacman/tests/.gitignore b/test/pacman/tests/.gitignore deleted file mode 100644 index 665d9ce..0000000 --- a/test/pacman/tests/.gitignore +++ /dev/null @@ -1 +0,0 @@ -sync200.py diff --git a/test/pacman/tests/Makefile.am b/test/pacman/tests/Makefile.am index dba84e3..b541b3d 100644 --- a/test/pacman/tests/Makefile.am +++ b/test/pacman/tests/Makefile.am @@ -1,25 +1,7 @@ -CONFTESTS = $(patsubst %py.in,%py,$(wildcard *.py.in)) - -check_SCRIPTS = \ - $(wildcard *.py) \ - $(CONFTESTS) +check_SCRIPTS = $(wildcard *.py) noinst_SCRIPTS = $(check_SCRIPTS) EXTRA_DIST = $(check_SCRIPTS) -CLEANFILES = $(CONFTESTS) - -#### Taken from the autoconf scripts Makefile.am #### -edit = sed \ - -e 's|@LIBCURL[@]|$(LIBCURL)|g' \ - -e 's|@configure_input[@]|Generated from $@.in; do not edit by hand.|g' - - -$(CONFTESTS): Makefile - $(AM_V_at)$(RM) $@ $@.tmp - $(AM_V_GEN)test -f $(srcdir)/$@.in && $(edit) $(srcdir)/$@.in >$@.tmp || true - $(AM_V_at)chmod a-w $@.tmp - $(AM_V_at)mv $@.tmp $@ - # vim:set noet: diff --git a/test/pacman/tests/sync200.py b/test/pacman/tests/sync200.py new file mode 100644 index 0000000..2bcdd5d --- /dev/null +++ b/test/pacman/tests/sync200.py @@ -0,0 +1,17 @@ +self.description = "Synchronize the local database" + +self.option['XferCommand'] = ['/usr/bin/curl %u > %o'] + +sp1 = pmpkg("spkg1", "1.0-1") +sp1.depends = ["spkg2"] +sp2 = pmpkg("spkg2", "2.0-1") +sp2.depends = ["spkg3"] +sp3 = pmpkg("spkg3", "3.0-1") +sp3.depends = ["spkg1"] + +for sp in sp1, sp2, sp3: + self.addpkg2db("sync", sp) + +self.args = "-Sy" + +self.addrule("PACMAN_RETCODE=0") diff --git a/test/pacman/tests/sync200.py.in b/test/pacman/tests/sync200.py.in deleted file mode 100644 index 6e47112..0000000 --- a/test/pacman/tests/sync200.py.in +++ /dev/null @@ -1,18 +0,0 @@ -self.description = "Synchronize the local database" - -if len("@LIBCURL@") == 0: - self.option['XferCommand'] = ['/usr/bin/curl %u > %o'] - -sp1 = pmpkg("spkg1", "1.0-1") -sp1.depends = ["spkg2"] -sp2 = pmpkg("spkg2", "2.0-1") -sp2.depends = ["spkg3"] -sp3 = pmpkg("spkg3", "3.0-1") -sp3.depends = ["spkg1"] - -for sp in sp1, sp2, sp3: - self.addpkg2db("sync", sp) - -self.args = "-Sy" - -self.addrule("PACMAN_RETCODE=0") -- 2.3.0
participants (3)
-
Allan McRae
-
Andrew Gregory
-
Jan Alexander Steffens