bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bootstrap bug with tests directory


From: Eric Blake
Subject: bootstrap bug with tests directory
Date: Mon, 24 Jan 2011 16:49:51 -0700
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.7

I'm not sure where to look, but I'm seeing some weird behavior with
gnulib's bootstrap script as used by libvirt.  I don't think the
automake version is relevant; Serge Hallyn originally reported it to me,
but I've reproduced it with both automake 1.9.6 and automake 1.11.1.
Since the problem occurs when re-running ./bootstrap, I'm reporting it here.

Libvirt uses a gnulib submodule named .gnulib, and among other things,
it uses gnulib/tests/ as the directory for storing all tests built by
gnulib-tool --with-tests.  This means that bootstrap output includes the
following lines:

> ./bootstrap: ./gnulib/gnulib-tool  --import ... --tests-base 
> ._bootmp/gnulib/tests ...
> ...
> Creating ._bootmp/gnulib/tests/Makefile.am
> ...
>   - invoke gl_INIT in ./configure.ac.
> ./bootstrap: cp ._bootmp/gnulib/tests/Makefile.am gnulib/tests/Makefile.am # 
> with edits
> ...
> ./bootstrap: automake --add-missing --copy --force-missing ...

after bootstrap completes:

$ grep -A3 '^AM_C' gnulib/tests/Makefile.{am,in}
gnulib/tests/Makefile.am:AM_CPPFLAGS = \
gnulib/tests/Makefile.am-  address@hidden@=1 \
gnulib/tests/Makefile.am-  -I. -I$(srcdir) \
gnulib/tests/Makefile.am-  -I../../.. -I$(srcdir)/../../.. \
--
gnulib/tests/Makefile.in:AM_CPPFLAGS = \
gnulib/tests/Makefile.in-  address@hidden@=1 \
gnulib/tests/Makefile.in-  -I. -I$(srcdir) \
gnulib/tests/Makefile.in-  -I../../.. -I$(srcdir)/../../.. \

Oops - the Makefile.in still thinks everything is relative to 3 levels
up (true for the temporary ._bootmp/, but false for the final level).
But even stranger, gnulib/tests/Makefile.am was correct, as evidenced by
further doing:

$ automake gnulib/tests/Makefile
$ grep -A3 '^AM_C' gnulib/tests/Makefile.in
AM_CPPFLAGS = \
  address@hidden@=1 \
  -I. -I$(srcdir) \
  -I../.. -I$(srcdir)/../.. \

I have no idea why only gnulib/tests/Makefile.in appears to be corrupted
by running ./bootstrap, however, I can confirm that
gnulib/tests/Makefile.am is the only file that refers to ../../ in the
first place.

<time elapses>

Hmm, maybe I just found something - libvirt has this function in
bootstrap.conf:

  # Change paths in gnulib/tests/Makefile.am from "../../.." to "../..".
  m=gnulib/tests/Makefile.am
  sed 's,\.\./\.\./\.\.,../..,g' $m > $m-t
  mv -f $m-t $m

which takes place after the initial automake run.  Is the bug that
gnulib-tool outputs relative paths, and then bootstrap changes the
relative directory structure which breaks those paths?  That is, should
gnulib-tool be outputting $(top_builddir)/._bootmp/lib, rather than
../../.., which then gets post-processed by ./bootstrap to get rid of
._bootmp?  Or is the bug that libvirt's epilogue script is not rerunning
automake after touching Makefile.am, and depending on how fast things
ran, this puts timestamps out of whack?  It seems like the fact that
libvirt even has to provide this rewrite rule is awkward - is there any
reason that the slurp() function in ./bootstrap must continue to import
files into the wrong hierarchy and then try to move them into place?

-- 
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]