[libvirt] [PATCH] use gnulib via a submodule

Please NOTE: do not apply the changes below. They are incomplete because I've removed all the boring, repetitive parts. If you want to apply something, use this: http://meyering.net/code/tmp/libvirt-submodule.patch.bz2 For an overall summary of the process of hooking up gnulib as a submodule, see the long commit log for 5/7, below: Subject: [PATCH 5/7] make .gnulib a submodule I'm not sure all of 1/7 is welcome, but at least the silent-rules part seems in line with what people here like, considering that mylibtool does something similar. With this, you might be comfortable removing mylibtool. Jim
From 41e0b6942648065dcf00e9aee3f961297464a336 Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyering@redhat.com> Date: Mon, 6 Jul 2009 19:06:00 +0200 Subject: [PATCH 1/7] configure.in: use automake-1.11
--- configure.in | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/configure.in b/configure.in index 29c8867..1170958 100644 --- a/configure.in +++ b/configure.in @@ -5,7 +5,8 @@ AC_CONFIG_SRCDIR([src/libvirt.c]) AC_CONFIG_AUX_DIR([build-aux]) AM_CONFIG_HEADER([config.h]) dnl Make automake keep quiet about wildcards & other GNUmake-isms -AM_INIT_AUTOMAKE([-Wno-portability]) +AM_INIT_AUTOMAKE([1.11 color-tests parallel-tests -Wno-portability]) +AM_SILENT_RULES([yes]) # make --enable-silent-rules the default. AC_CANONICAL_HOST LIBVIRT_MAJOR_VERSION=`echo $VERSION | awk -F. '{print $1}'` -- 1.6.3.3.524.g8586b
From d73c9fc35bdcac3c1f8b24cad226fc879325d3c2 Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyering@redhat.com> Date: Mon, 6 Jul 2009 18:23:44 +0200 Subject: [PATCH 2/7] * Makefile.cfg: Rename to...
* cfg.mk: ...this. New file. --- Makefile.cfg => cfg.mk | 0 1 files changed, 0 insertions(+), 0 deletions(-) rename Makefile.cfg => cfg.mk (100%) diff --git a/Makefile.cfg b/cfg.mk similarity index 100% rename from Makefile.cfg rename to cfg.mk -- 1.6.3.3.524.g8586b
From 1cacbc7f4c883f763606e0bed36bd8d149add0d9 Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyering@redhat.com> Date: Mon, 6 Jul 2009 18:28:10 +0200 Subject: [PATCH 3/7] Prepare to use maint.mk from gnulib
Since Makefile.maint will soon come from gnulib's maint.mk, sync Makefile.maint to have the same contents (modulo minor things). In syncing it, we have to remove some libvirt-specific rules. Since we want to keep them (of course), put those in cfg.mk. * Makefile.maint: Merge from gnulib's maint.mk. * cfg.mk (sc_avoid_write): New rule. From Makefile.cfg. (sc_prohibit_strcmp_and_strncmp): Likewise, and rename. (sc_prohibit_asprintf, sc_prohibit_VIR_ERR_NO_MEMORY): Likewise. (sc_prohibit_nonreentrant): Likewise. (sc_prohibit_ctype_h): Likewise. (sc_TAB_in_indentation, sc_avoid_ctype_macros): Likewise. (sc_prohibit_virBufferAdd_with_string_literal): Likewise. (sc_prohibit_gethostby): Likewise. (sc_libvirt_unmarked_diagnostics): Likewise. Also, rename the rule, inserting "_libvirt", since this rule is a specialization of the one in gnulib. * GNUmakefile: Include cfg.mk, not Makefile.cfg * .x-sc_prohibit_strcmp_and_strncmp: New file. * Makefile.am (EXTRA_DIST): Add .x-sc_prohibit_strcmp_and_strncmp . --- .x-sc_prohibit_strcmp_and_strncmp | 1 + GNUmakefile | 4 +- Makefile.am | 1 + Makefile.maint | 734 +++++++++++++++++-------------------- cfg.mk | 163 ++++++++ 5 files changed, 505 insertions(+), 398 deletions(-) create mode 100644 .x-sc_prohibit_strcmp_and_strncmp diff --git a/.x-sc_prohibit_strcmp_and_strncmp b/.x-sc_prohibit_strcmp_and_strncmp new file mode 100644 index 0000000..b7c456e --- /dev/null +++ b/.x-sc_prohibit_strcmp_and_strncmp @@ -0,0 +1 @@ +^gnulib/ diff --git a/GNUmakefile b/GNUmakefile index 157f432..e6d4178 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -40,7 +40,7 @@ export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner include Makefile -include $(srcdir)/Makefile.cfg +include $(srcdir)/cfg.mk include $(srcdir)/Makefile.maint else diff --git a/Makefile.am b/Makefile.am index 681034a..dd98ff2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -16,6 +16,7 @@ EXTRA_DIST = \ .x-sc_avoid_if_before_free \ .x-sc_require_config_h_first \ .x-sc_prohibit_strcmp \ + .x-sc_prohibit_strcmp_and_strncmp \ .x-sc_require_config_h \ .x-sc_prohibit_nonreentrant \ Makefile.nonreentrant \ ... -- 1.6.3.3.524.g8586b
From a4b10833246264377c9c0c99a0178c3e9b6af0f7 Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyering@redhat.com> Date: Mon, 6 Jul 2009 19:17:06 +0200 Subject: [PATCH 4/7] skip some of gnulib's new rules
* cfg.mk (local-checks-to-skip): Add these: sc_error_message_uppercase, sc_program_name, sc_require_test_exit_idiom, sc_makefile_check. --- cfg.mk | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/cfg.mk b/cfg.mk index 3c9feb6..35bedd1 100644 --- a/cfg.mk +++ b/cfg.mk @@ -52,6 +52,10 @@ local-checks-to-skip = \ sc_system_h_headers \ sc_tight_scope \ sc_two_space_separator_in_usage \ + sc_error_message_uppercase \ + sc_program_name \ + sc_require_test_exit_idiom \ + sc_makefile_check \ sc_useless_cpp_parens useless_free_options = \ -- 1.6.3.3.524.g8586b
From 856172836da7f639323702aff67489e9a74d47d5 Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyering@redhat.com> Date: Tue, 7 Jul 2009 11:22:52 +0200 Subject: [PATCH 5/7] make .gnulib a submodule
This makes it so we record (via a git submodule) a snapshot of whatever version of gnulib we're using, and none of gnulib sources are in the libvirt repository. The result is that we have as much reproducibility as when we version-controlled imported copies of the gnulib sources, but without the hassle of the manual process we used when syncing with upstream. Note that when you clone libvirt, you get only the libvirt repository, but when you first run ./bootstrap, it clones gnulib (at the SHA1 recorded via the submodule), creating the .gnulib/ hierarchy. Then, the bootstrap script runs gnulib-tool to populate gnulib/ with the files that make up the selected modules. Put the following in your ~/.gitconfig file. [alias] syncsub = submodule foreach git pull origin master The update procedure is simple: git syncsub ...build & test... git commit -m 'gnulib: sync submodule to latest' .gnulib * .gitmodules: New file. * .gnulib: Initialize. * bootstrap: Set up to use the new submodule. Stop using --no-vc-files. Don't remove .gitignore files. Don't use or create .cvsignore. Diagnose an invalid --gnulib-srcdir=DIR argument. * build-aux/vc-list-files: Delete file, now pulled from gnulib. * build-aux/useless-if-before-free: Likewise. * po/POTFILES.in: Remove gnulib/lib/gai_strerror.c, since it no longer contains translatable strings. * gnulib/*: Remove gnulib/ hierarchy. --- .gitignore | 1 + .gitmodules | 3 + .gnulib | 1 + bootstrap | 45 +- build-aux/useless-if-before-free | 180 -- build-aux/vc-list-files | 107 - gnulib/lib/.cvsignore | 26 - gnulib/lib/.gitignore | 26 - gnulib/lib/Makefile.am | 1241 -------- gnulib/lib/alloca.c | 489 ---- gnulib/lib/alloca.in.h | 56 - gnulib/lib/arpa/.cvsignore | 1 - gnulib/lib/arpa/.gitignore | 1 - gnulib/lib/arpa_inet.in.h | 90 - ... diff --git a/.gitignore b/.gitignore index ca73a98..964580c 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,4 @@ stamp-h stamp-h.in stamp-h1 update.log +tests/*.log diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..7acb1ea --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "gnulib"] + path = .gnulib + url = git://git.sv.gnu.org/gnulib.git diff --git a/.gnulib b/.gnulib new file mode 160000 index 0000000..1203e8d --- /dev/null +++ b/.gnulib @@ -0,0 +1 @@ +Subproject commit 1203e8d1f62dec3d2436dffadd5c20793cf84366 diff --git a/bootstrap b/bootstrap index baf52e7..7ce28da 100755 --- a/bootstrap +++ b/bootstrap @@ -40,25 +40,31 @@ do esac done -cleanup_gnulib() { - st=$? - rm -fr .gnulib - exit $st -} +# Get gnulib files. case ${GNULIB_SRCDIR--} in -) - if [ ! -d .gnulib ]; then + echo "$0: getting gnulib files..." + git submodule init || exit $? + git submodule update || exit $? + GNULIB_SRCDIR=.gnulib + ;; +*) + # Redirect the gnulib submodule to the directory on the command line + # if possible. + if test -d "$GNULIB_SRCDIR"/.git && \ + git config --file .gitmodules submodule.gnulib.url >/dev/null; then + git submodule init + GNULIB_SRCDIR=`cd $GNULIB_SRCDIR && pwd` + git config --replace-all submodule.gnulib.url $GNULIB_SRCDIR echo "$0: getting gnulib files..." - - trap cleanup_gnulib 1 2 13 15 - - git clone --depth 1 git://git.sv.gnu.org/gnulib .gnulib || - cleanup_gnulib - - trap - 1 2 13 15 + git submodule update || exit $? + GNULIB_SRCDIR=.gnulib + else + echo >&2 "$0: invalid gnulib srcdir: $GNULIB_SRCDIR" + exit 1 fi - GNULIB_SRCDIR=.gnulib + ;; esac gnulib_tool=$GNULIB_SRCDIR/gnulib-tool @@ -103,20 +109,9 @@ vc-list-files # put *.[ch] files in new gnulib/lib/ dir. $gnulib_tool \ - --no-vc-files \ --lgpl=2 \ --with-tests \ --m4-base=gnulib/m4 \ --source-base=gnulib/lib \ --tests-base=gnulib/tests \ --import $modules - -rm -f \ - .gitignore \ - gnulib/lib/.gitignore \ - gnulib/m4/.gitignore \ - gnulib/tests/.gitignore - -(cd gnulib/lib && - (cat .cvsignore; \ - ls -1 *.in.h|sed 's/\.in\.h/.h/') | sort -u > .t; mv .t .cvsignore) diff --git a/po/POTFILES.in b/po/POTFILES.in index 973f580..357cd70 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -1,4 +1,3 @@ -gnulib/lib/gai_strerror.c qemud/qemud.c qemud/remote.c src/bridge.c ... -- 1.6.3.3.524.g8586b
From ab811737a6914133bf12a46d4c5b5a2a2bdd9ee9 Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyering@redhat.com> Date: Tue, 7 Jul 2009 12:05:18 +0200 Subject: [PATCH 6/7] remove all .cvsignore files
--- .cvsignore | 34 ------------------------- build-aux/.cvsignore | 10 ------- build-aux/.gitignore | 2 + docs/.cvsignore | 4 --- docs/devhelp/.cvsignore | 3 -- docs/examples/.cvsignore | 7 ----- docs/examples/python/.cvsignore | 2 - docs/schemas/.cvsignore | 2 - examples/domain-events/events-c/.cvsignore | 6 ---- examples/hellolibvirt/.cvsignore | 5 ---- include/.cvsignore | 2 - include/libvirt/.cvsignore | 2 - m4/.cvsignore | 37 ---------------------------- po/.cvsignore | 15 ----------- proxy/.cvsignore | 5 ---- python/.cvsignore | 15 ----------- python/tests/.cvsignore | 2 - qemud/.cvsignore | 12 --------- src/.cvsignore | 20 --------------- tests/.cvsignore | 28 --------------------- tests/confdata/.cvsignore | 2 - tests/sexpr2xmldata/.cvsignore | 2 - tests/xencapsdata/.cvsignore | 2 - tests/xmconfigdata/.cvsignore | 2 - tests/xml2sexprdata/.cvsignore | 2 - tools/.cvsignore | 4 --- 26 files changed, 2 insertions(+), 225 deletions(-) ... -- 1.6.3.3.524.g8586b
From b718b0763f8fbfc35af586fa6d132d39259d0e11 Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyering@redhat.com> Date: Tue, 7 Jul 2009 18:08:45 +0200 Subject: [PATCH 7/7] use gnumakefile and maintainer-makefile modules from gnulib
* bootstrap (modules): Add gnumakefile and maintainer-makefile. * GNUmakefile: Remove file, now provided by gnulib. * Makefile.maint: Remove. Replaced by maint.mk from gnulib. .gitignore: Add GNUmakefile and maint.mk. * cfg.mk (prev_version_file): Disable this feature. Setting this to /dev/null avoids an otherwise harmless diagnostic. --- .gitignore | 2 + GNUmakefile | 60 ----- Makefile.maint | 770 -------------------------------------------------------- bootstrap | 2 + cfg.mk | 3 + 5 files changed, 7 insertions(+), 830 deletions(-) delete mode 100644 GNUmakefile delete mode 100644 Makefile.maint ... diff --git a/bootstrap b/bootstrap index 7ce28da..b0de3df 100755 --- a/bootstrap +++ b/bootstrap @@ -78,8 +78,10 @@ getaddrinfo gethostname getpass gettext +gnumakefile inet_pton ioctl +maintainer-makefile mkstemp mktempd perror diff --git a/cfg.mk b/cfg.mk index 35bedd1..736f7c0 100644 --- a/cfg.mk +++ b/cfg.mk @@ -227,3 +227,6 @@ sc_libvirt_unmarked_diagnostics: | grep '[ ]"' && \ { echo '$(ME): found unmarked diagnostic(s)' 1>&2; \ exit 1; } || : + +# We don't use this feature of maint.mk. +prev_version_file = /dev/null -- 1.6.3.3.524.g8586b

