[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdesdk
From:       Michael Pyne <mpyne () kde ! org>
Date:       2010-08-28 2:28:04
Message-ID: 20100828022804.94819AC86C () svn ! kde ! org
[Download RAW message or body]

SVN commit 1168981 by mpyne:

Some fixes to make the "skipping build" feature hopefully more useful:

* It is now controlled by an option 'build-when-unchanged' which defaults to true,
  so the optimization must now be explicitly enabled.
* The build is only skipped if the module was successfully installed (as determined
  by the persistent data recorded last run).
* A command-line option, --force-build is added, along with
  --no-build-when-unchanged to be symmetric with the rc-file option.

The new command line option and rc-file option are also documented and added to the
Kate/Kwrite syntax highlighting file.

BUG:248826
FIXED-IN:1.12.1


 M  +41 -0     doc/scripts/kdesrc-build/index.docbook  
 M  +20 -2     scripts/kdesrc-build  
 M  +2 -1      scripts/kdesrc-buildrc.xml  


--- trunk/KDE/kdesdk/doc/scripts/kdesrc-build/index.docbook #1168980:1168981
@@ -1118,6 +1118,32 @@
 </entry>
 </row>
 
+<row id="conf-build-when-unchanged">
+<entry>build-when-unchanged</entry>
+<entry>Module setting overrides global</entry>
+<entry><para>Use this option in order to control whether &kdesrc-build; always
+tries to build a module that has not had any source code updates.</para>
+
+<para>By setting <option>build-when-unchanged</option> to
+<replaceable>true</replaceable>, &kdesrc-build; always attempts the build phase
+for a module, even if the module did not have any source code updates. This is
+the default setting since it is more likely to lead to a correct
+build.</para>
+
+<para>By setting <option>build-when-unchanged</option> to
+<replaceable>false</replaceable>, &kdesrc-build; will only attempt to run the
+build phase for a module if the module has a source code update, or in other
+situations where it is likely that a rebuild is actually required. This can save
+time, especially if you run &kdesrc-build; daily, or more frequently.</para>
+
+<important><para>This feature is provided as an optimization only. Like many
+other optimizations, there are trade-offs for the correctness of your
+installation. For instance, changes to the qt-copy or kdelibs modules may cause
+a rebuild of other modules to be necessary, even if the source code doesn't
+change at all.</para></important>
+</entry>
+</row>
+
 <row id="conf-checkout-only">
 <entry>checkout-only</entry>
 <entry>Module setting overrides global</entry>
@@ -1809,6 +1835,21 @@
 </para></listitem>
 </varlistentry>
 
+<varlistentry id="cmdline-no-build-when-unchanged">
+<term><parameter>--no-build-when-unchanged</parameter></term>
+<term><parameter>--force-build</parameter></term>
+<listitem><para>
+This option explicitly disables skipping the build process (an optimization
+controlled by the <link
+linkend="conf-build-when-unchanged">build-when-unchanged</link> option. This is
+useful for making &kdesrc-build; run the build when you have changed something
+that &kdesrc-build; cannot check.</para>
+
+<para><parameter>--force-build</parameter> performs the exact same function, and
+is perhaps easier to remember.</para>
+</listitem>
+</varlistentry>
+
 <varlistentry id="cmdline-debug">
 <term><parameter>--debug</parameter></term>
 <listitem><para>
--- trunk/KDE/kdesdk/scripts/kdesrc-build #1168980:1168981
@@ -78,6 +78,7 @@
   'global' => {
     "async"               => 1,
     "binpath"             => $ENV{'PATH'},
+    "build-when-unchanged"=> 1, # Safe default
     "branch"              => "",
     "build-dir"           => "build",
     "build-system-only"   => "",
@@ -3815,6 +3816,11 @@
                 last SWITCH;
             };
 
+            /^--(force-build)|(no-build-when-unchanged)$/ && do {
+                set_option('global', '#build-when-unchanged', 1);
+                last SWITCH;
+            };
+
             /^--purge-old-logs=?/ && do {
                 set_option('global', '#purge-old-logs', 1);
                 last SWITCH;
@@ -3977,6 +3983,8 @@
 
             /^(--dry-run)|(--pretend)|(-p)$/ && do {
                 set_option('global', '#pretend', 1);
+                # Simulate the build process too.
+                set_option('global', '#build-when-unchanged', 1);
                 last SWITCH;
             };
 
@@ -5912,14 +5920,24 @@
                 else
                 {
                     $svn_status{$buffer} = 'skipped';
-                    note "\tSkipping g[$module]. Already up-to-date.";
                 }
             }
         }
 
         next if $svn_status{$module} eq 'failed';
-        ($i++ and next) if $svn_status{$module} eq 'skipped';
 
+        # Skip actually building a module if the user has selected to skip
+        # builds when the source code was not actually updated. But, don't skip
+        # if we didn't successfully build last time.
+        if (!get_option($module, 'build-when-unchanged') &&
+            $svn_status{$module} eq 'skipped' &&
+            get_persistent_option($module, 'failure-count') == 0)
+        {
+            note "\tSkipping g[$module], its source code has not changed.";
+            $i++;
+            next;
+        }
+
         if (build_module ($module))
         {
             my $elapsed = prettify_seconds(time - $start_time);
--- trunk/KDE/kdesdk/scripts/kdesrc-buildrc.xml #1168980:1168981
@@ -3,7 +3,7 @@
 <!-- This goes into $KDEDIR/share/apps/katepart/syntax, or
      it can go to $KDEHOME/share/apps/katepart/syntax
  -->
-<language name="kdesrc-buildrc" version="0.5" kateversion="2.4" \
section="Configuration" \
extensions=".kdesrc-buildrc;kdesrc-buildrc;.kdesvn-buildrc;kdesvn-buildrc" \
author="Michael Pyne &lt;mpyne@kde.org&gt;" license="LGPL"> +<language \
name="kdesrc-buildrc" version="0.5.1" kateversion="2.4" section="Configuration" \
extensions=".kdesrc-buildrc;kdesrc-buildrc;.kdesvn-buildrc;kdesvn-buildrc" \
author="Michael Pyne &lt;mpyne@kde.org&gt;" license="LGPL">  
   <highlighting>
     <list name="bools">
@@ -21,6 +21,7 @@
     <list name="boolOptions">
       <item>async</item>
       <item>build-system-only</item>
+      <item>build-when-unchanged</item>
       <item>colorful-output</item>
       <item>disable-agent-check</item>
       <item>disable-snapshot</item>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic