[libvirt] [PATCH] Allow bootstrap to build gnulib from local git source if $GNULIB_SRCDIR is non-empty.

'bootstrap' script clones the .gnulib submodule from upstream git sources only (provided in .gitmodules), irrespective of whether $GNULIB_SRCDIR is provided. This patch allows gnulib git sources provided by $GNULIB_SRCDIR to be used for adding the gnulib submodule.
From c5428697c4a1c34daaefaa38708bd59d3b9eefed Mon Sep 17 00:00:00 2001 From: Prerna Saxena <prerna@linux.vnet.ibm.com> Date: Mon, 9 May 2011 13:30:59 +0530 Subject: [PATCH] [Fix] Do not pull from upstream git repo if local copy of git sources is provided. Presently, gnulib gets cloned from git://git.sv.gnu.org/gnulib.git irrespective of local sources in $GNULIB_SRCDIR.
--- bootstrap | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/bootstrap b/bootstrap index 7cbb5dc..145e4cf 100755 --- a/bootstrap +++ b/bootstrap @@ -528,7 +528,7 @@ case ${GNULIB_SRCDIR--} in echo "$0: getting gnulib files..." if git submodule -h|grep -- --reference > /dev/null; then # Prefer the one-liner available in git 1.6.4 or newer. - git submodule update --init --reference "$GNULIB_SRCDIR" \ + git submodule update --reference "$GNULIB_SRCDIR" \ "$gnulib_path" || exit $? else # This fallback allows at least git 1.5.5. -- 1.7.2.5 -- Prerna Saxena Linux Technology Centre, IBM Systems and Technology Lab, Bangalore, India

On 05/09/2011 02:25 AM, Prerna Saxena wrote:
'bootstrap' script clones the .gnulib submodule from upstream git sources only (provided in .gitmodules), irrespective of whether $GNULIB_SRCDIR is provided.
Which is what we want. A local gnulib checkout is not the same as upstream gnulib, and we want to ensure that no one commits to upstream libvirt.git unless the .gnulib submodule also points to upstream gnulib.git. Otherwise, we risk the scenario that something that works for you with your local gnulib commit won't work for anyone else because your gnulib commit is not public.
This patch allows gnulib git sources provided by $GNULIB_SRCDIR to be used for adding the gnulib submodule.
NAK. GNULIB_SRCDIR is used to prime the pump - if you have a local checkout, then you don't need quite as much disk space or network usage to create your clone (your clone in .gnulib will implicitly point to your prior gnulib checkout as its reference). But you _still_ need .gnulib to be independent of your local reference repository, since it is possible that libvirt intentionally lags upstream gnulib, or that libvirt wants to use a newer upstream gnulib than what you have in your local reference repository at the moment. Furthermore, you can use: ./bootstrap --no-git --gnulib-srcdir=/path/to/local as a means of checking out the exact version of gnulib that you desire without referencing upstream gnulib.git. Finally, this patch would have to go to upstream gnulib.git, since libvirt's copy of this file is a direct clone of upstream gnulib's bootstrap. Unless you can get this accepted upstream, then libvirt should not behave differently than any other project that uses gnulib's bootstrap script. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

Hi Eric, On 05/10/2011 01:16 AM, Eric Blake wrote:
On 05/09/2011 02:25 AM, Prerna Saxena wrote:
'bootstrap' script clones the .gnulib submodule from upstream git sources only (provided in .gitmodules), irrespective of whether $GNULIB_SRCDIR is provided.
Which is what we want. A local gnulib checkout is not the same as upstream gnulib, and we want to ensure that no one commits to upstream libvirt.git unless the .gnulib submodule also points to upstream gnulib.git. Otherwise, we risk the scenario that something that works for you with your local gnulib commit won't work for anyone else because your gnulib commit is not public.
Thank you for the detailed explanation. The need for this patch arose because I was trying to build libvirt in a restrictive environment without outbound network access, and wanted to force libvirt to use the gnulib sources provided locally. However,libvirt would necessarily clone from the reference provided in $GNULIB_SRCDIR/.git/config, which happened to be git://git.sv.gnu.org/gnulib.git This patch was meant to be a workaround to prevent autogen.sh from failing at clone of gnulib. Your note has been pretty helpful in suggesting the --no-git workaround. I was not aware of this option. I am trying to build it and see if it works for me.
This patch allows gnulib git sources provided by $GNULIB_SRCDIR to be used for adding the gnulib submodule.
NAK.
GNULIB_SRCDIR is used to prime the pump - if you have a local checkout, then you don't need quite as much disk space or network usage to create your clone (your clone in .gnulib will implicitly point to your prior gnulib checkout as its reference). But you _still_ need .gnulib to be independent of your local reference repository, since it is possible that libvirt intentionally lags upstream gnulib, or that libvirt wants to use a newer upstream gnulib than what you have in your local reference repository at the moment.
Furthermore, you can use:
./bootstrap --no-git --gnulib-srcdir=/path/to/local
as a means of checking out the exact version of gnulib that you desire without referencing upstream gnulib.git.
Finally, this patch would have to go to upstream gnulib.git, since libvirt's copy of this file is a direct clone of upstream gnulib's bootstrap. Unless you can get this accepted upstream, then libvirt should not behave differently than any other project that uses gnulib's bootstrap script.
Ah yes! This is an additional complexity which I had hitherto not factored in :) -- Prerna Saxena Linux Technology Centre, IBM Systems and Technology Lab, Bangalore, India
participants (2)
-
Eric Blake
-
Prerna Saxena