Bug 1163084 - Releng work for producing dummy partner Android APK, r=dustin
authorJordan Lund <jlund@mozilla.com>
Wed, 30 Sep 2015 13:56:39 -0700
changeset 265403 691561c3d28bc0bc700322ae2fc78b934fc01739
parent 265402 bc0c60cd2fb1db72ec2fca9c0e1b684d164538ce
child 265404 de12059b8f366c09d7d3466ef00be95766757ccd
push id29462
push usercbook@mozilla.com
push dateThu, 01 Oct 2015 10:39:47 +0000
treeherderautoland@2c1fb007137d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdustin
bugs1163084
milestone44.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 1163084 - Releng work for producing dummy partner Android APK, r=dustin
mobile/android/config/mozconfigs/public-partner/distribution_sample/mozconfig1
testing/docker/desktop-build/REGISTRY
testing/docker/desktop-build/VERSION
testing/docker/desktop-build/bin/checkout-sources.sh
testing/mozharness/configs/builds/releng_sub_android_configs/64_api_11_partner_sample1.py
testing/mozharness/mozharness/mozilla/building/buildbase.py
testing/taskcluster/tasks/branches/base_job_flags.yml
testing/taskcluster/tasks/branches/try/job_flags.yml
testing/taskcluster/tasks/builds/android_api_11_partner_sample1.yml
new file mode 100644
--- /dev/null
+++ b/mobile/android/config/mozconfigs/public-partner/distribution_sample/mozconfig1
@@ -0,0 +1,21 @@
+# currently a copy of mobile/android/config/mozconfigs/android-api-11/nightly
+. "$topsrcdir/mobile/android/config/mozconfigs/common"
+
+ac_add_options --enable-profiling
+
+# Android
+ac_add_options --with-android-min-sdk=11
+ac_add_options --target=arm-linux-androideabi
+
+ac_add_options --with-branding=mobile/android/branding/nightly
+
+# This will overwrite the default of stripping everything and keep the symbol table.
+# This is useful for profiling with eideticker. See bug 788680
+STRIP_FLAGS="--strip-debug"
+
+export MOZILLA_OFFICIAL=1
+export MOZ_TELEMETRY_REPORTING=1
+
+MOZ_ANDROID_GECKOLIBS_AAR=1
+
+. "$topsrcdir/mobile/android/config/mozconfigs/common.override"
--- a/testing/docker/desktop-build/REGISTRY
+++ b/testing/docker/desktop-build/REGISTRY
@@ -1,1 +1,1 @@
-taskcluster
+jlund
--- a/testing/docker/desktop-build/VERSION
+++ b/testing/docker/desktop-build/VERSION
@@ -1,1 +1,1 @@
-0.1.5
+0.1.9
--- a/testing/docker/desktop-build/bin/checkout-sources.sh
+++ b/testing/docker/desktop-build/bin/checkout-sources.sh
@@ -35,9 +35,21 @@ then
     tc-vcs checkout $WORKSPACE/build/tools $TOOLS_BASE_REPOSITORY $TOOLS_HEAD_REPOSITORY $TOOLS_HEAD_REV $TOOLS_HEAD_REF
 
     if [ ! -d build ]; then
         mkdir -p build
         ln -s $WORKSPACE/build/tools build/tools
     fi
 fi
 
+# TODO - include tools repository in EXTRA_CHECKOUT_REPOSITORIES list
+for extra_repo in $EXTRA_CHECKOUT_REPOSITORIES; do
+    BASE_REPO="${extra_repo}_BASE_REPOSITORY"
+    HEAD_REPO="${extra_repo}_HEAD_REPOSITORY"
+    HEAD_REV="${extra_repo}_HEAD_REV"
+    HEAD_REF="${extra_repo}_HEAD_REF"
+    DEST_DIR="${extra_repo}_DEST_DIR"
+
+    tc-vcs checkout ${!DEST_DIR} ${!BASE_REPO} ${!HEAD_REPO} ${!HEAD_REV} ${!HEAD_REF}
+done
+
+
 tc-vcs checkout $WORKSPACE/build/src $GECKO_BASE_REPOSITORY $GECKO_HEAD_REPOSITORY $GECKO_HEAD_REV $GECKO_HEAD_REF
copy from testing/mozharness/configs/builds/releng_sub_android_configs/64_api_11.py
copy to testing/mozharness/configs/builds/releng_sub_android_configs/64_api_11_partner_sample1.py
--- a/testing/mozharness/configs/builds/releng_sub_android_configs/64_api_11.py
+++ b/testing/mozharness/configs/builds/releng_sub_android_configs/64_api_11_partner_sample1.py
@@ -1,8 +1,9 @@
 config = {
-    'base_name': 'Android armv7 API 11+ %(branch)s',
-    'stage_platform': 'android-api-11',
-    'build_type': 'api-11-opt',
-    'src_mozconfig': 'mobile/android/config/mozconfigs/android-api-11/nightly',
+    'base_name': 'Android armv7 API 11+ partner Sample1 %(branch)s',
+    'stage_platform': 'android-api-11-partner-sample1',
+    'build_type': 'api-11-partner-sample1-opt',
+    'src_mozconfig': None,  # use manifest to determine mozconfig src
+    'src_mozconfig_manifest': 'partner/mozconfigs/mozconfig1.json',
     'tooltool_manifest_src': 'mobile/android/config/tooltool-manifests/android/releng.manifest',
     'multi_locale_config_platform': 'android',
 }
