[jhbuild] build/buildone: Always run autogen, remove alwaysautogen config option



commit 96182ea661cc65c42afe6b11972230e6c1ffbb55
Author: Colin Walters <walters verbum org>
Date:   Tue Oct 4 10:38:38 2011 -0400

    build/buildone: Always run autogen, remove alwaysautogen config option
    
    For what I'm fairly sure was originally a "speed" rationale, jhbuild
    has up until now required a "-a" option to enable running autogen.sh.
    
    However, one thing I am trying hard to eradicate from jhbuild is hard
    to debug build failures.  And not running autogen.sh after we've done
    a git pull, and then maybe relying on the module's AM_MAINTAINER_MODE
    to rerun the autotools is a big source of very very hard to debug
    failures.  There are actually some situations that 'make' cannot
    reasonably detect (such as switching from recursive to nonrecursive
    make).
    
    Recently we added 'jhbuild make' which is more of the developer 'make
    go fast' button one can use when actively hacking on a module.  It is
    now explicitly defined to skip autogen.sh.
    
    As far as the concern "but my builds are going to be slow!!!", I have
    multiple answers to that:
    
    0) We've already landed the partial build work, so you already have
       less to build than you did historically.
    1) We are going to make up some of the speed by defaulting to parallel
       make, like we should have from day 0.  A patch already exists.
    2) We can be more intelligent about detecting whether we need to run
       autogen.sh (this is a bit tricky but not impossible)
    3) Longer term, jhbuild will be shipping binaries from gnome.org, so
       you will really only have to build what you modify.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=660844

 doc/C/jhbuild.xml             |   30 ++----------------------------
 jhbuild/commands/base.py      |    8 ++++----
 jhbuild/commands/bot.py       |    1 -
 jhbuild/config.py             |   13 +++++++++----
 jhbuild/defaults.jhbuildrc    |    1 -
 jhbuild/frontends/gtkui.py    |    1 -
 jhbuild/modtypes/autotools.py |    9 ++++-----
 jhbuild/modtypes/waf.py       |    9 ++++-----
 8 files changed, 23 insertions(+), 49 deletions(-)
---
diff --git a/doc/C/jhbuild.xml b/doc/C/jhbuild.xml
index f4be551..23fdeda 100644
--- a/doc/C/jhbuild.xml
+++ b/doc/C/jhbuild.xml
@@ -871,18 +871,6 @@ jhbuildbot_password = 'password'
       <variablelist>
         <varlistentry>
           <term>
-            <option>-a</option>, <option>--autogen</option>
-          </term>
-          <listitem>
-            <simpara>Always run <command>autogen.sh</command> before building
-              modules. By default, <command>autogen.sh</command> will only be
-              called if the top-level makefile is missing. Otherwise, JHBuild
-              relies on the package's makefiles to detect if configure needs to
-              be rebuilt or rerun.</simpara>
-          </listitem>
-        </varlistentry>
-        <varlistentry>
-          <term>
             <option>-c</option>, <option>--clean</option>
           </term>
           <listitem>
@@ -1050,7 +1038,6 @@ jhbuildbot_password = 'password'
         It is useful for rebuilding one or more modules.</para>
 
       <cmdsynopsis><command>jhbuild buildone</command>
-        <arg>--autogen</arg>
         <arg>--clean</arg>
         <arg>--check</arg>
         <arg>--distcheck</arg>
@@ -1062,7 +1049,7 @@ jhbuildbot_password = 'password'
         <arg choice="plain" rep="repeat">module</arg>
       </cmdsynopsis>
 
-      <para>The <option>--autogen</option>, <option>--check</option>,
+      <para>The <option>--check</option>,
         <option>--clean</option>, <option>-d</option>,
         <option>--distcheck</option>, <option>--no-network</option>,
         <option>-D</option> and <option>-x</option> options are processed as per
@@ -1453,7 +1440,6 @@ No matching system package installed:
         similar to Mozilla's Tinderbox, or Debian's Buildd.</para>
 
       <cmdsynopsis><command>jhbuild tinderbox</command>
-        <arg>--autogen</arg>
         <arg>--clean</arg>
         <arg>--no-network</arg>
         <arg>--output=<replaceable>directory</replaceable></arg>
