Bug 1175934 part 2: Support blobfree images.
authorWander Lairson Costa <wcosta@mozilla.com>
Fri, 31 Jul 2015 17:24:46 -0300
changeset 287345 e6f3a48c462bf2604260800aeb03d4e4b335c303
parent 287344 5f4839ec1475be192508f3df6af815acd21ddae3
child 287346 6fc853368a5aae767ba52daa232bc52ba91cc7e8
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1175934
milestone42.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1175934 part 2: Support blobfree images. When we ./build.sh blobfree, we have a new zip file called <target>.blobfree-dist.zip which contains a blobfree image. We copy this file to public artifact. We also refactor the build scripts a little bit to deduplicate the post build code.
b2g/config/aries/config.json
b2g/config/flame-kk/config.json
testing/mozharness/scripts/b2g_build.py
testing/taskcluster/scripts/phone-builder/build-phone-ota.sh
testing/taskcluster/scripts/phone-builder/build-phone.sh
testing/taskcluster/scripts/phone-builder/post-build.sh
--- a/b2g/config/aries/config.json
+++ b/b2g/config/aries/config.json
@@ -2,17 +2,17 @@
     "config_version": 2,
     "tooltool_manifest": "releng-aries.tt",
     "mock_target": "mozilla-centos6-x86_64",
     "mock_packages": ["ccache", "make", "bison", "flex", "gcc", "g++", "mpfr", "zlib-devel", "ncurses-devel", "zip", "autoconf213", "glibc-static", "perl-Digest-SHA", "wget", "alsa-lib", "atk", "cairo", "dbus-glib", "fontconfig", "freetype", "glib2", "gtk2", "libXRender", "libXt", "pango", "mozilla-python27-mercurial", "openssh-clients", "nss-devel", "glibc-devel.i686", "libstdc++.i686", "zlib-devel.i686", "ncurses-devel.i686", "libX11-devel.i686", "mesa-libGL-devel.i686", "mesa-libGL-devel", "libX11-devel", "git", "libxml2", "dosfstools"],
     "mock_files": [
         ["/home/cltbld/.ssh", "/home/mock_mozilla/.ssh"],
         ["/builds/crash-stats-api.token", "/builds/crash-stats-api.token"]
     ],
