Richard W.M. Jones
2009-Oct-30 17:13 UTC
[Libguestfs] [PATCH] appliance: Don't rebuild the appliance every time configure runs
Whenever config.status / configure runs it touches appliance/make.sh (even if the file hasn't changed) and that causes the appliance to be rebuilt completely. This patch breaks that dependency because building the appliance is time-consuming (since dracut was added) so we should try not to build it each time. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://et.redhat.com/~rjones/libguestfs/ See what it can do: http://et.redhat.com/~rjones/libguestfs/recipes.html -------------- next part -------------->From 55f5321ce06836a4e561a92ab2defaf5f78d3116 Mon Sep 17 00:00:00 2001From: Richard Jones <rjones at redhat.com> Date: Fri, 30 Oct 2009 17:11:02 +0000 Subject: [PATCH] appliance: Don't rebuild the appliance every time configure runs. --- appliance/Makefile.am | 6 +++++- appliance/make.sh.in | 3 +++ 2 files changed, 8 insertions(+), 1 deletions(-) diff --git a/appliance/Makefile.am b/appliance/Makefile.am index d1338bf..e4e13f6 100644 --- a/appliance/Makefile.am +++ b/appliance/Makefile.am @@ -56,7 +56,11 @@ endif # This is for building the normal appliance: $(INITRAMFSIMG) $(VMLINUZ): $(top_builddir)/initramfs/fakeroot.log -$(top_builddir)/initramfs/fakeroot.log: make.sh kmod.whitelist packagelist +# Next line used to depend on make.sh. However config.status updates +# the timestamp on make.sh even when it doesn't change, causing the +# whole appliance to be rebuilt too frequently. This means if you +# modify make.sh.in, you have to delete the appliance by hand. +$(top_builddir)/initramfs/fakeroot.log: kmod.whitelist packagelist mv $(INITRAMFSIMG) $(INITRAMFSIMG).bak 2>/dev/null; : mv $(VMLINUZ) $(VMLINUZ).bak 2>/dev/null; : if ! bash make.sh; then rm -f $@; exit 1; fi diff --git a/appliance/make.sh.in b/appliance/make.sh.in index 37e1893..d678833 100755 --- a/appliance/make.sh.in +++ b/appliance/make.sh.in @@ -18,6 +18,9 @@ # This is called from the Makefile to build the initramfs. +# NB: If you modify this file, you have to 'rm -rf initramfs/' in +# order to rebuild the appliance. + unset CDPATH set -e -- 1.6.5.rc2
Richard W.M. Jones
2009-Nov-02 16:41 UTC
[Libguestfs] [PATCH v2] appliance: Don't rebuild the appliance every time configure runs
This seems like a better way to fix this. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://et.redhat.com/~rjones/libguestfs/ See what it can do: http://et.redhat.com/~rjones/libguestfs/recipes.html -------------- next part -------------->From ff704b2291680ca52051452abbce033953f65f3e Mon Sep 17 00:00:00 2001From: Richard Jones <rjones at redhat.com> Date: Fri, 30 Oct 2009 17:11:02 +0000 Subject: [PATCH] appliance: Don't rebuild the appliance every time configure runs. config.status touches make.sh each time it runs, even if the resulting script would not change. This causes the appliance to get rebuilt much more frequently than is necessary. There's no way to stop configure running, but we can move the config.status command into a Makefile rule to stop this undesirable behaviour. --- appliance/Makefile.am | 9 +++++++++ configure.ac | 2 -- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/appliance/Makefile.am b/appliance/Makefile.am index d1338bf..1fb7699 100644 --- a/appliance/Makefile.am +++ b/appliance/Makefile.am @@ -61,6 +61,15 @@ $(top_builddir)/initramfs/fakeroot.log: make.sh kmod.whitelist packagelist mv $(VMLINUZ) $(VMLINUZ).bak 2>/dev/null; : if ! bash make.sh; then rm -f $@; exit 1; fi +# This used to be a configure-generated file (as is update.sh still). +# However config.status always touches the destination file, which +# means the appliance got rebuilt too often. +make.sh: make.sh.in + cd $(top_builddir) && \ + ./config.status --file=appliance/$@-t:appliance/$< + chmod +x $@-t + mv $@-t $@ + $(INITRAMFSIMG): $(top_builddir)/initramfs/fakeroot.log $(top_builddir)/daemon/guestfsd init update.sh rm -f $@ bash update.sh diff --git a/configure.ac b/configure.ac index b31c193..e11de0c 100644 --- a/configure.ac +++ b/configure.ac @@ -699,8 +699,6 @@ AC_CONFIG_SUBDIRS([daemon]) dnl Produce output files. AC_CONFIG_HEADERS([config.h]) dnl http://www.mail-archive.com/automake at gnu.org/msg10204.html -AC_CONFIG_FILES([appliance/make.sh], - [chmod +x appliance/make.sh]) AC_CONFIG_FILES([appliance/update.sh], [chmod +x appliance/update.sh]) AC_CONFIG_FILES([appliance/supermin-split.sh], -- 1.6.5.rc2