Jim Meyering wrote:
Please NOTE: do not apply the changes below. They are incomplete because I've removed all the boring, repetitive parts. If you want to apply something, use this:
By the way, for those new to git, in order to apply and try out the patch above, you could do this: $ git co master $ git co -b $(date +%j)-gnulib Switched to a new branch '189-gnulib' $ curl http://meyering.net/code/tmp/libvirt-submodule.patch.bz2 \ | bzip2 -dc | git am Applying: configure.in: use automake-1.11 Applying: * Makefile.cfg: Rename to... Applying: Prepare to use maint.mk from gnulib Applying: skip some of gnulib's new rules Applying: make .gnulib a submodule Applying: remove all .cvsignore files Applying: use gnumakefile and maintainer-makefile modules from gnulib $ ./bootstrap && ./autogen.sh && make ... etc.

On Tue, Jul 07, 2009 at 07:02:08PM +0200, Jim Meyering wrote:
diff --git a/configure.in b/configure.in index 29c8867..1170958 100644 --- a/configure.in +++ b/configure.in @@ -5,7 +5,8 @@ AC_CONFIG_SRCDIR([src/libvirt.c]) AC_CONFIG_AUX_DIR([build-aux]) AM_CONFIG_HEADER([config.h]) dnl Make automake keep quiet about wildcards & other GNUmake-isms -AM_INIT_AUTOMAKE([-Wno-portability]) +AM_INIT_AUTOMAKE([1.11 color-tests parallel-tests -Wno-portability]) +AM_SILENT_RULES([yes]) # make --enable-silent-rules the default. AC_CANONICAL_HOST
We can't include this one, since we need to be able to work with automake on RHEL-5.
From 856172836da7f639323702aff67489e9a74d47d5 Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyering@redhat.com> Date: Tue, 7 Jul 2009 11:22:52 +0200 Subject: [PATCH 5/7] make .gnulib a submodule
This makes it so we record (via a git submodule) a snapshot of whatever version of gnulib we're using, and none of gnulib sources are in the libvirt repository. The result is that we have as much reproducibility as when we version-controlled imported copies of the gnulib sources, but without the hassle of the manual process we used when syncing with upstream.
Note that when you clone libvirt, you get only the libvirt repository, but when you first run ./bootstrap, it clones gnulib (at the SHA1 recorded via the submodule), creating the .gnulib/ hierarchy. Then, the bootstrap script runs gnulib-tool to populate gnulib/ with the files that make up the selected modules.
I think perhaps we should wire this into the autogen.sh script. People are used to just cloning a repository and running autogen.sh to get things setup, so it would cause unneccessary confusion to also require them to run bootstrap seprately.
* bootstrap (modules): Add gnumakefile and maintainer-makefile. * GNUmakefile: Remove file, now provided by gnulib. * Makefile.maint: Remove. Replaced by maint.mk from gnulib. .gitignore: Add GNUmakefile and maint.mk. * cfg.mk (prev_version_file): Disable this feature. Setting this to /dev/null avoids an otherwise harmless diagnostic.
We have a few custom non-gnulib rules in Makefile.maint, for checking use of non-reentrant safe functions, and banning use of asprintf() in favour of virAsprintf(). Is there a good place to hook those into the stock gnulib Makefile.maint. Perhaps we could just abuse Makefile.cfg for this since its included anyway? Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