--- a/testing/mozharness/mozharness/mozilla/building/buildbase.py
+++ b/testing/mozharness/mozharness/mozilla/building/buildbase.py
@@ -52,18 +52,16 @@ MISSING_CFG_KEY_MSG = "The key '%s' coul
 Please add this to your config."
 
 ERROR_MSGS = {
     'undetermined_repo_path': 'The repo could not be determined. \
 Please make sure that either "repo" is in your config or, if \
 you are running this in buildbot, "repo_path" is in your buildbot_config.',
     'comments_undetermined': '"comments" could not be determined. This may be \
 because it was a forced build.',
-    'src_mozconfig_path_not_found': '"abs_src_mozconfig" path could not be \
-determined. Please make sure it is a valid path off of "abs_src_dir"',
     'tooltool_manifest_undetermined': '"tooltool_manifest_src" not set, \
 Skipping run_tooltool...',
 }
 ERROR_MSGS.update(MOCK_ERROR_MSGS)
 
 
 ### Output Parsers
 
@@ -320,16 +318,17 @@ class BuildOptionParser(object):
         'graphene': 'builds/releng_sub_%s_configs/%s_graphene.py',
         'horizon': 'builds/releng_sub_%s_configs/%s_horizon.py',
         'source': 'builds/releng_sub_%s_configs/%s_source.py',
         'api-9': 'builds/releng_sub_%s_configs/%s_api_9.py',
         'api-11': 'builds/releng_sub_%s_configs/%s_api_11.py',
         'api-9-debug': 'builds/releng_sub_%s_configs/%s_api_9_debug.py',
         'api-11-debug': 'builds/releng_sub_%s_configs/%s_api_11_debug.py',
         'x86': 'builds/releng_sub_%s_configs/%s_x86.py',
