[libvirt] [PATCH] build: fix incremental autogen.sh when no AUTHORS is present

Commit 71d1256 tried to fix a problem where rebasing an old branch on top of newer libvirt.git resulted in automake failing because of a missing AUTHORS file. However, while the fix worked for an incremental 'make', it did not work for someone that directly reran './autogen.sh'. Reported by Laine Stump. * autogen.sh (autoreconf): Check for same conditions as cfg.mk. * cfg.mk (_update_required): Add comments. --- autogen.sh | 3 ++- cfg.mk | 2 ++ 2 files changed, 4 insertions(+), 1 deletions(-) diff --git a/autogen.sh b/autogen.sh index 126b272..d4957f1 100755 --- a/autogen.sh +++ b/autogen.sh @@ -69,14 +69,15 @@ if test -d .git; then *:set) ;; *-dirty*) echo "error: gnulib submodule is dirty, please investigate" 2>&1 echo "set env-var CLEAN_SUBMODULE to discard gnulib changes" 2>&1 exit 1 ;; esac + # Keep this test in sync with cfg.mk:_update_required if test "$t" = "$(cat $curr_status 2>/dev/null)" \ - && test -f "po/Makevars"; then + && test -f "po/Makevars" && test -f AUTHORS; then # good, it's up to date, all we need is autoreconf autoreconf -if else if test ${CLEAN_SUBMODULE+set}; then echo cleaning up submodules... git submodule foreach 'git clean -dfqx && git reset --hard' diff --git a/cfg.mk b/cfg.mk index ec4ab1c..c4ae195 100644 --- a/cfg.mk +++ b/cfg.mk @@ -688,12 +688,14 @@ ifeq (0,$(MAKELEVEL)) # in column 1 and does not print a "git describe"-style string after the # submodule name. Contrast these: # -b653eda3ac4864de205419d9f41eec267cb89eeb .gnulib # b653eda3ac4864de205419d9f41eec267cb89eeb .gnulib (v0.0-2286-gb653eda) # $ cat .git-module-status # b653eda3ac4864de205419d9f41eec267cb89eeb + # + # Keep this logic in sync with autogen.sh. _submodule_hash = sed 's/^[ +-]//;s/ .*//' _update_required := $(shell \ cd '$(srcdir)'; \ test -d .git || { echo 0; exit; }; \ test -f po/Makevars || { echo 1; exit; }; \ test -f AUTHORS || { echo 1; exit; }; \ -- 1.7.1

On 12/03/2012 03:14 PM, Eric Blake wrote:
Commit 71d1256 tried to fix a problem where rebasing an old branch on top of newer libvirt.git resulted in automake failing because of a missing AUTHORS file. However, while the fix worked for an incremental 'make', it did not work for someone that directly reran './autogen.sh'. Reported by Laine Stump.
* autogen.sh (autoreconf): Check for same conditions as cfg.mk. * cfg.mk (_update_required): Add comments. --- autogen.sh | 3 ++- cfg.mk | 2 ++ 2 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/autogen.sh b/autogen.sh index 126b272..d4957f1 100755 --- a/autogen.sh +++ b/autogen.sh @@ -69,14 +69,15 @@ if test -d .git; then *:set) ;; *-dirty*) echo "error: gnulib submodule is dirty, please investigate" 2>&1 echo "set env-var CLEAN_SUBMODULE to discard gnulib changes" 2>&1 exit 1 ;; esac + # Keep this test in sync with cfg.mk:_update_required if test "$t" = "$(cat $curr_status 2>/dev/null)" \ - && test -f "po/Makevars"; then + && test -f "po/Makevars" && test -f AUTHORS; then # good, it's up to date, all we need is autoreconf autoreconf -if else if test ${CLEAN_SUBMODULE+set}; then echo cleaning up submodules... git submodule foreach 'git clean -dfqx && git reset --hard' diff --git a/cfg.mk b/cfg.mk index ec4ab1c..c4ae195 100644 --- a/cfg.mk +++ b/cfg.mk @@ -688,12 +688,14 @@ ifeq (0,$(MAKELEVEL)) # in column 1 and does not print a "git describe"-style string after the # submodule name. Contrast these: # -b653eda3ac4864de205419d9f41eec267cb89eeb .gnulib # b653eda3ac4864de205419d9f41eec267cb89eeb .gnulib (v0.0-2286-gb653eda) # $ cat .git-module-status # b653eda3ac4864de205419d9f41eec267cb89eeb + # + # Keep this logic in sync with autogen.sh. _submodule_hash = sed 's/^[ +-]//;s/ .*//' _update_required := $(shell \ cd '$(srcdir)'; \ test -d .git || { echo 0; exit; }; \ test -f po/Makevars || { echo 1; exit; }; \ test -f AUTHORS || { echo 1; exit; }; \
My local tree isn't in a state that I can conveniently test it right now, but it looks correct to me. ACK.