-    "build_targets": [],
+    "build_targets": ["", "blobfree"],
     "upload_files": [
         "{objdir}/dist/b2g-*.crashreporter-symbols.zip",
         "{objdir}/dist/b2g-*.tar.gz",
         "{workdir}/sources.xml"
     ],
     "public_upload_files": [
         "{objdir}/dist/b2g-*.crashreporter-symbols.zip",
         "{objdir}/dist/b2g-*.tar.gz",
--- a/b2g/config/flame-kk/config.json
+++ b/b2g/config/flame-kk/config.json
@@ -2,17 +2,17 @@
     "config_version": 2,
     "tooltool_manifest": "releng-flame-kk.tt",
     "mock_target": "mozilla-centos6-x86_64",
     "mock_packages": ["ccache", "make", "bison", "flex", "gcc", "g++", "mpfr", "zlib-devel", "ncurses-devel", "zip", "autoconf213", "glibc-static", "perl-Digest-SHA", "wget", "alsa-lib", "atk", "cairo", "dbus-glib", "fontconfig", "freetype", "glib2", "gtk2", "libXRender", "libXt", "pango", "mozilla-python27-mercurial", "openssh-clients", "nss-devel", "glibc-devel.i686", "libstdc++.i686", "zlib-devel.i686", "ncurses-devel.i686", "libX11-devel.i686", "mesa-libGL-devel.i686", "mesa-libGL-devel", "libX11-devel", "git", "libxml2", "dosfstools"],
     "mock_files": [
         ["/home/cltbld/.ssh", "/home/mock_mozilla/.ssh"],
         ["/builds/crash-stats-api.token", "/builds/crash-stats-api.token"]
     ],
-    "build_targets": [],
+    "build_targets": ["", "blobfree"],
     "upload_files": [
         "{objdir}/dist/b2g-*.crashreporter-symbols.zip",
         "{objdir}/dist/b2g-*.tar.gz",
         "{workdir}/sources.xml"
     ],
     "public_upload_files": [
         "{objdir}/dist/b2g-*.crashreporter-symbols.zip",
         "{objdir}/dist/b2g-*.tar.gz",
--- a/testing/mozharness/scripts/b2g_build.py
+++ b/testing/mozharness/scripts/b2g_build.py
@@ -519,17 +519,18 @@ class B2GBuild(LocalesMixin, PurgeMixin,
 
         self.write_to_file(sourcesfile, dom.toxml(), verbose=False)
         self.run_command(["diff", "-u", sourcesfile_orig, sourcesfile], success_codes=[1])
 
     def generate_build_command(self, target=None):
         cmd = ['./build.sh']
         if target is not None:
             # Workaround bug 984061
-            if target == 'package-tests':
+            # wcosta: blobfree builds also should run with -j1
+            if target in ('package-tests', 'blobfree'):
                 cmd.append('-j1')
             else:
                 # Ensure we always utilize the correct number of cores
                 # regardless of the configuration which may be set by repo
                 # config changes...
                 cmd.append('-j{0}'.format(multiprocessing.cpu_count()))
             cmd.append(target)
         return cmd
--- a/testing/taskcluster/scripts/phone-builder/build-phone-ota.sh
+++ b/testing/taskcluster/scripts/phone-builder/build-phone-ota.sh
@@ -37,27 +37,9 @@ rm -rf $WORKSPACE/B2G/upload/
   --log-level=debug \
   --target=$TARGET \
   --b2g-config-dir=$TARGET \
   --checkout-revision=$GECKO_HEAD_REV \
   --repo=$WORKSPACE/gecko \
   --platform $PLATFORM \
   --complete-mar-url https://queue.taskcluster.net/v1/task/$TASK_ID/runs/$RUN_ID/artifacts/public/build/$mar_file
 
-# Don't cache backups
-rm -rf $WORKSPACE/B2G/backup-*
-rm -f balrog_credentials
-
-mkdir -p $HOME/artifacts
-mkdir -p $HOME/artifacts-public
-
-mv $WORKSPACE/B2G/upload-public/$mar_file $HOME/artifacts-public/
-mv $WORKSPACE/B2G/upload/sources.xml $HOME/artifacts/sources.xml
-mv $WORKSPACE/B2G/upload/b2g-*.android-arm.tar.gz $HOME/artifacts/b2g-android-arm.tar.gz
-mv $WORKSPACE/B2G/upload/${TARGET}.zip $HOME/artifacts/${TARGET}.zip
-mv $WORKSPACE/B2G/upload/gaia.zip $HOME/artifacts/gaia.zip
-
-if [ -f $WORKSPACE/B2G/upload/b2g-*.crashreporter-symbols.zip ]; then
-  mv $WORKSPACE/B2G/upload/b2g-*.crashreporter-symbols.zip $HOME/artifacts/b2g-crashreporter-symbols.zip
-fi
-
-ccache -s
-
+. post-build.sh
--- a/testing/taskcluster/scripts/phone-builder/build-phone.sh
+++ b/testing/taskcluster/scripts/phone-builder/build-phone.sh
@@ -20,21 +20,9 @@ rm -rf $WORKSPACE/B2G/upload/
   --work-dir=$WORKSPACE/B2G \
   --gaia-languages-file locales/languages_all.json \
   --log-level=debug \
   --target=$TARGET \
   --b2g-config-dir=$TARGET \
   --checkout-revision=$GECKO_HEAD_REV \
   --repo=$WORKSPACE/gecko
 
-# Don't cache backups
-rm -rf $WORKSPACE/B2G/backup-*
-
-# Move files into artifact locations!
-mkdir -p $HOME/artifacts
-
-mv $WORKSPACE/B2G/upload/sources.xml $HOME/artifacts/sources.xml
-mv $WORKSPACE/B2G/upload/b2g-*.crashreporter-symbols.zip $HOME/artifacts/b2g-crashreporter-symbols.zip
-mv $WORKSPACE/B2G/upload/b2g-*.android-arm.tar.gz $HOME/artifacts/b2g-android-arm.tar.gz
-mv $WORKSPACE/B2G/upload/${TARGET}.zip $HOME/artifacts/${TARGET}.zip
-mv $WORKSPACE/B2G/upload/gaia.zip $HOME/artifacts/gaia.zip
-
-ccache -s
+. post-build.sh
new file mode 100755
--- /dev/null
+++ b/testing/taskcluster/scripts/phone-builder/post-build.sh
@@ -0,0 +1,33 @@
+#! /bin/bash -vex
+
+# Don't cache backups
+rm -rf $WORKSPACE/B2G/backup-*
+
+if [ -f balrog_credentials ]; then
+  rm -f balrog_credentials
+fi
+
+mkdir -p $HOME/artifacts
+mkdir -p $HOME/artifacts-public
+
+DEVICE=${TARGET%%-*}
+
+mv $WORKSPACE/B2G/upload/sources.xml $HOME/artifacts/sources.xml
+mv $WORKSPACE/B2G/upload/b2g-*.android-arm.tar.gz $HOME/artifacts/b2g-android-arm.tar.gz
+mv $WORKSPACE/B2G/upload/${TARGET}.zip $HOME/artifacts/${TARGET}.zip
+mv $WORKSPACE/B2G/upload/gaia.zip $HOME/artifacts/gaia.zip
+
+if [ -f $WORKSPACE/B2G/upload/b2g-*.crashreporter-symbols.zip ]; then
+  mv $WORKSPACE/B2G/upload/b2g-*.crashreporter-symbols.zip $HOME/artifacts/b2g-crashreporter-symbols.zip
+fi
+
+if [ -f $WORKSPACE/B2G/upload-public/${DEVICE}.blobfree-dist.zip ]; then
+  mv $WORKSPACE/B2G/upload-public/${DEVICE}.blobfree-dist.zip $HOME/artifacts-public
+fi
+
+if [ -f $WORKSPACE/B2G/upload-public/$mar_file ]; then
+  mv $WORKSPACE/B2G/upload-public/$mar_file $HOME/artifacts-public/
+fi
+
+ccache -s
+