Backed out 4 changesets (bug 1460402) for lint failure on intl/locales/en-US/hyphenation/hyph_en_US.dic. CLOSED TREE
authorDorel Luca <dluca@mozilla.com>
Fri, 11 May 2018 00:47:34 +0300
changeset 417812 5a8eea8a92bbfff1c4b324e1137f73e9956f9643
parent 417811 ba24174474837bcbb329f2cd72c5ccd5b4352923
child 417813 62d30a65c9c09be0135e36a2ae0ca1a622370b7c
push id33980
push userebalazs@mozilla.com
push dateFri, 11 May 2018 09:35:12 +0000
treeherdermozilla-central@8e9a4a323f0c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1460402
milestone62.0a1
backs outc2e8fbd72ca649e29403c31c8cee9e36cf83ebd6
3676e913dbffe199ec57ec84f97545e749291ad9
bb12ffd4b96e318f1e492661efb9747862988c77
3e50885329c49bbd9eeb4f76b98604f49fb50735
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
Backed out 4 changesets (bug 1460402) for lint failure on intl/locales/en-US/hyphenation/hyph_en_US.dic. CLOSED TREE Backed out changeset c2e8fbd72ca6 (bug 1460402) Backed out changeset 3676e913dbff (bug 1460402) Backed out changeset bb12ffd4b96e (bug 1460402) Backed out changeset 3e50885329c4 (bug 1460402)
build/sparse-profiles/docker-image
python/mozlint/mozlint/util/__init__.py
python/mozlint/mozlint/util/pip.py
taskcluster/docker/lint/Dockerfile
taskcluster/docker/lint/system-setup.sh
taskcluster/docker/update-verify/Dockerfile
tools/lint/python/__init__.py
tools/lint/python/flake8.py
tools/lint/spell/__init__.py
tools/lint/spell/codespell_requirements.txt
--- a/build/sparse-profiles/docker-image
+++ b/build/sparse-profiles/docker-image
@@ -2,13 +2,13 @@
 
 [include]
 path:taskcluster/
 
 # Result from `grep -hr %include taskcluster/docker | grep -v " taskcluster/" | sort -u`
 path:python/mozbuild/mozbuild/action/tooltool.py
 path:testing/config/tooltool-manifests/linux64/releng.manifest
 path:testing/mozharness/external_tools/robustcheckout.py
-path:tools/lint/spell/codespell_requirements.txt
 path:tools/lint/eslint/eslint-plugin-mozilla/manifest.tt
 path:tools/lint/eslint/manifest.tt
 path:tools/lint/python/flake8_requirements.txt
 path:tools/lint/tox/tox_requirements.txt
+
deleted file mode 100644
deleted file mode 100644
--- a/python/mozlint/mozlint/util/pip.py
+++ /dev/null
@@ -1,34 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-from __future__ import print_function
-from __future__ import absolute_import
-
-import subprocess
-
-
-def _run_pip(*args):
-    """
-    Helper function that runs pip with subprocess
-    """
-    try:
-        subprocess.check_output(['pip'] + list(args),
-                                stderr=subprocess.STDOUT)
-        return True
-    except subprocess.CalledProcessError as e:
-        print(e.output)
-        return False
-
-
-def reinstall_program(REQ_PATH):
-    """
-    Try to install flake8 at the target version, returns True on success
-    otherwise prints the otuput of the pip command and returns False
-    """
-    if _run_pip('install', '-U',
-                '--require-hashes', '-r',
-                REQ_PATH):
-        return True
-
-    return False
--- a/taskcluster/docker/lint/Dockerfile
+++ b/taskcluster/docker/lint/Dockerfile
@@ -25,18 +25,16 @@ ADD topsrcdir/taskcluster/docker/recipes
 ADD topsrcdir/taskcluster/docker/recipes/install-mercurial.sh /build/install-mercurial.sh
 ADD system-setup.sh /tmp/system-setup.sh
 # %include tools/lint/eslint/manifest.tt
 ADD topsrcdir/tools/lint/eslint/manifest.tt /tmp/eslint.tt
 # %include tools/lint/eslint/eslint-plugin-mozilla/manifest.tt
 ADD topsrcdir/tools/lint/eslint/eslint-plugin-mozilla/manifest.tt /tmp/eslint-plugin-mozilla.tt
 # %include tools/lint/python/flake8_requirements.txt
 ADD topsrcdir/tools/lint/python/flake8_requirements.txt /tmp/flake8_requirements.txt