Commit 71d1256 tried to fix a problem where rebasing an old branch on top of newer libvirt.git resulted in automake failing because of a missing AUTHORS file. However, while the fix worked for an incremental 'make', it did not work for someone that directly reran './autogen.sh'. Reported by Laine Stump.
My local tree isn't in a state that I can conveniently test it right now, but it looks correct to me. ACK.
Thanks; pushed. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 12/03/2012 03:14 PM, Eric Blake wrote:
Commit 71d1256 tried to fix a problem where rebasing an old branch on top of newer libvirt.git resulted in automake failing because of a missing AUTHORS file. However, while the fix worked for an incremental 'make', it did not work for someone that directly reran './autogen.sh'. Reported by Laine Stump.
* autogen.sh (autoreconf): Check for same conditions as cfg.mk. * cfg.mk (_update_required): Add comments. --- autogen.sh | 3 ++- cfg.mk | 2 ++ 2 files changed, 4 insertions(+), 1 deletions(-)
I'm not sure how if it impacts this particular change, but why don't we switch to AM_INIT_AUTOMAKE([foreign]) ? Since AUTHORS or ChangeLog are no longer static, it seems we are just causing ourselves pain by trying to work around auto* insisting those files exist. Then again I don't know what benefits non-foreign gives us... - Cole

I'm not sure how if it impacts this particular change, but why don't we switch to AM_INIT_AUTOMAKE([foreign]) ? Since AUTHORS or ChangeLog are no longer static, it seems we are just causing ourselves pain by trying to work around auto* insisting those files exist.
Then again I don't know what benefits non-foreign gives us...
Interesting idea; reading the automake manual, I see: https://www.gnu.org/software/automake/manual/automake.html#Strictness foreign Automake will check for only those things that are absolutely required for proper operations. For instance, whereas GNU standards dictate the existence of a NEWS file, it will not be required in this mode. This strictness will also turn off some warnings by default (among them, portability warnings). The name comes from the fact that Automake is intended to be used for GNU programs; these relaxed rules are not the standard mode of operation. then further details here: https://www.gnu.org/software/automake/manual/automake.html#Gnits The files INSTALL, NEWS, README, AUTHORS, and ChangeLog, plus one of COPYING.LIB, COPYING.LESSER or COPYING, are required at the topmost directory of the package. If the --add-missing option is given, automake will add a generic version of the INSTALL file as well as the COPYING file containing the text of the current version of the GNU General Public License existing at the time of this Automake release (version 3 as this is written, http://www.gnu.org/copyleft/gpl.html). However, an existing COPYING file will never be overwritten by automake. The options no-installman and no-installinfo are prohibited. Right now, we are relying on 'automake --add-missing' to generate our INSTALL, so switching to 'foreign' would break that. But it wouldn't be too hard to check a static copy of INSTALL into libvirt.git if that's the only thing in the way of us using a more relaxed automake mode. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 12/03/2012 05:37 PM, Eric Blake wrote:
I'm not sure how if it impacts this particular change, but why don't we switch to AM_INIT_AUTOMAKE([foreign]) ? Since AUTHORS or ChangeLog are no longer static, it seems we are just causing ourselves pain by trying to work around auto* insisting those files exist.
Then again I don't know what benefits non-foreign gives us...
Interesting idea; reading the automake manual, I see:
https://www.gnu.org/software/automake/manual/automake.html#Strictness
foreign Automake will check for only those things that are absolutely required for proper operations. For instance, whereas GNU standards dictate the existence of a NEWS file, it will not be required in this mode. This strictness will also turn off some warnings by default (among them, portability warnings). The name comes from the fact that Automake is intended to be used for GNU programs; these relaxed rules are not the standard mode of operation.
then further details here: https://www.gnu.org/software/automake/manual/automake.html#Gnits
The files INSTALL, NEWS, README, AUTHORS, and ChangeLog, plus one of COPYING.LIB, COPYING.LESSER or COPYING, are required at the topmost directory of the package.
If the --add-missing option is given, automake will add a generic version of the INSTALL file as well as the COPYING file containing the text of the current version of the GNU General Public License existing at the time of this Automake release (version 3 as this is written, http://www.gnu.org/copyleft/gpl.html). However, an existing COPYING file will never be overwritten by automake. The options no-installman and no-installinfo are prohibited.
Right now, we are relying on 'automake --add-missing' to generate our INSTALL, so switching to 'foreign' would break that. But it wouldn't be too hard to check a static copy of INSTALL into libvirt.git if that's the only thing in the way of us using a more relaxed automake mode.
And in fact I think the default INSTALL file is total overkill and daunting for anyone that doesn't have already have a basic understanding of autotools. This isn't a libvirt specific problem obviously. I think INSTALL should really be under 40 lines of texts, so as not to intimidate, and cover quick install from git, quick install from release tarball, and probably use of ./run for people that just want to run from the build directory. If need be we can keep INSTALL.autotools in git and point to that for more info, but a URL is probably sufficient. - Cole
participants (3)
-
Cole Robinson
-
Eric Blake
-
Laine Stump