Daniel P. Berrange wrote:
On Tue, Jul 07, 2009 at 07:02:08PM +0200, Jim Meyering wrote:
diff --git a/configure.in b/configure.in index 29c8867..1170958 100644 --- a/configure.in +++ b/configure.in @@ -5,7 +5,8 @@ AC_CONFIG_SRCDIR([src/libvirt.c]) AC_CONFIG_AUX_DIR([build-aux]) AM_CONFIG_HEADER([config.h]) dnl Make automake keep quiet about wildcards & other GNUmake-isms -AM_INIT_AUTOMAKE([-Wno-portability]) +AM_INIT_AUTOMAKE([1.11 color-tests parallel-tests -Wno-portability]) +AM_SILENT_RULES([yes]) # make --enable-silent-rules the default. AC_CANONICAL_HOST
We can't include this one, since we need to be able to work with automake on RHEL-5.
Agreed.
From 856172836da7f639323702aff67489e9a74d47d5 Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyering@redhat.com> Date: Tue, 7 Jul 2009 11:22:52 +0200 Subject: [PATCH 5/7] make .gnulib a submodule
This makes it so we record (via a git submodule) a snapshot of whatever version of gnulib we're using, and none of gnulib sources are in the libvirt repository. The result is that we have as much reproducibility as when we version-controlled imported copies of the gnulib sources, but without the hassle of the manual process we used when syncing with upstream.
Note that when you clone libvirt, you get only the libvirt repository, but when you first run ./bootstrap, it clones gnulib (at the SHA1 recorded via the submodule), creating the .gnulib/ hierarchy. Then, the bootstrap script runs gnulib-tool to populate gnulib/ with the files that make up the selected modules.
I think perhaps we should wire this into the autogen.sh script. People are used to just cloning a repository and running autogen.sh to get things setup, so it would cause unneccessary confusion to also require them to run bootstrap seprately.
Fine. Will adapt.
* bootstrap (modules): Add gnumakefile and maintainer-makefile. * GNUmakefile: Remove file, now provided by gnulib. * Makefile.maint: Remove. Replaced by maint.mk from gnulib. .gitignore: Add GNUmakefile and maint.mk. * cfg.mk (prev_version_file): Disable this feature. Setting this to /dev/null avoids an otherwise harmless diagnostic.
We have a few custom non-gnulib rules in Makefile.maint, for checking use of non-reentrant safe functions, and banning use of asprintf() in favour of virAsprintf(). Is there a good place to hook those into the stock gnulib Makefile.maint. Perhaps we could just abuse Makefile.cfg for this since its included anyway?
One of those patches moved them into cfg.mk, which is the new name for Makefile.cfg. [ Since GNUmakefile is now provided by gnulib, and maint.mk/cfg.mk are the names it uses ]

