Bug 1357562 - Specify artifact build replacement via mozharness for non-variant builds. r=nalexander draft
authorChris Manchester <cmanchester@mozilla.com>
Tue, 25 Apr 2017 15:54:24 -0700
changeset 568942 d3c6e3929bf02893ec18f54b0a8739181067e22b
parent 565529 e9a5d4f62461ee0db07a41f59b73163ec106bc3e
child 568943 431d7f6df1136a20ed5796c23832879c5be99790
push id56028
push userbmo:cmanchester@mozilla.com
push dateWed, 26 Apr 2017 19:30:22 +0000
reviewersnalexander
bugs1357562
milestone55.0a1
Bug 1357562 - Specify artifact build replacement via mozharness for non-variant builds. r=nalexander No builds other than vanilla opt and debug builds are supported by the artifact code currently, so prevent variant builds from being replaced by artifact builds by modifying mozharness' replacement logic to replace a build with an artifact build only when it is a regular opt or debug build or when specified by a config. MozReview-Commit-ID: KUUgrbga53l
testing/mozharness/scripts/fx_desktop_build.py
--- a/testing/mozharness/scripts/fx_desktop_build.py
+++ b/testing/mozharness/scripts/fx_desktop_build.py
@@ -123,48 +123,45 @@ class FxDesktopBuild(BuildScript, TryToo
                 self.set_buildbot_property('stage_platform',
                                            platform_for_log_url,
                                            write_to_file=True)
             else:
                 self.fatal("'stage_platform' not determined and is required in your config")
 
         if self.try_message_has_flag('artifact'):
             # Not all jobs that look like builds can be made into artifact
-            # builds (for example, various SAN builds might not make sense as
-            # artifact builds).  For jobs that can't be turned into artifact
-            # jobs, provide a falsy `artifact_flag_build_variant_in_try`.
+            # builds (for example, various SAN builds will not make sense as
+            # artifact builds).  By default, only a vanilla debug or opt build
+            # will be replaced by an artifact build.
             #
             # In addition, some jobs want to specify their artifact equivalent.
             # Use `artifact_flag_build_variant_in_try` to specify that variant.
-            # Defaults to `artifact`, or `debug-artifact` for `debug` and
-            # `cross-debug` build variants.
             #
             # This is temporary, until we find a way to introduce an "artifact
             # build dimension" like "opt"/"debug" into the CI configurations.
             self.info('Artifact build requested in try syntax.')
 
-            default = 'artifact'
-            if c.get('build_variant') in ['debug', 'cross-debug']:
-                default = 'debug-artifact'
+            variant = None
 
-            variant = None
             if 'artifact_flag_build_variant_in_try' in c:
-                variant = c.get('artifact_flag_build_variant_in_try')
+                variant = c['artifact_flag_build_variant_in_try']
                 if not variant:
                     self.info('Build variant has falsy `artifact_flag_build_variant_in_try`; '
                               'ignoring artifact build request and performing original build.')
                     return
-
-                self.info('Build variant has non-falsy `artifact_build_variant_in_try`.')
+                self.info('Build variant has `artifact_build_variant_in_try`: "%s".' % variant)
             else:
-                variant = default
+                if not c.get('build_variant'):
+                    variant = 'artifact'
+                elif c.get('build_variant') in ['debug', 'cross-debug']:
+                    variant = 'debug-artifact'
 
-            self.info('Using artifact build variant "%s".' % variant)
-
-            self._update_build_variant(rw_config, variant)
+            if variant:
+                self.info('Using artifact build variant "%s".' % variant)
+                self._update_build_variant(rw_config, variant)
 
     # helpers
     def _update_build_variant(self, rw_config, variant='artifact'):
         """ Intended for use in _pre_config_lock """
         c = self.config
         variant_cfg_path, _ = BuildOptionParser.find_variant_cfg_path(
             '--custom-build-variant-cfg',
             variant,