author Gregory Szorc <>
Tue, 07 Nov 2017 16:38:39 -0800
changeset 441455 b5f79b0f2a3586faf692c715b443264478e921c3
parent 425150 ba1b16b46b0c6473c410fcdb4eaa0bace6f7f5e5
child 448237 f6ba05c2b2aedf14b977d8f8f396a7a78eceffc9
permissions -rw-r--r--
Bug 1412932 - Switch to PGO build in; r=ted Previously, made the decision of whether to perform a PGO build. This required passing around MOZ_PGO and invoking a separate make target if this variable was set. In this commit, we move this logic to We employ a special mechanism in to override the default make target so `make` evaluates "profiledbuild" if MOZ_PGO is set. This also required using an explicit target for $(MAKE) invocations inside the "profiledbuild" rule to avoid infinite recursion. MozReview-Commit-ID: 8sHiVspMisM

# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# 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

import json
import os

from mozprocess import ProcessHandler

from mozlint import result

results = []

def lint(files, config, **kwargs):
    tests_dir = os.path.join(kwargs['root'], 'testing', 'web-platform', 'tests')

    def process_line(line):
            data = json.loads(line)
        except ValueError:
        data["level"] = "error"
        data["path"] = os.path.relpath(os.path.join(tests_dir, data["path"]), kwargs['root'])
        results.append(result.from_config(config, **data))

    path = os.path.join(tests_dir, "wpt")
    proc = ProcessHandler([path, "lint", "--json"] + files, env=os.environ,
    except KeyboardInterrupt:

    return results