-# %include tools/lint/spell/codespell_requirements.txt
-ADD topsrcdir/tools/lint/spell/codespell_requirements.txt /tmp/codespell_requirements.txt
 # %include tools/lint/tox/tox_requirements.txt
 ADD topsrcdir/tools/lint/tox/tox_requirements.txt /tmp/tox_requirements.txt
 RUN bash /tmp/system-setup.sh
 
 # %include taskcluster/scripts/run-task
 ADD topsrcdir/taskcluster/scripts/run-task /builds/worker/bin/run-task
 RUN chown -R worker:worker /builds/worker/bin && chmod 755 /builds/worker/bin/*
 
--- a/taskcluster/docker/lint/system-setup.sh
+++ b/taskcluster/docker/lint/system-setup.sh
@@ -5,16 +5,17 @@ export DEBIAN_FRONTEND=noninteractive
 set -ve
 
 test "$(whoami)" == 'root'
 
 mkdir -p /setup
 cd /setup
 
 apt_packages=()
+apt_packages+=('codespell')
 apt_packages+=('curl')
 apt_packages+=('locales')
 apt_packages+=('git')
 apt_packages+=('python')
 apt_packages+=('python-pip')
 apt_packages+=('python3')
 apt_packages+=('python3-pip')
 apt_packages+=('shellcheck')
@@ -83,24 +84,16 @@ mv fzf /usr/local/bin
 # Flake8 Setup
 ###
 
 cd /setup
 
 pip install --require-hashes -r /tmp/flake8_requirements.txt
 
 ###
-# codespell Setup
-###
-
-cd /setup
-
-pip install --require-hashes -r /tmp/codespell_requirements.txt
-
-###
 # tox Setup
 ###
 
 cd /setup
 
 pip install --require-hashes -r /tmp/tox_requirements.txt
 
 cd /
--- a/taskcluster/docker/update-verify/Dockerfile
+++ b/taskcluster/docker/update-verify/Dockerfile
@@ -37,18 +37,16 @@ ADD topsrcdir/taskcluster/docker/recipes
 ADD topsrcdir/taskcluster/docker/recipes/install-mercurial.sh /build/install-mercurial.sh
 ADD system-setup.sh /tmp/system-setup.sh
 # %include tools/lint/eslint/manifest.tt
 ADD topsrcdir/tools/lint/eslint/manifest.tt /tmp/eslint.tt
 # %include tools/lint/eslint/eslint-plugin-mozilla/manifest.tt
 ADD topsrcdir/tools/lint/eslint/eslint-plugin-mozilla/manifest.tt /tmp/eslint-plugin-mozilla.tt
 # %include tools/lint/python/flake8_requirements.txt
 ADD topsrcdir/tools/lint/python/flake8_requirements.txt /tmp/flake8_requirements.txt
-# %include tools/lint/spell/codespell_requirements.txt
-ADD topsrcdir/tools/lint/spell/codespell_requirements.txt /tmp/codespell_requirements.txt
 # %include tools/lint/tox/tox_requirements.txt
 ADD topsrcdir/tools/lint/tox/tox_requirements.txt /tmp/tox_requirements.txt
 RUN bash /tmp/system-setup.sh
 
 # %include taskcluster/scripts/run-task
 ADD topsrcdir/taskcluster/scripts/run-task /builds/worker/bin/run-task
 RUN chown -R worker:worker /builds/worker/bin && chmod 755 /builds/worker/bin/*
 
--- a/tools/lint/python/__init__.py
+++ b/tools/lint/python/__init__.py
@@ -1,22 +1,22 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 import json
 import os
 import signal
+import subprocess
 from collections import defaultdict
 
 import which
 from mozprocess import ProcessHandlerMixin
 
 from mozlint import result
-from mozlint.util import pip
 from mozlint.pathutils import get_ancestors_by_name
 
 
 here = os.path.abspath(os.path.dirname(__file__))
 FLAKE8_REQUIREMENTS_PATH = os.path.join(here, 'flake8_requirements.txt')
 
 FLAKE8_NOT_FOUND = """
 Could not find flake8! Install flake8 and try again.
@@ -100,28 +100,54 @@ def get_flake8_binary():
         return binary
 
     try:
         return which.which('flake8')
     except which.WhichError:
         return None
 
 
+def _run_pip(*args):
+    """
+    Helper function that runs pip with subprocess
+    """
+    try:
+        subprocess.check_output(['pip'] + list(args),
+                                stderr=subprocess.STDOUT)
+        return True
+    except subprocess.CalledProcessError as e:
+        print(e.output)
+        return False
+
+
+def reinstall_flake8():
+    """
+    Try to install flake8 at the target version, returns True on success
+    otherwise prints the otuput of the pip command and returns False
+    """
+    if _run_pip('install', '-U',
+                '--require-hashes', '-r',
+                FLAKE8_REQUIREMENTS_PATH):
+        return True
+
+    return False
+
+
 def run_process(config, cmd):
     proc = Flake8Process(config, cmd)
     proc.run()
     try:
         proc.wait()
     except KeyboardInterrupt:
         proc.kill()
 
 
 def lint(paths, config, **lintargs):
 
-    if not pip.reinstall_program(FLAKE8_REQUIREMENTS_PATH):
+    if not reinstall_flake8():
         print(FLAKE8_INSTALL_ERROR)
         return 1
 
     binary = get_flake8_binary()
 
     cmdargs = [
         binary,
         '--format', '{"path":"%(path)s","lineno":%(row)s,'
--- a/tools/lint/python/flake8.py
+++ b/tools/lint/python/flake8.py
@@ -1,23 +1,23 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 import json
 import os
 import platform
 import signal
+import subprocess
 import sys
 from collections import defaultdict
 
 from mozprocess import ProcessHandlerMixin
 
 from mozlint import result
-from mozlint.util import pip
 from mozlint.pathutils import get_ancestors_by_name
 
 
 here = os.path.abspath(os.path.dirname(__file__))
 FLAKE8_REQUIREMENTS_PATH = os.path.join(here, 'flake8_requirements.txt')
 
 FLAKE8_NOT_FOUND = """
 Could not find flake8! Install flake8 and try again.
@@ -93,28 +93,54 @@ class Flake8Process(ProcessHandlerMixin)
     def run(self, *args, **kwargs):
         # flake8 seems to handle SIGINT poorly. Handle it here instead
         # so we can kill the process without a cryptic traceback.
         orig = signal.signal(signal.SIGINT, signal.SIG_IGN)
         ProcessHandlerMixin.run(self, *args, **kwargs)
         signal.signal(signal.SIGINT, orig)
 
 
+def _run_pip(*args):
+    """
+    Helper function that runs pip with subprocess
+    """
+    try:
+        subprocess.check_output([os.path.join(bindir, 'pip')] + list(args),
+                                stderr=subprocess.STDOUT)
+        return True
+    except subprocess.CalledProcessError as e:
+        print(e.output)
+        return False
+
+
+def reinstall_flake8():
+    """
+    Try to install flake8 at the target version, returns True on success
+    otherwise prints the otuput of the pip command and returns False
+    """
+    if _run_pip('install', '-U',
+                '--require-hashes', '-r',
+                FLAKE8_REQUIREMENTS_PATH):
+        return True
+
+    return False
+
+
 def run_process(config, cmd):
     proc = Flake8Process(config, cmd)
     proc.run()
     try:
         proc.wait()
     except KeyboardInterrupt:
         proc.kill()
         return 1
 
 
 def setup(root):
-    if not pip.reinstall_program(FLAKE8_REQUIREMENTS_PATH):
+    if not reinstall_flake8():
         print(FLAKE8_INSTALL_ERROR)
         return 1
 
 
 def lint(paths, config, **lintargs):
     # TODO don't store results in a global
     global results
     results = []
--- a/tools/lint/spell/__init__.py
+++ b/tools/lint/spell/__init__.py
@@ -11,39 +11,32 @@ import re
 
 # Py3/Py2 compatibility.
 try:
     from json.decoder import JSONDecodeError
 except ImportError:
     JSONDecodeError = ValueError
 
 from mozlint import result
-from mozlint.util import pip
 from mozprocess import ProcessHandlerMixin
 
-here = os.path.abspath(os.path.dirname(__file__))
-CODESPELL_REQUIREMENTS_PATH = os.path.join(here, 'codespell_requirements.txt')
 
 CODESPELL_NOT_FOUND = """
-Could not find codespell! Install codespell and try again.
-
-    $ pip install -U --require-hashes -r {}
-""".strip().format(CODESPELL_REQUIREMENTS_PATH)
-
+Unable to locate codespell, please ensure it is installed and in
+your PATH or set the CODESPELL environment variable.
 
-CODESPELL_INSTALL_ERROR = """
-Unable to install correct version of codespell
-Try to install it manually with:
-    $ pip install -U --require-hashes -r {}
-""".strip().format(CODESPELL_REQUIREMENTS_PATH)
+https://github.com/lucasdemarchi/codespell or your system's package manager.
+""".strip()
 
 results = []
 
 CODESPELL_FORMAT_REGEX = re.compile(r'(.*):(.*): (.*) ==> (.*)$')
 
+here = os.path.abspath(os.path.dirname(__file__))
+
 
 class CodespellProcess(ProcessHandlerMixin):
     def __init__(self, config, *args, **kwargs):
         self.config = config
         kwargs['processOutputLine'] = [self.process_line]
         ProcessHandlerMixin.__init__(self, *args, **kwargs)
 
     def process_line(self, line):
@@ -93,20 +86,16 @@ def get_codespell_binary():
     try:
         return which.which('codespell')
     except which.WhichError:
         return None
 
 
 def lint(paths, config, fix=None, **lintargs):
 
-    if not pip.reinstall_program(CODESPELL_REQUIREMENTS_PATH):
-        print(CODESPELL_INSTALL_ERROR)
-        return 1
-
     binary = get_codespell_binary()
 
     if not binary:
         print(CODESPELL_NOT_FOUND)
         if 'MOZ_AUTOMATION' in os.environ:
             return 1
         return []
 
deleted file mode 100644
--- a/tools/lint/spell/codespell_requirements.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-codespell==1.12.0 \
-    --hash=sha256:f547ef6ea3af4569b0a4d3ef106ef6403f6ee574afdaa8e332650aea87301daf