Daniel P. Berrange wrote: ...
From: Jim Meyering <meyering@redhat.com> Date: Tue, 7 Jul 2009 11:22:52 +0200 Subject: [PATCH 5/7] make .gnulib a submodule
This makes it so we record (via a git submodule) a snapshot of whatever version of gnulib we're using, and none of gnulib sources are in the libvirt repository. The result is that we have as much reproducibility as when we version-controlled imported copies of the gnulib sources, but without the hassle of the manual process we used when syncing with upstream.
Note that when you clone libvirt, you get only the libvirt repository, but when you first run ./bootstrap, it clones gnulib (at the SHA1 recorded via the submodule), creating the .gnulib/ hierarchy. Then, the bootstrap script runs gnulib-tool to populate gnulib/ with the files that make up the selected modules.
I think perhaps we should wire this into the autogen.sh script. People are used to just cloning a repository and running autogen.sh to get things setup, so it would cause unneccessary confusion to also require them to run bootstrap seprately.
One reason not to do this (at least not unconditionally) is that it takes pretty long. I've just timed it at 31 seconds, even though everything is already downloaded. That happens to be the same duration (to the second!) of the existing ./autogen.sh script.

On Wed, Jul 08, 2009 at 12:58:11PM +0200, Jim Meyering wrote:
Daniel P. Berrange wrote: ...
From: Jim Meyering <meyering@redhat.com> Date: Tue, 7 Jul 2009 11:22:52 +0200 Subject: [PATCH 5/7] make .gnulib a submodule
This makes it so we record (via a git submodule) a snapshot of whatever version of gnulib we're using, and none of gnulib sources are in the libvirt repository. The result is that we have as much reproducibility as when we version-controlled imported copies of the gnulib sources, but without the hassle of the manual process we used when syncing with upstream.
Note that when you clone libvirt, you get only the libvirt repository, but when you first run ./bootstrap, it clones gnulib (at the SHA1 recorded via the submodule), creating the .gnulib/ hierarchy. Then, the bootstrap script runs gnulib-tool to populate gnulib/ with the files that make up the selected modules.
I think perhaps we should wire this into the autogen.sh script. People are used to just cloning a repository and running autogen.sh to get things setup, so it would cause unneccessary confusion to also require them to run bootstrap seprately.
One reason not to do this (at least not unconditionally) is that it takes pretty long. I've just timed it at 31 seconds, even though everything is already downloaded. That happens to be the same duration (to the second!) of the existing ./autogen.sh script.
I was thinking that you'd only do it if you hadn't already pulled the gnulib sub-module, or if it was out of date. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

