git reset --hard 96e5a2d4d5b13bf2cc887562dc11d146b78d5950
./autogen.sh
make -s
git pull
make -s <-- expecting auto-bootstrap here, doesn't happen
Use git diff to expose whether the submodule has untracked changes,
which are typical on an incremental pull if .gnulib was updated but
the user did not manually run 'git submodule update'.
After this patch is applied, I encountered a new problem when
following the reproducing pattern. Basically, the change to .gnulib
between libvirt's commit 96e5a2d4 and this patch introduced a change
to sys_ioctl.in.h, but gnulib (intentionally) does not make the
replacement headers depend on Makefile changes. Therefore, I ended up
with the generated replacement header being broken:
gnulib/lib/sys/ioctl.h complained about a use of @. But that seems
like something that should be fixed upstream in gnulib's bootstrap
script (that is, when doing a gnulib update, all files created from
.in.h file should probably be deleted). Without the benefit of that
proposed gnulib fix, I worked around the problem by manually removing
the stale gnulib/lib/sys/ioctl.h.
* autogen.sh (t): Also run bootstrap if the gnulib submodule needs
to be updated.
* cfg.mk (_autogen): Likewise.
Reported by Matthias Bolte.
---
That took a lot longer to fix than I originally expected. But I
think this patch fixes the libvirt side of things, so that make
will properly rerun autogen when the .gnulib submodule changes.
Thanks again to Matthias for boiling it down to a reproducible step.
And now I'm off to figure out whether gnulib's bootstrap script could
do a better job of deleting any generated headers that might be
rendered invalid by an update in gnulib modules.
autogen.sh | 2 +-
cfg.mk | 6 +++++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/autogen.sh b/autogen.sh
index a618d86..2f5b42d 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -75,7 +75,7 @@ bootstrap_hash()
# Ensure that whenever we pull in a gnulib update or otherwise change to a
# different version (i.e., when switching branches), we also rerun ./bootstrap.
curr_status=.git-module-status
-t=$(bootstrap_hash)
+t=$(bootstrap_hash; git diff .gnulib)
if test "$t" = "$(cat $curr_status 2>/dev/null)"; then
: # good, it's up to date, all we need is autoreconf
autoreconf -if
diff --git a/cfg.mk b/cfg.mk
index b6b2530..74fe5ed 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -294,7 +294,8 @@ ifeq (0,$(MAKELEVEL))
_submodule_hash = sed 's/^[ +-]//;s/ .*//'
_update_required := $(shell \
actual=$$(git submodule status | $(_submodule_hash); \
- git hash-object bootstrap.conf); \
+ git hash-object bootstrap.conf; \
+ git diff .gnulib); \
stamp="$$($(_submodule_hash) $(_curr_status) 2>/dev/null)"; \
test "$$stamp" = "$$actual"; echo $$?)
ifeq (1,$(_update_required))
@@ -303,9 +304,12 @@ Makefile: _autogen
endif
endif
+# It is necessary to call autogen any time gnulib changes. Autogen
+# reruns configure, then we regenerate all Makefiles at once.
.PHONY: _autogen
_autogen:
$(srcdir)/autogen.sh
+ ./config.status
# Exempt @...@ uses of these symbols.
_makefile_at_at_check_exceptions = ' && !/(SCHEMA|SYSCONF)DIR/'
--
1.6.6.1