bug 1399523, now that we run l10n-merge in-build, drop it from mozharness, r=Callek
authorAxel Hecht <axel@pike.org>
Fri, 15 Sep 2017 16:25:18 +0200
changeset 433481 67a43ebd7bbd9c9ab77212af68892f05ed7e7409
parent 433475 5098b8bf0d77aa1c5935022b49e161a2fd9dd28f
child 433482 43d1d3e1c1cbd9ef5990ac2113c8c379c1a99786
push id1567
push userjlorenzo@mozilla.com
push dateThu, 02 Nov 2017 12:36:05 +0000
treeherdermozilla-release@e512c14a0406 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersCallek
bugs1399523
milestone57.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 1399523, now that we run l10n-merge in-build, drop it from mozharness, r=Callek MozReview-Commit-ID: 3qF0i39CYjh
testing/mozharness/mozharness/mozilla/building/buildbase.py
testing/mozharness/mozharness/mozilla/l10n/locales.py
testing/mozharness/mozharness/mozilla/l10n/multi_locale_build.py
testing/mozharness/scripts/desktop_l10n.py
testing/mozharness/scripts/mobile_l10n.py
testing/mozharness/test/test_l10n_locales.py
--- a/testing/mozharness/mozharness/mozilla/building/buildbase.py
+++ b/testing/mozharness/mozharness/mozilla/building/buildbase.py
@@ -1687,17 +1687,16 @@ or run without that action (ie: --no-{ac
 
         cmd = [
             sys.executable,
             multil10n_path,
             '--config-file',
             'multi_locale/%s_%s.json' % (branch, multi_config_pf),
             '--config-file',
             'multi_locale/android-mozharness-build.json',
-            '--merge-locales',
             '--pull-locale-source',
             '--add-locales',
             '--package-multi',
             '--summary',
         ]
 
         self.run_command_m(cmd, env=self.query_build_env(), cwd=base_work_dir,
                            halt_on_failure=True)
--- a/testing/mozharness/mozharness/mozilla/l10n/locales.py
+++ b/testing/mozharness/mozharness/mozilla/l10n/locales.py
@@ -11,17 +11,16 @@ import os
 from urlparse import urljoin
 import pprint
 import sys
 from copy import deepcopy
 
 sys.path.insert(1, os.path.dirname(sys.path[0]))
 
 from mozharness.base.config import parse_config_file
-from mozharness.base.errors import PythonErrorList
 from mozharness.base.parallel import ChunkingMixin
 
 
 # LocalesMixin {{{1
 class LocalesMixin(ChunkingMixin):
     def __init__(self, **kwargs):
         """ Mixins generally don't have an __init__.
         This breaks super().__init__() for children.
@@ -138,41 +137,16 @@ class LocalesMixin(ChunkingMixin):
                     self.l10n_revisions[locale] = 'default'
                 locales.append(locale)
         else:
             locales = self.read_from_file(locales_file).split()
         self.info("self.l10n_revisions: %s" % pprint.pformat(self.l10n_revisions))
         self.info("locales: %s" % locales)
         return locales
 
-    def run_compare_locales(self, locale, halt_on_failure=False):
-        dirs = self.query_abs_dirs()
-        env = self.query_l10n_env()
-        compare_locales_error_list = list(PythonErrorList)
-        self.rmtree(dirs['abs_merge_dir'])
-        self.mkdir_p(dirs['abs_merge_dir'])
-        python = sys.executable
-        # A mock environment is a special case, the system python isn't
-        # available there
-        if 'mock_target' in self.config:
-            python = 'python2.7'
-
-        command = [python, 'mach', 'compare-locales',
-                   '--merge-dir', dirs['abs_merge_dir'],
-                   '--l10n-ini', os.path.join(dirs['abs_locales_src_dir'], 'l10n.ini'),
-                   '--l10n-base', dirs['abs_l10n_dir'], locale]
-        self.info("*** BEGIN compare-locales %s" % locale)
-        status = self.run_command(command,
-                                  halt_on_failure=halt_on_failure,
-                                  env=env,
-                                  cwd=dirs['abs_mozilla_dir'],
-                                  error_list=compare_locales_error_list)
-        self.info("*** END compare-locales %s" % locale)
-        return status
-
     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'])
@@ -180,33 +154,23 @@ class LocalesMixin(ChunkingMixin):
         if 'l10n_dir' in c:
             dirs['abs_l10n_dir'] = os.path.join(dirs['abs_work_dir'],
                                                 c['l10n_dir'])
         if 'mozilla_dir' in c:
             dirs['abs_mozilla_dir'] = os.path.join(dirs['abs_work_dir'],
                                                    c['mozilla_dir'])
             dirs['abs_locales_src_dir'] = os.path.join(dirs['abs_mozilla_dir'],
                                                        c['locales_dir'])
-            dirs['abs_compare_locales_dir'] = os.path.join(dirs['abs_mozilla_dir'],
-                                                           'third_party', 'python',
-                                                           'compare-locales', 'compare_locales')
-        else:
-            # Use old-compare-locales if no mozilla_dir set, needed
-            # for clobberer, and existing mozharness tests.
-            dirs['abs_compare_locales_dir'] = os.path.join(dirs['abs_work_dir'],
-                                                           'compare-locales')
 
         if 'objdir' in c:
             if os.path.isabs(c['objdir']):
                 dirs['abs_objdir'] = c['objdir']
             else:
                 dirs['abs_objdir'] = os.path.join(dirs['abs_mozilla_dir'],
                                                   c['objdir'])
-            dirs['abs_merge_dir'] = os.path.join(dirs['abs_objdir'],
-                                                 'merged')
             dirs['abs_locales_dir'] = os.path.join(dirs['abs_objdir'],
                                                    c['locales_dir'])
 
         for key in dirs.keys():
             if key not in abs_dirs:
                 abs_dirs[key] = dirs[key]
         self.abs_dirs = abs_dirs
         return self.abs_dirs
--- a/testing/mozharness/mozharness/mozilla/l10n/multi_locale_build.py
+++ b/testing/mozharness/mozharness/mozilla/l10n/multi_locale_build.py
@@ -30,29 +30,16 @@ class MultiLocaleBuild(LocalesMixin, Mer
     config_options = [[
         ["--locale"],
         {"action": "extend",
          "dest": "locales",
          "type": "string",
          "help": "Specify the locale(s) to repack"
          }
     ], [
-        ["--merge-locales"],
-        {"action": "store_true",
-         "dest": "merge_locales",
-         "default": False,
-         "help": "Use default [en-US] if there are missing strings"
-         }
-    ], [
-        ["--no-merge-locales"],
-        {"action": "store_false",
-         "dest": "merge_locales",
-         "help": "Do not allow missing strings"
-         }
-    ], [
         ["--objdir"],
         {"action": "store",
          "dest": "objdir",
          "type": "string",
          "default": "objdir",
          "help": "Specify the objdir"
          }
     ], [
@@ -148,20 +135,17 @@ class MultiLocaleBuild(LocalesMixin, Mer
             self.fatal("Erroring out after the build failed.")
 
     def add_locales(self):
         c = self.config
         dirs = self.query_abs_dirs()
         locales = self.query_locales()
 
         for locale in locales:
-            self.run_compare_locales(locale, halt_on_failure=True)
             command = 'make chrome-%s L10NBASEDIR=%s' % (locale, dirs['abs_l10n_dir'])
-            if c['merge_locales']:
-                command += " LOCALE_MERGEDIR=%s" % dirs['abs_merge_dir'].replace(os.sep, '/')
             status = self._process_command(command=command,
                                            cwd=dirs['abs_locales_dir'],
                                            error_list=MakefileErrorList)
             if status:
                 self.return_code += 1
                 self.add_summary("Failed to add locale %s!" % locale,
                                  level="error")
             else:
--- a/testing/mozharness/scripts/desktop_l10n.py
+++ b/testing/mozharness/scripts/desktop_l10n.py
@@ -60,17 +60,17 @@ configuration_tokens = ('branch',
                         'ssh_key_dir',
                         'stage_product',
                         'upload_environment',
                         )
 # some other values such as "%(version)s", "%(buildid)s", ...
 # are defined at run time and they cannot be enforced in the _pre_config_lock
 # phase
 runtime_config_tokens = ('buildid', 'version', 'locale', 'from_buildid',
-                         'abs_objdir', 'abs_merge_dir', 'revision',
+                         'abs_objdir', 'revision',
                          'to_buildid', 'en_us_binary_url',
                          'en_us_installer_binary_url', 'mar_tools_url',
                          'post_upload_extra', 'who')
 
 
 # DesktopSingleLocale {{{1
 class DesktopSingleLocale(LocalesMixin, ReleaseMixin, MockMixin, BuildbotMixin,
                           VCSMixin, SigningMixin, PurgeMixin, BaseScript,
@@ -387,19 +387,16 @@ class DesktopSingleLocale(LocalesMixin, 
             # "mar -> MAR" and 'mar.exe -> MAR' (windows)
             name = binary.replace('.exe', '')
             name = name.upper()
             binary_path = os.path.join(self._mar_tool_dir(), binary)
             # windows fix...
             if binary.endswith('.exe'):
                 binary_path = binary_path.replace('\\', '\\\\\\\\')
             bootstrap_env[name] = binary_path
-            if 'LOCALE_MERGEDIR' in bootstrap_env:
-                # windows fix
-                bootstrap_env['LOCALE_MERGEDIR'] = bootstrap_env['LOCALE_MERGEDIR'].replace('\\', '\\\\\\\\')
         if self.query_is_nightly():
             bootstrap_env["IS_NIGHTLY"] = "yes"
         self.bootstrap_env = bootstrap_env
         return self.bootstrap_env
 
     def _query_upload_env(self):
         """returns the environment used for the upload step"""
         if self.upload_env:
@@ -860,30 +857,25 @@ class DesktopSingleLocale(LocalesMixin, 
         return SUCCESS
 
     def make_installers(self, locale):
         """wrapper for make installers-(locale)"""
         env = self.query_l10n_env()
         self._copy_mozconfig()
         dirs = self.query_abs_dirs()
         cwd = os.path.join(dirs['abs_locales_dir'])
-        target = ["installers-%s" % locale,
-                  "LOCALE_MERGEDIR=%s" % env["LOCALE_MERGEDIR"], ]
+        target = ["installers-%s" % locale, ]
         return self._make(target=target, cwd=cwd,
                           env=env, halt_on_failure=False)
 
     def repack_locale(self, locale):
-        """wraps the logic for compare locale, make installers and generating
+        """wraps the logic for make installers and generating
            complete updates."""
 
-        if self.run_compare_locales(locale) != SUCCESS:
-            self.error("compare locale %s failed" % (locale))
-            return FAILURE
-
-        # compare locale succeeded, run make installers
+        # run make installers
         if self.make_installers(locale) != SUCCESS:
             self.error("make installers-%s failed" % (locale))
             return FAILURE
 
         # now try to upload the artifacts
         if self.make_upload(locale):
             self.error("make upload for locale %s failed!" % (locale))
             return FAILURE
--- a/testing/mozharness/scripts/mobile_l10n.py
+++ b/testing/mozharness/scripts/mobile_l10n.py
@@ -500,22 +500,16 @@ class MobileSingleLocale(MockMixin, Loca
         # TODO per-locale logs and reporting.
         dirs = self.query_abs_dirs()
         locales = self.query_locales()
         make = self.query_exe("make")
         repack_env = self.query_repack_env()
         success_count = total_count = 0
         for locale in locales:
             total_count += 1
-            self.enable_mock()
-            result = self.run_compare_locales(locale)
-            self.disable_mock()
-            if result:
-                self.add_failure(locale, message="%s failed in compare-locales!" % locale)
-                continue
             if self.run_command_m([make, "installers-%s" % locale],
                                   cwd=dirs['abs_locales_dir'],
                                   env=repack_env,
                                   error_list=MakefileErrorList,
                                   halt_on_failure=False):
                 self.add_failure(locale, message="%s failed in make installers-%s!" % (locale, locale))
                 continue
             success_count += 1
--- a/testing/mozharness/test/test_l10n_locales.py
+++ b/testing/mozharness/test/test_l10n_locales.py
@@ -23,17 +23,17 @@ class LocalesTest(locales.LocalesMixin, 
                                 'log_level': 'error'}
         if 'initial_config_file' not in kwargs:
             kwargs['initial_config_file'] = 'test/test.json'
         super(LocalesTest, self).__init__(**kwargs)
         self.config = {}
         self.log_obj = None
 
 class TestLocalesMixin(unittest.TestCase):
-    BASE_ABS_DIRS = ['abs_compare_locales_dir', 'abs_log_dir',
+    BASE_ABS_DIRS = ['abs_log_dir',
                      'abs_upload_dir', 'abs_work_dir', 'base_work_dir']
     def setUp(self):
         cleanup()
 
     def tearDown(self):
         cleanup()
 
     def test_query_locales_locales(self):
@@ -119,14 +119,14 @@ class TestLocalesMixin(unittest.TestCase
     def test_query_abs_dirs_objdir(self):
         l = self._get_query_abs_dirs_obj()
         l.config['l10n_dir'] = "l10n_dir"
         l.config['mozilla_dir'] = "mozilla_dir"
         l.config['locales_dir'] = "locales_dir"
         l.config['objdir'] = "objdir"
         dirs = l.query_abs_dirs().keys()
         dirs.sort()
-        expected_dirs = self.BASE_ABS_DIRS + ['abs_mozilla_dir', 'abs_locales_src_dir', 'abs_l10n_dir', 'abs_objdir', 'abs_merge_dir', 'abs_locales_dir']
+        expected_dirs = self.BASE_ABS_DIRS + ['abs_mozilla_dir', 'abs_locales_src_dir', 'abs_l10n_dir', 'abs_objdir', 'abs_locales_dir']
         expected_dirs.sort()
         self.assertEqual(dirs, expected_dirs)
 
 if __name__ == '__main__':
     unittest.main()