build/gen_test_backend.py
author Ted Mielczarek <ted@mielczarek.org>
Fri, 08 Dec 2017 13:50:17 -0500
changeset 450058 b6656f7bbc861f5879a3d61d007e599c2fbd6190
parent 397018 2324b5d27792b17e19afe42d70c224deb52565aa
child 530370 5cc56532ff4a4b2b896f84e4b6e7889837acb42d
permissions -rw-r--r--
bug 1424323 - remove MOZ_AUTOMATION_UPLOAD_SYMBOLS from in-tree mozconfigs. r=rillian With all of our builds in Taskcluster now, we should never be uploading symbols from build tasks. Unfortunately Windows builds were still doing so. This patch removes MOZ_AUTOMATION_UPLOAD_SYMBOLS from all the in-tree mozconfigs and a few other places so that it should always default off (per moz-automation.mk). The rest of the uploadsymbols bits will be removed once Thunderbird fixes their automation. This patch was mostly autogenerated by running: rg --files-with-matches UPLOAD_SYMBOLS browser/config/mozconfigs/ mobile/android/config/mozconfigs/ | xargs sed -ri '/.*UPLOAD_SYMBOLS.*/d' sed -ri '/.*UPLOAD_SYMBOLS.*/d' build/unix/mozconfig.linux build/mozconfig.win-common build/macosx/local-mozconfig.common build/mozconfig.automation Then mobile/android/config/mozconfigs/common and taskcluster/scripts/builder/build-linux.sh were hand-edited. MozReview-Commit-ID: Cy8kSEodSg4

# 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 sys

from mozbuild.backend.test_manifest import TestManifestBackend
from mozbuild.base import BuildEnvironmentNotFoundException, MozbuildObject
from mozbuild.frontend.emitter import TreeMetadataEmitter
from mozbuild.frontend.reader import BuildReader, EmptyConfig


def gen_test_backend():
    build_obj = MozbuildObject.from_environment()
    try:
        config = build_obj.config_environment
    except BuildEnvironmentNotFoundException:
        print("No build detected, test metadata may be incomplete.")

        # If 'JS_STANDALONE' is set, tests that don't require an objdir won't
        # be picked up due to bug 1345209.
        substs = EmptyConfig.default_substs
        if 'JS_STANDALONE' in substs:
            del substs['JS_STANDALONE']

        config = EmptyConfig(build_obj.topsrcdir, substs)
        config.topobjdir = build_obj.topobjdir

    reader = BuildReader(config)
    emitter = TreeMetadataEmitter(config)
    backend = TestManifestBackend(config)

    context = reader.read_topsrcdir()
    data = emitter.emit(context, emitfn=emitter._process_test_manifests)
    backend.consume(data)


if __name__ == '__main__':
    sys.exit(gen_test_backend())