Daniel P. Berrange wrote:
On Wed, Jul 08, 2009 at 12:58:11PM +0200, Jim Meyering wrote:
Daniel P. Berrange wrote: ...
From: Jim Meyering <meyering@redhat.com> Date: Tue, 7 Jul 2009 11:22:52 +0200 Subject: [PATCH 5/7] make .gnulib a submodule
This makes it so we record (via a git submodule) a snapshot of whatever version of gnulib we're using, and none of gnulib sources are in the libvirt repository. The result is that we have as much reproducibility as when we version-controlled imported copies of the gnulib sources, but without the hassle of the manual process we used when syncing with upstream.
Note that when you clone libvirt, you get only the libvirt repository, but when you first run ./bootstrap, it clones gnulib (at the SHA1 recorded via the submodule), creating the .gnulib/ hierarchy. Then, the bootstrap script runs gnulib-tool to populate gnulib/ with the files that make up the selected modules.
I think perhaps we should wire this into the autogen.sh script. People are used to just cloning a repository and running autogen.sh to get things setup, so it would cause unneccessary confusion to also require them to run bootstrap seprately.
One reason not to do this (at least not unconditionally) is that it takes pretty long. I've just timed it at 31 seconds, even though everything is already downloaded. That happens to be the same duration (to the second!) of the existing ./autogen.sh script.
I was thinking that you'd only do it if you hadn't already pulled the gnulib sub-module, or if it was out of date.
One situation in which it must be run is e.g., right after the initial clone, when is when .gnulib/ does not exist. Or after someone removes .gnulib manually. ./bootstrap must also be run any time you change (or pulling the latest changes) the list of selected gnulib modules or gnulib-tool options. Likewise, if you pull a change that selects a newer version of .gnulib (updates libvirt to use a newer gnulib snapshot), you'll have to run it. There's probably a way to automate all of that, but I haven't tried.

