Author Topic: Keeping old build* directories to speed up compiling (patch for bootStrap.bash)  (Read 717 times)

eumagga0x2a

  • Hero Member
  • *****
  • Posts: 911
Referring to http://avidemux.org/smif/index.php/topic,16742.msg75822.html#msg75822: Is it harmless to keep build* (buildCli, buildCore, buildPluginsCLI, buildPluginsCommon, buildPluginsQt5, buildPluginsSettings, buildQt5) directories from the previous build around to save time, hoping that the build system will do its job right? Or is it a recipe for disaster?

If doing such a thing is viable, what do you think about the following patch for bootStrap.bash?

Code: [Select]
diff --git a/bootStrap.bash b/bootStrap.bash
index 1995d54..b9e0e04 100644
--- a/bootStrap.bash
+++ b/bootStrap.bash
@@ -5,6 +5,7 @@
 # By default we use qt5 now
 #
 packages_ext=""
+rebuild=0
 do_core=1
 do_cli=1
 do_gtk=0  # Gtk is obsolete!
@@ -41,8 +42,12 @@ Process()
         fi
  FAKEROOT=" -DFAKEROOT=$FAKEROOT_DIR "
         echo "Building $BUILDDIR from $SOURCEDIR with EXTRA=<$EXTRA>, DEBUG=<$DEBUG>"
-        rm -Rf ./$BUILDDIR
-        mkdir $BUILDDIR || fail mkdir
+        if [ "x$rebuild" != "x1" ] ; then
+                rm -Rf ./$BUILDDIR
+        fi
+        if [ ! -e "$BUILDDIR" ] ; then
+                mkdir $BUILDDIR || fail mkdir
+        fi
         cd $BUILDDIR
         cmake $PKG $FAKEROOT $QT_FLAVOR -DCMAKE_EDIT_COMMAND=vim -DAVIDEMUX_SOURCE_DIR=$TOP -DCMAKE_INSTALL_PREFIX=/usr $EXTRA $ASAN $DEBUG -G "$BUILDER" $SOURCEDIR || fail cmakeZ
         make  $PARAL >& /tmp/log$BUILDDIR || fail "make, result in /tmp/log$BUILDDIR"
@@ -85,6 +90,7 @@ usage()
         echo "  --deb             : Build deb packages"
         echo "  --tgz             : Build tgz packages"
         echo "  --debug           : Switch debugging on"
+        echo "  --rebuild         : Preserve existing build directories"
         echo "  --with-core       : Build core"
         echo "  --without-core    : Dont build core"
         echo "  --with-cli        : Build cli"
@@ -122,6 +128,9 @@ while [ $# != 0 ] ;do
          --debug)
                 debug=1
                 ;;
+         --rebuild)
+                rebuild=1
+                ;;
          --tgz)
                 packages_ext=tar.gz
                 PKG="$PKG -DAVIDEMUX_PACKAGER=tgz"

mean

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10790
Merged, thanks

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 5110
Can you explain us a little more what exactly is the difference between these 2:
with --rebuild:
Code: [Select]
bash bootStrap.bash --rebuild --debwithout  --rebuild:
Code: [Select]
bash bootStrap.bash --debI understand one is building faster the the other (partial build <> complete build)
« Last Edit: July 29, 2016, 06:26:37 AM by Jan Gruuthuse »

mean

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10790
without the --rebuild, it compiles from scractch
With the --rebuild, it re-compiles only what has changed (hopefully)

For quick tries, --rebuild is fine
To create deb you distribute, better not to use it
« Last Edit: July 29, 2016, 08:43:16 AM by mean »

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 5110
Ok, all clear now.