+        'api-11-partner-sample1': 'builds/releng_sub_%s_configs/%s_api_11_partner_sample1.py',
     }
     build_pool_cfg_file = 'builds/build_pool_specifics.py'
     branch_cfg_file = 'builds/branch_specifics.py'
 
     @classmethod
     def _query_pltfrm_and_bits(cls, target_option, options):
         """ determine platform and bits
 
@@ -1011,33 +1010,42 @@ or run without that action (ie: --no-{ac
                 self.rmtree(package_path)
         else:
             self.info("There wasn't any old packages to remove.")
 
     def _get_mozconfig(self):
         """assign mozconfig."""
         c = self.config
         dirs = self.query_abs_dirs()
-        if c.get('src_mozconfig'):
+        abs_mozconfig_path = ''
+
+        # first determine the mozconfig path
+        if c.get('src_mozconfig') and not c.get('src_mozconfig_manifest'):
             self.info('Using in-tree mozconfig')
-            abs_src_mozconfig = os.path.join(dirs['abs_src_dir'],
-                                             c.get('src_mozconfig'))
-            if not os.path.exists(abs_src_mozconfig):
-                self.info('abs_src_mozconfig: %s' % (abs_src_mozconfig,))
-                self.fatal(ERROR_MSGS['src_mozconfig_path_not_found'])
-            self.copyfile(abs_src_mozconfig,
-                          os.path.join(dirs['abs_src_dir'], '.mozconfig'))
-            self.info("mozconfig content:")
-            with open(abs_src_mozconfig) as mozconfig:
-                for line in mozconfig:
-                    self.info(line)
+            abs_mozconfig_path = os.path.join(dirs['abs_src_dir'], c.get('src_mozconfig'))
+        elif c.get('src_mozconfig_manifest') and not c.get('src_mozconfig'):
+            self.info('Using mozconfig based on manifest contents')
+            manifest = os.path.join(dirs['abs_work_dir'], c['src_mozconfig_manifest'])
+            if not os.path.exists(manifest):
+                self.fatal('src_mozconfig_manifest: "%s" not found. Does it exist?' % (manifest,))
+            with self.opened(manifest, error_level=ERROR) as (fh, err):
+                if err:
+                    self.fatal("%s exists but coud not read properties" % manifest)
+                abs_mozconfig_path = os.path.join(dirs['abs_src_dir'], json.load(fh)['gecko_path'])
         else:
-            self.fatal("To build, you must supply a mozconfig from inside the "
-                       "tree to use use. Please provide the path in your "
-                       "config via 'src_mozconfig'")
+            self.fatal("'src_mozconfig' or 'src_mozconfig_manifest' must be "
+                       "in the config but not both in order to determine the mozconfig.")
+
+        # print its contents
+        content = self.read_from_file(abs_mozconfig_path, error_level=FATAL)
+        self.info("mozconfig content:")
+        self.info(content)
+
+        # finally, copy the mozconfig to a path that 'mach build' expects it to be
+        self.copyfile(abs_mozconfig_path, os.path.join(dirs['abs_src_dir'], '.mozconfig'))
 
     # TODO: replace with ToolToolMixin
     def _get_tooltool_auth_file(self):
         # set the default authentication file based on platform; this
         # corresponds to where puppet puts the token
         if 'tooltool_authentication_file' in self.config:
             fn = self.config['tooltool_authentication_file']
         elif self._is_windows():
--- a/testing/taskcluster/tasks/branches/base_job_flags.yml
+++ b/testing/taskcluster/tasks/branches/base_job_flags.yml
@@ -30,16 +30,17 @@ flags:
     - dolphin-eng
     - dolphin-512
     - dolphin-512-eng
     - aries
     - aries-ota
     - aries-eng
     - aries-dogfood
     - android-api-11
+    - android-partner-sample1
     - linux
     - linux64
     - linux64-st-an
     - macosx64
 
   tests:
     - cppunit
     - crashtest
--- a/testing/taskcluster/tasks/branches/try/job_flags.yml
+++ b/testing/taskcluster/tasks/branches/try/job_flags.yml
@@ -133,16 +133,22 @@ builds:
   linux:
     platforms:
       - Linux
     types:
       opt:
         task: tasks/builds/opt_linux32_clobber.yml
       debug:
         task: tasks/builds/dbg_linux32_clobber.yml
+  android-partner-sample1:
+    platforms:
+      - Android
+    types:
+      opt:
+        task: tasks/builds/android_api_11_partner_sample1.yml
   sm-plain:
     platforms:
       - Linux64
     types:
       opt:
         task: tasks/builds/sm_plain.yml
       debug:
        task: tasks/builds/sm_plaindebug.yml
copy from testing/taskcluster/tasks/builds/android_api_11.yml
copy to testing/taskcluster/tasks/builds/android_api_11_partner_sample1.yml
--- a/testing/taskcluster/tasks/builds/android_api_11.yml
+++ b/testing/taskcluster/tasks/builds/android_api_11_partner_sample1.yml
@@ -1,23 +1,23 @@
 $inherits:
   from: 'tasks/builds/mobile_base.yml'
   variables:
-    build_name: 'android'
+    build_name: 'android-api-11-partner-sample1'
     build_type: 'opt'
 task:
   metadata:
-      name: '[TC] Android armv7 API 11+'
-      description: 'Android armv7 API 11+'
+      name: '[TC] Android armv7 API 11+ partner sample 1'
+      description: 'Android armv7 API 11+ partner sample 1'
 
   workerType: android-api-11
 
   routes:
-    - 'index.buildbot.branches.{{project}}.android-api-11'
-    - 'index.buildbot.revisions.{{head_rev}}.{{project}}.android-api-11'
+    - 'index.buildbot.branches.{{project}}.android-api-11-partner-sample1'
+    - 'index.buildbot.revisions.{{head_rev}}.{{project}}.android-api-11-partner-sample1'
 
   scopes:
     - 'docker-worker:cache:build-android-api-11-c6-workspace'
     - 'docker-worker:cache:tooltool-cache'
     - 'docker-worker:relengapi-proxy:tooltool.download.internal'
     - 'docker-worker:relengapi-proxy:tooltool.download.public'
 
   payload:
@@ -32,20 +32,31 @@ task:
     env:
       # inputs to mozharness
       MOZHARNESS_SCRIPT: 'mozharness/scripts/fx_desktop_build.py'
       # TODO: make these additional configuration files go away
       MOZHARNESS_CONFIG: >
           builds/releng_base_android_64_builds.py
           disable_signing.py
           platform_supports_post_upload_to_latest.py
-      MH_CUSTOM_BUILD_VARIANT_CFG: api-11
+      MH_CUSTOM_BUILD_VARIANT_CFG: api-11-partner-sample1
       MH_BRANCH: {{project}}
       MH_BUILD_POOL: taskcluster
 
+      # space separated list of repositories required for this build
+      # for each ITEM in list you want checked out, you must also supply tc-vcs args:
+      # e.g. ${ITEM}_BASE_REPOSITORY
+      EXTRA_CHECKOUT_REPOSITORIES: >
+          PARTNER
+
+      PARTNER_BASE_REPOSITORY: 'https://github.com/mozilla/fennec-distribution-sample'
+      PARTNER_HEAD_REPOSITORY: 'https://github.com/mozilla/fennec-distribution-sample'
+      PARTNER_HEAD_REV: 756f0378d4cac87e5e6c405249ede5effe082da2
+      PARTNER_DEST_DIR: '/home/worker/workspace/build/partner'
+
       # image paths
       TOOLTOOL_CACHE: '/home/worker/tooltool-cache'
 
       # authentication
       RELENGAPI_TOKEN: 'TODO' # 1164612: encrypt this secret
 
     maxRunTime: 36000