On Tue, Jul 07, 2009 at 07:02:08PM +0200, Jim Meyering wrote:
@@ -5,7 +5,8 @@ AC_CONFIG_SRCDIR([src/libvirt.c]) AC_CONFIG_AUX_DIR([build-aux]) AM_CONFIG_HEADER([config.h]) dnl Make automake keep quiet about wildcards & other GNUmake-isms -AM_INIT_AUTOMAKE([-Wno-portability]) +AM_INIT_AUTOMAKE([1.11 color-tests parallel-tests -Wno-portability]) +AM_SILENT_RULES([yes]) # make --enable-silent-rules the default. AC_CANONICAL_HOST
Actually an alternative idea - don't add a hard pre-requisite on 1.11. Instead just add a m4_ifndef([AM_SILENT_RULES], [m4_define([AM_SILENT_RULES],[])]) ie, just provide a no-op AM_SILENT_RULES for older automake. Then we can just throw out 'mylibtool'. People with new enough automake will get the silent build support, and we can still have compatability with older automake for RHEL-5 albeit without silent build support. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

Daniel P. Berrange wrote:
On Tue, Jul 07, 2009 at 07:02:08PM +0200, Jim Meyering wrote:
@@ -5,7 +5,8 @@ AC_CONFIG_SRCDIR([src/libvirt.c]) AC_CONFIG_AUX_DIR([build-aux]) AM_CONFIG_HEADER([config.h]) dnl Make automake keep quiet about wildcards & other GNUmake-isms -AM_INIT_AUTOMAKE([-Wno-portability]) +AM_INIT_AUTOMAKE([1.11 color-tests parallel-tests -Wno-portability]) +AM_SILENT_RULES([yes]) # make --enable-silent-rules the default. AC_CANONICAL_HOST
Actually an alternative idea - don't add a hard pre-requisite on 1.11. Instead just add a
m4_ifndef([AM_SILENT_RULES], [m4_define([AM_SILENT_RULES],[])])
ie, just provide a no-op AM_SILENT_RULES for older automake. Then we can just throw out 'mylibtool'. People with new enough automake will get the silent build support, and we can still have compatability with older automake for RHEL-5 albeit without silent build support.
I like that.
From a0aeb1abb35968e68a547d6ccca6109845c3a7c6 Mon Sep 17 00:00:00 2001 From: Jim Meyering <jim@meyering.net> Date: Wed, 8 Jul 2009 11:51:59 +0200 Subject: [PATCH] use automake-1.11's silent-rules option, when possible
Don't use mylibtool, (subsumed by automake's silent rules) Its use was causing a non-srcdir build to fail. * Makefile.am (EXTRA_DIST): Remove mylibtool. * configure.in: Don't use mylibtool. * configure.in: Use AM_SILENT_RULES([yes]), but only if that m4 macro is defined. Thus, it works even on systems that lack automake-1.11. Daniel Berrange suggested adding the conditional, so that we don't have a hard requirement on 1.11, e.g., for RHEL5. --- Makefile.am | 3 +-- configure.in | 9 +++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile.am b/Makefile.am index f874325..f9efff5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -21,8 +21,7 @@ EXTRA_DIST = \ .x-sc_require_config_h \ .x-sc_prohibit_nonreentrant \ Makefile.nonreentrant \ - autogen.sh \ - mylibtool + autogen.sh man_MANS = virsh.1 diff --git a/configure.in b/configure.in index 29c8867..552089a 100644 --- a/configure.in +++ b/configure.in @@ -6,6 +6,11 @@ AC_CONFIG_AUX_DIR([build-aux]) AM_CONFIG_HEADER([config.h]) dnl Make automake keep quiet about wildcards & other GNUmake-isms AM_INIT_AUTOMAKE([-Wno-portability]) + +# Use the silent-rules feature when possible. +m4_ifndef([AM_SILENT_RULES], [m4_define([AM_SILENT_RULES],[])]) +AM_SILENT_RULES([yes]) + AC_CANONICAL_HOST LIBVIRT_MAJOR_VERSION=`echo $VERSION | awk -F. '{print $1}'` @@ -58,10 +63,6 @@ dnl Support building Win32 DLLs (must appear *before* AM_PROG_LIBTOOL) AC_LIBTOOL_WIN32_DLL AM_PROG_LIBTOOL -dnl Override normal libtool in favour of our quiet version -LIBTOOL='$(SHELL) $(top_srcdir)/mylibtool' -AC_SUBST([LIBTOOL]) - AM_PROG_CC_C_O VERSION_SCRIPT_FLAGS=-Wl,--version-script= -- 1.6.3.3.524.g8586b