@@ -1466,7 +1452,7 @@ No matching system package installed:
         <arg rep="repeat">module</arg>
       </cmdsynopsis>
 
-      <para>The <option>--autogen</option>, <option>--clean</option>,
+      <para>The <option>--clean</option>,
         <option>--no-network</option>, <option>--skip</option>,
         <option>--start-at</option>, <option>-D</option>, <option>-C</option>,
         <option>-N</option> and <option>-f</option> options are processed as per
@@ -1576,18 +1562,6 @@ No matching system package installed:
       <variablelist>
 <?dbhtml list-presentation="table"?>
         <varlistentry>
-          <term id="cfg-alwaysautogen">
-            <varname>alwaysautogen</varname>
-          </term>
-          <listitem>
-            <simpara>A boolean value if set to <constant>True</constant>,
-              always run <command>autogen.sh</command> before
-              <command>make</command>, even if a makefile exists. This is
-              equivalent to passing <option>--always-autogen</option> option to
-              JHBuild. Defaults to <constant>False</constant>.</simpara>
-          </listitem>
-        </varlistentry>
-        <varlistentry>
           <term id="cfg-autogenargs">
             <varname>autogenargs</varname>
           </term>
diff --git a/jhbuild/commands/base.py b/jhbuild/commands/base.py
index 9adfb11..d2b4a71 100644
--- a/jhbuild/commands/base.py
+++ b/jhbuild/commands/base.py
@@ -210,8 +210,8 @@ class cmd_build(Command):
     def __init__(self):
         Command.__init__(self, [
             make_option('-a', '--autogen',
-                        action='store_true', dest='autogen', default=False,
-                        help=_('always run autogen.sh')),
+                        action='store_true', dest='_unused', default=False,
+                        help=_('This option does nothing anymore')),
             make_option('-c', '--clean',
                         action='store_true', dest='clean', default=False,
                         help=_('run make clean before make')),
@@ -304,8 +304,8 @@ class cmd_buildone(Command):
     def __init__(self):
         Command.__init__(self, [
             make_option('-a', '--autogen',
-                        action='store_true', dest='autogen', default=False,
-                        help=_('always run autogen.sh')),
+                        action='store_true', dest='_unused', default=False,
+                        help=_('This option does nothing anymore')),
             make_option('-c', '--clean',
                         action='store_true', dest='clean', default=False,
                         help=_('run make clean before make')),
diff --git a/jhbuild/commands/bot.py b/jhbuild/commands/bot.py
index 4a5a7ff..0d06ce5 100644
--- a/jhbuild/commands/bot.py
+++ b/jhbuild/commands/bot.py
@@ -163,7 +163,6 @@ class cmd_bot(Command):
                     config.nonetwork = False
                     phases = ['checkout']
                 elif args[0] == 'build':
-                    config.alwaysautogen = True
                     # make check will be run in another step
                     config.makecheck = False
                     config.build_targets = ['install']
diff --git a/jhbuild/config.py b/jhbuild/config.py
index d7db09c..6883eaa 100644
--- a/jhbuild/config.py
+++ b/jhbuild/config.py
@@ -45,7 +45,7 @@ _known_keys = [ 'moduleset', 'modules', 'skip', 'tags', 'prefix',
                 'installprog', 'repos', 'branches', 'noxvfb', 'xvfbargs',
                 'builddir_pattern', 'module_autogenargs', 'module_makeargs',
                 'interact', 'buildscript', 'nonetwork',
-                'alwaysautogen', 'nobuild', 'makeclean', 'makecheck', 'module_makecheck',
+                'nobuild', 'makeclean', 'makecheck', 'module_makecheck',
                 'use_lib64', 'tinderbox_outputdir', 'sticky_date',
                 'tarballdir', 'pretty_print', 'svn_program', 'makedist',
                 'makedistcheck', 'nonotify', 'notrayicon', 'cvs_program',
@@ -60,7 +60,11 @@ _known_keys = [ 'moduleset', 'modules', 'skip', 'tags', 'prefix',
                 'ignore_suggests', 'modulesets_dir', 'mirror_policy',
                 'module_mirror_policy', 'dvcs_mirror_dir', 'build_targets',
                 'cmakeargs', 'module_cmakeargs', 'print_command_pattern',
-                'static_analyzer', 'module_static_analyzer', 'static_analyzer_template', 'static_analyzer_outputdir' ]
+                'static_analyzer', 'module_static_analyzer', 'static_analyzer_template', 'static_analyzer_outputdir',
+
+                # Internal only keys (propagated from command line options)
+                '_internal_noautogen',
+                ]
 
 env_prepends = {}
 def prependpath(envvar, path):
@@ -181,6 +185,9 @@ class Config:
                 raise FatalError(
                     _('Obsolete JHBuild start script, make sure it is removed '
                       'then do run \'make install\''))
+            
+        # Set defaults for internal variables
+        self._config['_internal_noautogen'] = False
 
         env_prepends.clear()
         try:
@@ -542,8 +549,6 @@ class Config:
             options = self.cmdline_options
         else:
             self.cmdline_options = options
-        if hasattr(options, 'autogen') and options.autogen:
-            self.alwaysautogen = True
         if hasattr(options, 'clean') and (
                 options.clean and not 'clean' in self.build_targets):
             self.build_targets.insert(0, 'clean')
diff --git a/jhbuild/defaults.jhbuildrc b/jhbuild/defaults.jhbuildrc
index c417853..169f218 100644
--- a/jhbuild/defaults.jhbuildrc
+++ b/jhbuild/defaults.jhbuildrc
@@ -75,7 +75,6 @@ module_nopoison = {}
 
 # control parts of the build process
 nonetwork     = False  # never touch the network
-alwaysautogen = False  # call autogen.sh even if a makefile is found
 nobuild       = False  # don't actually build the packages
 makeclean     = False  # run make clean before building
 makecheck     = False  # run make check after building
diff --git a/jhbuild/frontends/gtkui.py b/jhbuild/frontends/gtkui.py
index 52474c2..1aad66f 100644
--- a/jhbuild/frontends/gtkui.py
+++ b/jhbuild/frontends/gtkui.py
@@ -714,7 +714,6 @@ class PreferencesDialog(gtk.Dialog):
 
         for key, label in (
                 ('nonetwork', _('Disable network access')),
-                ('alwaysautogen', _('Always run autogen.sh')),
                 ('nopoison', _('Don\'t poison modules on failure'))):
             checkbutton = gtk.CheckButton(label)
             checkbutton.set_active(getattr(self.app.config, key))
diff --git a/jhbuild/modtypes/autotools.py b/jhbuild/modtypes/autotools.py
index 2d0e366..df1800e 100644
--- a/jhbuild/modtypes/autotools.py
+++ b/jhbuild/modtypes/autotools.py
@@ -96,11 +96,10 @@ class AutogenModule(Package, DownloadableModule):
         if self.skip_autogen == 'never':
             return False
 
-        # skip if the makefile exists and we don't have the
-        # alwaysautogen flag turned on:
-        builddir = self.get_builddir(buildscript)
-        return (os.path.exists(os.path.join(builddir, self.makefile)) and
-                not buildscript.config.alwaysautogen)
+        if buildscript.config._internal_noautogen:
+            return True
+
+        return False
 
     def do_configure(self, buildscript):
         builddir = self.get_builddir(buildscript)
diff --git a/jhbuild/modtypes/waf.py b/jhbuild/modtypes/waf.py
index 220605a..071222b 100644
--- a/jhbuild/modtypes/waf.py
+++ b/jhbuild/modtypes/waf.py
@@ -64,11 +64,10 @@ class WafModule(Package, DownloadableModule):
                           self.PHASE_INSTALL]:
             return False
 
-        # skip if the .lock-wscript file exists and we don't have the
-        # alwaysautogen flag turned on:
-        builddir = self.get_builddir(buildscript)
-        return (os.path.exists(os.path.join(builddir, '.lock-wscript')) and
-                not buildscript.config.alwaysautogen)
+        if buildscript.config._internal_noautogen:
+            return True
+
+        return False
 
     def do_configure(self, buildscript):
         builddir = self.get_builddir(buildscript)



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