Bug 1655666: [mozharness] Always set `abs_src_path` if `GECKO_PATH` is in the environment; r=mtabara a=RyanVM FIREFOX_78_8_0esr_BUILD2 FIREFOX_78_8_0esr_RELEASE
authorTom Prince <mozilla@hocat.ca>
Tue, 28 Jul 2020 20:29:55 +0000
changeset 3564347 f35972ee2800dd61e7994a3340b721df8887f8bd
parent 3564346 f2c5b8fc309765988d59bf5f56f1a9c655176153
child 3564348 3fe8d804677e9c7e04403752d2e48a0d18810faa
push id659780
push useragakhokidze@mozilla.com
push dateThu, 25 Feb 2021 01:06:10 +0000
treeherdertry@2e8cf9eb8985 [default view] [failures only]
reviewersmtabara, RyanVM
bugs1655666
milestone78.8.0
Bug 1655666: [mozharness] Always set `abs_src_path` if `GECKO_PATH` is in the environment; r=mtabara a=RyanVM Differential Revision: https://phabricator.services.mozilla.com/D85181
testing/mozharness/mozharness/base/script.py
testing/mozharness/mozharness/mozilla/l10n/locales.py
testing/mozharness/scripts/android_emulator_pgo.py
testing/mozharness/scripts/fx_desktop_build.py
testing/mozharness/scripts/openh264_build.py
testing/mozharness/scripts/repackage.py
--- a/testing/mozharness/mozharness/base/script.py
+++ b/testing/mozharness/mozharness/base/script.py
@@ -2176,16 +2176,18 @@ class BaseScript(ScriptMixin, LogMixin, 
         """
         if self.abs_dirs:
             return self.abs_dirs
         c = self.config
         dirs = {}
         dirs['base_work_dir'] = c['base_work_dir']
         dirs['abs_work_dir'] = os.path.join(c['base_work_dir'], c['work_dir'])
         dirs['abs_log_dir'] = os.path.join(c['base_work_dir'], c.get('log_dir', 'logs'))
+        if 'GECKO_PATH' in os.environ:
+            dirs['abs_src_dir'] = os.environ['GECKO_PATH']
         self.abs_dirs = dirs
         return self.abs_dirs
 
     def dump_config(self, file_path=None, config=None,
                     console_output=True, exit_on_finish=False):
         """Dump self.config to localconfig.json
         """
         config = config or self.config
--- a/testing/mozharness/mozharness/mozilla/l10n/locales.py
+++ b/testing/mozharness/mozharness/mozilla/l10n/locales.py
@@ -123,22 +123,21 @@ class LocalesMixin(object):
     def query_abs_dirs(self):
         if self.abs_dirs:
             return self.abs_dirs
         abs_dirs = super(LocalesMixin, self).query_abs_dirs()
         c = self.config
         dirs = {}
         dirs['abs_work_dir'] = os.path.join(c['base_work_dir'],
                                             c['work_dir'])
-        dirs['abs_src_dir'] = os.environ['GECKO_PATH']
         dirs["abs_l10n_dir"] = os.path.abspath(
-            os.path.join(dirs["abs_src_dir"], "../l10n-central")
+            os.path.join(abs_dirs["abs_src_dir"], "../l10n-central")
         )
         dirs['abs_locales_src_dir'] = os.path.join(
-            dirs['abs_src_dir'],
+            abs_dirs['abs_src_dir'],
             c['locales_dir'],
         )
 
         dirs['abs_obj_dir'] = os.path.join(dirs['abs_work_dir'],
                                            c['objdir'])
         dirs['abs_locales_dir'] = os.path.join(dirs['abs_obj_dir'],
                                                c['locales_dir'])
 
--- a/testing/mozharness/scripts/android_emulator_pgo.py
+++ b/testing/mozharness/scripts/android_emulator_pgo.py
@@ -93,19 +93,18 @@ class AndroidProfileRun(TestingMixin, Ba
         self.device_serial = 'emulator-5554'
 
     def query_abs_dirs(self):
         if self.abs_dirs:
             return self.abs_dirs
         abs_dirs = super(AndroidProfileRun, self).query_abs_dirs()
         dirs = {}
 
-        dirs['abs_src_dir'] = os.environ['GECKO_PATH']
         dirs['abs_test_install_dir'] = os.path.join(
-            dirs['abs_src_dir'], 'testing')
+            abs_dirs['abs_src_dir'], 'testing')
         dirs['abs_xre_dir'] = os.path.join(
             abs_dirs['abs_work_dir'], 'hostutils')
         dirs['abs_blob_upload_dir'] = '/builds/worker/artifacts/blobber_upload_dir'
         dirs['abs_avds_dir'] = self.config.get("avds_dir", "/home/cltbld/.android")
 
         for key in dirs.keys():
             if key not in abs_dirs:
                 abs_dirs[key] = dirs[key]
--- a/testing/mozharness/scripts/fx_desktop_build.py
+++ b/testing/mozharness/scripts/fx_desktop_build.py
@@ -72,17 +72,16 @@ class FxDesktopBuild(BuildScript, object
         dirs = {
             # BuildFactories in factory.py refer to a 'build' dir on the slave.
             # This contains all the source code/objdir to compile.  However,
             # there is already a build dir in mozharness for every mh run. The
             # 'build' that factory refers to I named: 'src' so
             # there is a seperation in mh.  for example, rather than having
             # '{mozharness_repo}/build/build/', I have '{
             # mozharness_repo}/build/src/'
-            'abs_src_dir': os.environ['GECKO_PATH'],
             'abs_obj_dir': os.path.join(abs_dirs['abs_work_dir'],
                                         self._query_objdir()),
             'upload_path': self.config["upload_env"]["UPLOAD_PATH"],
         }
         abs_dirs.update(dirs)
         self.abs_dirs = abs_dirs
         return self.abs_dirs
 
--- a/testing/mozharness/scripts/openh264_build.py
+++ b/testing/mozharness/scripts/openh264_build.py
@@ -114,17 +114,16 @@ class OpenH264Build(TransferMixin, VCSSc
             all_actions=all_actions,
             default_actions=default_actions,
         )
 
     def query_abs_dirs(self):
         if self.abs_dirs:
             return self.abs_dirs
         dirs = super(OpenH264Build, self).query_abs_dirs()
-        dirs['abs_src_dir'] = os.environ['GECKO_PATH']
         dirs['abs_upload_dir'] = os.path.join(dirs['abs_work_dir'], 'upload')
         self.abs_dirs = dirs
         return self.abs_dirs
 
     def get_tooltool(self):
         c = self.config
         if not c.get('tooltool_manifest_file'):
             self.info("Skipping tooltool fetching since no tooltool manifest")
--- a/testing/mozharness/scripts/repackage.py
+++ b/testing/mozharness/scripts/repackage.py
@@ -38,17 +38,16 @@ class Repackage(BaseScript):
 
     def query_abs_dirs(self):
         if self.abs_dirs:
             return self.abs_dirs
         abs_dirs = super(Repackage, self).query_abs_dirs()
         config = self.config
 
         dirs = {}
-        dirs['abs_src_dir'] = os.environ['GECKO_PATH']
         dirs['abs_input_dir'] = os.path.join(abs_dirs['base_work_dir'], 'fetches')
         output_dir_suffix = []
         if config.get('locale'):
             output_dir_suffix.append(config['locale'])
         if config.get('repack_id'):
             output_dir_suffix.append(config['repack_id'])
         dirs['abs_output_dir'] = os.path.join(
             abs_dirs['abs_work_dir'], 'outputs', *output_dir_suffix)