On Wed, Jul 08, 2009 at 03:54:07PM +0200, Jim Meyering wrote:
Daniel P. Berrange wrote:
On Tue, Jul 07, 2009 at 07:02:08PM +0200, Jim Meyering wrote:
@@ -5,7 +5,8 @@ AC_CONFIG_SRCDIR([src/libvirt.c]) AC_CONFIG_AUX_DIR([build-aux]) AM_CONFIG_HEADER([config.h]) dnl Make automake keep quiet about wildcards & other GNUmake-isms -AM_INIT_AUTOMAKE([-Wno-portability]) +AM_INIT_AUTOMAKE([1.11 color-tests parallel-tests -Wno-portability]) +AM_SILENT_RULES([yes]) # make --enable-silent-rules the default. AC_CANONICAL_HOST
Actually an alternative idea - don't add a hard pre-requisite on 1.11. Instead just add a
m4_ifndef([AM_SILENT_RULES], [m4_define([AM_SILENT_RULES],[])])
ie, just provide a no-op AM_SILENT_RULES for older automake. Then we can just throw out 'mylibtool'. People with new enough automake will get the silent build support, and we can still have compatability with older automake for RHEL-5 albeit without silent build support.
I like that.
From a0aeb1abb35968e68a547d6ccca6109845c3a7c6 Mon Sep 17 00:00:00 2001 From: Jim Meyering <jim@meyering.net> Date: Wed, 8 Jul 2009 11:51:59 +0200 Subject: [PATCH] use automake-1.11's silent-rules option, when possible
Don't use mylibtool, (subsumed by automake's silent rules) Its use was causing a non-srcdir build to fail. * Makefile.am (EXTRA_DIST): Remove mylibtool. * configure.in: Don't use mylibtool.
* configure.in: Use AM_SILENT_RULES([yes]), but only if that m4 macro is defined. Thus, it works even on systems that lack automake-1.11. Daniel Berrange suggested adding the conditional, so that we don't have a hard requirement on 1.11, e.g., for RHEL5. --- Makefile.am | 3 +-- configure.in | 9 +++++---- 2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/Makefile.am b/Makefile.am index f874325..f9efff5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -21,8 +21,7 @@ EXTRA_DIST = \ .x-sc_require_config_h \ .x-sc_prohibit_nonreentrant \ Makefile.nonreentrant \ - autogen.sh \ - mylibtool + autogen.sh
man_MANS = virsh.1
diff --git a/configure.in b/configure.in index 29c8867..552089a 100644 --- a/configure.in +++ b/configure.in @@ -6,6 +6,11 @@ AC_CONFIG_AUX_DIR([build-aux]) AM_CONFIG_HEADER([config.h]) dnl Make automake keep quiet about wildcards & other GNUmake-isms AM_INIT_AUTOMAKE([-Wno-portability]) + +# Use the silent-rules feature when possible. +m4_ifndef([AM_SILENT_RULES], [m4_define([AM_SILENT_RULES],[])]) +AM_SILENT_RULES([yes]) + AC_CANONICAL_HOST
LIBVIRT_MAJOR_VERSION=`echo $VERSION | awk -F. '{print $1}'` @@ -58,10 +63,6 @@ dnl Support building Win32 DLLs (must appear *before* AM_PROG_LIBTOOL) AC_LIBTOOL_WIN32_DLL
AM_PROG_LIBTOOL -dnl Override normal libtool in favour of our quiet version -LIBTOOL='$(SHELL) $(top_srcdir)/mylibtool' -AC_SUBST([LIBTOOL]) - AM_PROG_CC_C_O
VERSION_SCRIPT_FLAGS=-Wl,--version-script=
ACK, I've tested on RHEL-5, the only issue was a minor warning from aclocal, which was evidently harmless. aclocal:configure.in:12: warning: macro `AM_SILENT_RULES' not found in library Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

