# HG changeset patch # User Tom Prince # Date 1518406776 25200 # Node ID 90b727b890e0bcd772fe1c7734fc3413ca43418b # Parent b9d9d5913f692f92f85fc499f797f3c9d9b94c04 Bug 1429603: Remove always false `update_gecko_source_to_enUS` from L10N mozharness scripts; r=Callek Differential Revision: https://phabricator.services.mozilla.com/D543 diff --git a/testing/mozharness/configs/single_locale/tc_common.py b/testing/mozharness/configs/single_locale/tc_common.py --- a/testing/mozharness/configs/single_locale/tc_common.py +++ b/testing/mozharness/configs/single_locale/tc_common.py @@ -1,8 +1,7 @@ config = { "mozilla_dir": "src/", "simple_name_move": True, - "update_gecko_source_to_enUS": False, # Override the buildbot path to not read it "buildbot_json_path": None, } diff --git a/testing/mozharness/configs/single_locale/try.py b/testing/mozharness/configs/single_locale/try.py --- a/testing/mozharness/configs/single_locale/try.py +++ b/testing/mozharness/configs/single_locale/try.py @@ -1,16 +1,15 @@ import os config = { "nightly_build": False, "branch": "try", "en_us_binary_url": "http://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central", "update_channel": "nightly", - "update_gecko_source_to_enUS": False, # l10n "hg_l10n_base": "https://hg.mozilla.org/l10n-central", # mar "mar_tools_url": os.environ.get( "MAR_TOOLS_URL", # Buildbot l10n fetches from ftp rather than setting an environ var diff --git a/testing/mozharness/configs/single_locale/try_android-api-16.py b/testing/mozharness/configs/single_locale/try_android-api-16.py --- a/testing/mozharness/configs/single_locale/try_android-api-16.py +++ b/testing/mozharness/configs/single_locale/try_android-api-16.py @@ -19,17 +19,16 @@ config = { "tools_repo": "https://hg.mozilla.org/build/tools", "tooltool_config": { "manifest": "mobile/android/config/tooltool-manifests/android/releng.manifest", "output_dir": "%(abs_work_dir)s/" + MOZILLA_DIR, }, "exes": { 'tooltool.py': '/builds/tooltool.py', }, - "update_gecko_source_to_enUS": False, "repos": [{ "vcs": "hg", "repo": "https://hg.mozilla.org/build/tools", "branch": "default", "dest": "tools", }, { "vcs": "hg", "repo": "https://hg.mozilla.org/try", diff --git a/testing/mozharness/scripts/desktop_l10n.py b/testing/mozharness/scripts/desktop_l10n.py --- a/testing/mozharness/scripts/desktop_l10n.py +++ b/testing/mozharness/scripts/desktop_l10n.py @@ -13,17 +13,17 @@ import glob import re import sys import shlex import subprocess # load modules from parent dir sys.path.insert(1, os.path.dirname(sys.path[0])) -from mozharness.base.errors import BaseErrorList, MakefileErrorList +from mozharness.base.errors import MakefileErrorList from mozharness.base.script import BaseScript from mozharness.base.transfer import TransferMixin from mozharness.base.vcs.vcsbase import VCSMixin from mozharness.mozilla.buildbot import BuildbotMixin from mozharness.mozilla.purge import PurgeMixin from mozharness.mozilla.building.buildbase import MakeUploadOutputParser from mozharness.mozilla.l10n.locales import LocalesMixin from mozharness.mozilla.mar import MarMixin @@ -197,17 +197,16 @@ class DesktopSingleLocale(LocalesMixin, **buildscript_kwargs ) self.buildid = None self.make_ident_output = None self.bootstrap_env = None self.upload_env = None self.revision = None - self.enUS_revision = None self.version = None self.upload_urls = {} self.locales_property = {} self.pushdate = None # upload_files is a dictionary of files to upload, keyed by locale. self.upload_files = {} def _pre_config_lock(self, rw_config): @@ -455,38 +454,22 @@ class DesktopSingleLocale(LocalesMixin, revision = config["revision"] elif 'revision' in self.buildbot_properties: revision = self.buildbot_properties['revision'] elif (self.buildbot_config and self.buildbot_config.get('sourcestamp', {}).get('revision')): revision = self.buildbot_config['sourcestamp']['revision'] elif self.buildbot_config and self.buildbot_config.get('revision'): revision = self.buildbot_config['revision'] - elif config.get("update_gecko_source_to_enUS", True): - revision = self._query_enUS_revision() if not revision: self.fatal("Can't determine revision!") self.revision = str(revision) return self.revision - def _query_enUS_revision(self): - """Get revision from the objdir. - Only valid after setup is run. - """ - if self.enUS_revision: - return self.enUS_revision - r = re.compile(r"^(gecko|fx)_revision ([0-9a-f]+\+?)$") - output = self._query_make_ident_output() - for line in output.splitlines(): - match = r.match(line) - if match: - self.enUS_revision = match.groups()[1] - return self.enUS_revision - def _query_make_variable(self, variable, make_args=None): """returns the value of make echo-variable- it accepts extra make arguements (make_args) """ dirs = self.query_abs_dirs() make_args = make_args or [] target = ["echo-variable-%s" % variable] + make_args cwd = dirs['abs_locales_dir'] @@ -598,49 +581,24 @@ class DesktopSingleLocale(LocalesMixin, self.vcs_checkout_repos(repos, parent_dir=dirs['abs_work_dir'], tag_override=config.get('tag_override')) def clone_locales(self): self.pull_locale_source() def setup(self): """setup step""" - dirs = self.query_abs_dirs() self._run_tooltool() self._copy_mozconfig() self._mach_configure() self._run_make_in_config_dir() self.make_wget_en_US() self.make_unpack_en_US() self.download_mar_tools() - # on try we want the source we already have, otherwise update to the - # same as the en-US binary - if self.config.get("update_gecko_source_to_enUS", True): - revision = self._query_enUS_revision() - # TODO do this through VCSMixin instead of hardcoding hg - # self.update(dest=dirs["abs_mozilla_dir"], revision=revision) - hg = self.query_exe("hg") - self.run_command([hg, "update", "-r", revision], - cwd=dirs["abs_mozilla_dir"], - env=self.query_bootstrap_env(), - error_list=BaseErrorList, - halt_on_failure=True, fatal_exit_code=3) - # if checkout updates CLOBBER file with a newer timestamp, - # next make -f client.mk configure will delete archives - # downloaded with make wget_en_US, so just touch CLOBBER file - _clobber_file = self._clobber_file() - if os.path.exists(_clobber_file): - self._touch_file(_clobber_file) - # and again... - # thanks to the last hg update, we can be on different firefox 'version' - # than the one on default, - self._mach_configure() - self._run_make_in_config_dir() - def _run_make_in_config_dir(self): """this step creates nsinstall, needed my make_wget_en_US() """ dirs = self.query_abs_dirs() config_dir = os.path.join(dirs['abs_objdir'], 'config') env = self.query_bootstrap_env() return self._make(target=['export'], cwd=config_dir, env=env) diff --git a/testing/mozharness/scripts/mobile_l10n.py b/testing/mozharness/scripts/mobile_l10n.py --- a/testing/mozharness/scripts/mobile_l10n.py +++ b/testing/mozharness/scripts/mobile_l10n.py @@ -20,17 +20,17 @@ try: import simplejson as json assert json except ImportError: import json # load modules from parent dir sys.path.insert(1, os.path.dirname(sys.path[0])) -from mozharness.base.errors import BaseErrorList, MakefileErrorList +from mozharness.base.errors import MakefileErrorList from mozharness.base.log import OutputParser from mozharness.base.transfer import TransferMixin from mozharness.mozilla.buildbot import BuildbotMixin from mozharness.mozilla.purge import PurgeMixin from mozharness.mozilla.release import ReleaseMixin from mozharness.mozilla.signing import MobileSigningMixin from mozharness.mozilla.tooltool import TooltoolMixin from mozharness.base.vcs.vcsbase import MercurialScript @@ -146,17 +146,16 @@ class MobileSingleLocale(MockMixin, Loca config_options=self.config_options, require_config_file=require_config_file, **buildscript_kwargs ) self.base_package_name = None self.buildid = None self.make_ident_output = None self.repack_env = None - self.enUS_revision = None self.revision = None self.upload_env = None self.version = None self.upload_urls = {} self.locales_property = {} # Helper methods {{{2 def query_repack_env(self): @@ -263,38 +262,22 @@ class MobileSingleLocale(MockMixin, Loca revision = config["revision"] elif 'revision' in self.buildbot_properties: revision = self.buildbot_properties['revision'] elif (self.buildbot_config and self.buildbot_config.get('sourcestamp', {}).get('revision')): revision = self.buildbot_config['sourcestamp']['revision'] elif self.buildbot_config and self.buildbot_config.get('revision'): revision = self.buildbot_config['revision'] - elif config.get("update_gecko_source_to_enUS", True): - revision = self._query_enUS_revision() if not revision: self.fatal("Can't determine revision!") self.revision = str(revision) return self.revision - def _query_enUS_revision(self): - """Get revision from the objdir. - Only valid after setup is run. - """ - if self.enUS_revision: - return self.enUS_revision - r = re.compile(r"^gecko_revision ([0-9a-f]+\+?)$") - output = self._query_make_ident_output() - for line in output.splitlines(): - match = r.match(line) - if match: - self.enUS_revision = match.groups()[0] - return self.enUS_revision - def _query_make_variable(self, variable, make_args=None): make = self.query_exe('make') env = self.query_repack_env() dirs = self.query_abs_dirs() if make_args is None: make_args = [] # TODO error checking output = self.get_output_from_command_m( @@ -465,34 +448,16 @@ class MobileSingleLocale(MockMixin, Loca error_list=MakefileErrorList, halt_on_failure=True) self.run_command_m([make, "unpack"], cwd=dirs['abs_locales_dir'], env=env, error_list=MakefileErrorList, halt_on_failure=True) - # on try we want the source we already have, otherwise update to the - # same as the en-US binary - if self.config.get("update_gecko_source_to_enUS", True): - revision = self._query_enUS_revision() - if not revision: - self.fatal("Can't determine revision!") - hg = self.query_exe("hg") - # TODO do this through VCSMixin instead of hardcoding hg - self.run_command_m([hg, "update", "-r", revision], - cwd=dirs["abs_mozilla_dir"], - env=env, - error_list=BaseErrorList, - halt_on_failure=True) - self.set_buildbot_property('revision', revision, write_to_file=True) - # Configure again since the hg update may have invalidated it. - buildid = self.query_buildid() - self._setup_configure(buildid=buildid) - def repack(self): # 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: