[libvirt] [PATCH] autogen: work around BSD toolchain snafu

With my help on IRC, Roman Bogorodskiy identified a bug where the BSD autoconf wrapper script eats stdin[1], which in turn causes autopoint from gettext 0.18.3 to fail to find AM_GNU_GETTEXT_VERSION within configure.ac[2], with this error: ./bootstrap: autopoint --force autopoint: *** Missing version: please specify in configure.ac through a line 'AM_GNU_GETTEXT_VERSION(x.yy.zz)' the gettext version the package is using [1] http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/184479 [2] http://git.sv.gnu.org/cgit/gettext.git/commit/gettext-tools/misc/autopoint.i... We found a workaround - fake the use of an intl subdirectory long enough for autopoint to get what it wants from that fallback. This workaround may eventually move upstream into gnulib's bootstrap; when it does, we can remove the hack from libvirt's autogen.sh. * autogen.sh (bootstrap): Force autopoint to work even if autom4te doesn't. Signed-off-by: Eric Blake <eblake@redhat.com> --- I tested that this doesn't fall apart on Fedora 19 when running autogen.sh (autopoint 0.18.2, no autom4te wrapper), but would like feedback from Roman that it works for his broken toolchain setup. I'd also like feedback from gnulib whether we should fold a similar fix into gnulib's bootstrap, instead of applying this patch to libvirt. autogen.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/autogen.sh b/autogen.sh index 5aa1990..31e66c0 100755 --- a/autogen.sh +++ b/autogen.sh @@ -88,9 +88,16 @@ if test -d .git || test -f .git; then echo cleaning up submodules... git submodule foreach 'git clean -dfqx && git reset --hard' fi + # work around broken BSD toolchain, where gettext 0.18.3 triggers + # a bug with the autom4te wrapper script eating stdin unless + # intl/VERSION exists, with contents comparable to configure.ac + mkdir -p intl + echo gettext-0.17 > intl/VERSION echo running bootstrap$no_git... ./bootstrap$no_git --bootstrap-sync && bootstrap_hash > $curr_status \ || { echo "Failed to bootstrap, please investigate."; exit 1; } + rm intl/VERSION + rmdir -p intl fi fi -- 1.8.3.1

Eric Blake wrote:
With my help on IRC, Roman Bogorodskiy identified a bug where the BSD autoconf wrapper script eats stdin[1], which in turn causes autopoint from gettext 0.18.3 to fail to find AM_GNU_GETTEXT_VERSION within configure.ac[2], with this error:
./bootstrap: autopoint --force autopoint: *** Missing version: please specify in configure.ac through a line 'AM_GNU_GETTEXT_VERSION(x.yy.zz)' the gettext version the package is using
[1] http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/184479 [2] http://git.sv.gnu.org/cgit/gettext.git/commit/gettext-tools/misc/autopoint.i...
We found a workaround - fake the use of an intl subdirectory long enough for autopoint to get what it wants from that fallback. This workaround may eventually move upstream into gnulib's bootstrap; when it does, we can remove the hack from libvirt's autogen.sh.
* autogen.sh (bootstrap): Force autopoint to work even if autom4te doesn't.
Signed-off-by: Eric Blake <eblake@redhat.com> ---
I tested that this doesn't fall apart on Fedora 19 when running autogen.sh (autopoint 0.18.2, no autom4te wrapper), but would like feedback from Roman that it works for his broken toolchain setup. I'd also like feedback from gnulib whether we should fold a similar fix into gnulib's bootstrap, instead of applying this patch to libvirt.
It works only when the submodule is not up to date. When running autogen.sh again it doesn't reach the 'else' clause you create intl/VERSION in, so it just runs autoreconf and fails with the same error. Also, I think we cannot do 'rmdir intl' because it's not empty (scripts copy over gettext sources there?), so it fails: rmdir: intl: Directory not empty
autogen.sh | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/autogen.sh b/autogen.sh index 5aa1990..31e66c0 100755 --- a/autogen.sh +++ b/autogen.sh @@ -88,9 +88,16 @@ if test -d .git || test -f .git; then echo cleaning up submodules... git submodule foreach 'git clean -dfqx && git reset --hard' fi + # work around broken BSD toolchain, where gettext 0.18.3 triggers + # a bug with the autom4te wrapper script eating stdin unless + # intl/VERSION exists, with contents comparable to configure.ac + mkdir -p intl + echo gettext-0.17 > intl/VERSION echo running bootstrap$no_git... ./bootstrap$no_git --bootstrap-sync && bootstrap_hash > $curr_status \ || { echo "Failed to bootstrap, please investigate."; exit 1; } + rm intl/VERSION + rmdir -p intl fi fi
-- 1.8.3.1
Roman Bogorodskiy

On 12/04/2013 01:01 AM, Roman Bogorodskiy wrote:
We found a workaround - fake the use of an intl subdirectory long enough for autopoint to get what it wants from that fallback. This workaround may eventually move upstream into gnulib's bootstrap; when it does, we can remove the hack from libvirt's autogen.sh.
It works only when the submodule is not up to date.
When running autogen.sh again it doesn't reach the 'else' clause you create intl/VERSION in, so it just runs autoreconf and fails with the same error.
Not what I was hoping to hear (and maybe gives me more incentive to set up an environment where I can reproduce the failure myself, instead of debugging remotely).
Also, I think we cannot do 'rmdir intl' because it's not empty (scripts copy over gettext sources there?), so it fails:
Hmm, I thought 'rmdir -p' would be silent for a non-empty directory; but I just confirmed that it is not. And that means that autopoint is installing files into intl on your machine - probably because more than just the AM_GNU_GETTEXT_VERSION probe failed. Ah, I see - gettext also uses autom4te to probe for AM_GNU_GETTEXT, and fails to see that we requested AM_GNU_GETTEXT([external]) and so tries to install into intl/ instead, which is what we don't want. So my attempt at a workaround is rather botched. NACK to this patch (whether in libvirt's wrapper, or in gnulib's bootstrap), and I think what I will try instead is a patch to bootstrap that fails loudly if autom4te is broken, encouraging users to install a working autom4te. Bummer that gettext hardcodes to the first 'autom4te' on PATH rather than using an ${AUTOM4TE} env-var; overriding a broken autom4te thus requires modifying PATH and sticking yet another wrapper in front of the broken autom4te version. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
participants (2)
-
Eric Blake
-
Roman Bogorodskiy