Daniel P. Berrange wrote: ...
Subject: [PATCH] use automake-1.11's silent-rules option, when possible
Don't use mylibtool, (subsumed by automake's silent rules) Its use was causing a non-srcdir build to fail. * Makefile.am (EXTRA_DIST): Remove mylibtool. * configure.in: Don't use mylibtool.
* configure.in: Use AM_SILENT_RULES([yes]), but only if that m4 macro is defined. Thus, it works even on systems that lack automake-1.11. Daniel Berrange suggested adding the conditional, so that we don't have a hard requirement on 1.11, e.g., for RHEL5. ... ACK, I've tested on RHEL-5, the only issue was a minor warning from aclocal, which was evidently harmless.
aclocal:configure.in:12: warning: macro `AM_SILENT_RULES' not found in library
Thanks. pushed

Jim Meyering wrote:
Daniel P. Berrange wrote: ...
Subject: [PATCH] use automake-1.11's silent-rules option, when possible
Don't use mylibtool, (subsumed by automake's silent rules) Its use was causing a non-srcdir build to fail. * Makefile.am (EXTRA_DIST): Remove mylibtool. * configure.in: Don't use mylibtool.
* configure.in: Use AM_SILENT_RULES([yes]), but only if that m4 macro is defined. Thus, it works even on systems that lack automake-1.11. Daniel Berrange suggested adding the conditional, so that we don't have a hard requirement on 1.11, e.g., for RHEL5. ... ACK, I've tested on RHEL-5, the only issue was a minor warning from aclocal, which was evidently harmless.
aclocal:configure.in:12: warning: macro `AM_SILENT_RULES' not found in library
Thanks. pushed
Just so it's clear, I've pushed this small change, http://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=b731d7830e91 not the big one implied by the first message of this thread: http://thread.gmane.org/gmane.comp.emulators.libvirt/14610 As for its 7 change-sets, I've removed 1/7, which would have introduced the hard requirement on automake-1.11. Any objection to committing the rest, 2/7..7/7 and the already-ACK'd [generate ChangeLog from git logs into distribution tarball] that depends on them? If you still want autogen.sh to invoke ./bootstrap, I can do that separately.

On Wed, Jul 08, 2009 at 05:00:44PM +0200, Jim Meyering wrote:
Jim Meyering wrote:
Thanks. pushed
Just so it's clear, I've pushed this small change,
http://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=b731d7830e91
not the big one implied by the first message of this thread: http://thread.gmane.org/gmane.comp.emulators.libvirt/14610
As for its 7 change-sets, I've removed 1/7, which would have introduced the hard requirement on automake-1.11.
Any objection to committing the rest, 2/7..7/7 and the already-ACK'd [generate ChangeLog from git logs into distribution tarball] that depends on them?
If you still want autogen.sh to invoke ./bootstrap, I can do that separately.
Fine by me, Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

Daniel Veillard wrote:
On Wed, Jul 08, 2009 at 05:00:44PM +0200, Jim Meyering wrote:
Jim Meyering wrote:
Thanks. pushed
Just so it's clear, I've pushed this small change,
http://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=b731d7830e91
not the big one implied by the first message of this thread: http://thread.gmane.org/gmane.comp.emulators.libvirt/14610
As for its 7 change-sets, I've removed 1/7, which would have introduced the hard requirement on automake-1.11.
Any objection to committing the rest, 2/7..7/7 and the already-ACK'd [generate ChangeLog from git logs into distribution tarball] that depends on them?
If you still want autogen.sh to invoke ./bootstrap, I can do that separately.
Fine by me,
Thanks. Pushed.
participants (3)
-
Daniel P. Berrange
-
Daniel Veillard
-
Jim Meyering