moz.build
author Gregory Szorc <gps@mozilla.com>
Tue, 24 May 2016 11:35:44 -0700
changeset 298842 32886f06e0fb2a5c2b58d49500b3baee59e970d4
parent 297659 c3e24e94ab5148ad92a3f137d6cab9d8bebdd6a7
child 306106 3ec6380fca8207fa199693206a3ca24975bf9833
permissions -rw-r--r--
Bug 1274655 - Resolve changeset when only repo is defined; r=mshal Previously, we required both or none of MOZ_SOURCE_REPO and MOZ_SOURCE_CHANGESET to be defined. This logic was established in 51029f4d82d3 (bug 1247162). There appears to be no good reason why we require MOZ_SOURCE_CHANGESET if MOZ_SOURCE_REPO is defined. After all, if we have a checkout we should be able to resolve the revision. This commit changes the logic to resolve the changeset when not defined. We still error if MOZ_SOURCE_REPO is defined but we can't resolve the changeset. I can't imagine this breaking anything. This change will be necessary to appease TaskCluster tasks once mozharness is changed in a subsequent commit to define MOZ_SOURCE_REPO. Buildbot and TC each have their own way of specifying the source revision. Rather than change mozharness, it feels easier to just have the build system derive things. This decision is further justified by the fact there is a chicken and egg problem in mozharness: the environment variable dict is resolved before source directory population. So, we'd need to teach mozharness about TC's VCS mechanism, which it currently has no knowledge of. I'd rather not do that. MozReview-Commit-ID: ANaoGbPGWj2

# -*- Mode: python; c-basic-offset: 4; 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 http://mozilla.org/MPL/2.0/.

with Files('**/Makefile.in'):
    BUG_COMPONENT = ('Core', 'Build Config')
    FINAL = True

FILES_PER_UNIFIED_FILE = 1

CONFIGURE_SUBST_FILES += [
    'config/autoconf.mk',
    'config/emptyvars.mk',
]

if CONFIG['ENABLE_CLANG_PLUGIN']:
    DIRS += ['build/clang-plugin']

DIRS += [
    'config',
    'python',
    'taskcluster',
]

if not CONFIG['JS_STANDALONE']:
    CONFIGURE_SUBST_FILES += [
        'tools/update-packaging/Makefile',
    ]
    CONFIGURE_DEFINE_FILES += [
        'mozilla-config.h',
    ]
    EXPORTS += [
        '!buildid.h',
        '!mozilla-config.h',
        '!source-repo.h',
    ]

    GENERATED_FILES += [
        'buildid.h',
        'source-repo.h',
    ]

    GENERATED_FILES['buildid.h'].script = 'build/variables.py:buildid_header'
    GENERATED_FILES['source-repo.h'].script = 'build/variables.py:source_repo_header'

    DIRS += [
        'build',
        'probes',
    ]

DIRS += [
    'config/external/fdlibm',
    'config/external/nspr',
    'config/external/zlib',
    'memory',
    'mfbt',
    'mozglue',
]

if not CONFIG['JS_STANDALONE']:
    DIRS += ['xpcom/xpidl']

if CONFIG['USE_ICU']:
    DIRS += ['config/external/icu']

if CONFIG['COMPILE_ENVIRONMENT']:

    if not CONFIG['JS_STANDALONE']:
        DIRS += [
            'config/external',
            'config/external/nss',
        ]

    if CONFIG['BUILD_CTYPES']:
        DIRS += ['config/external/ffi']

    DIRS += ['js/src']
else:
    TEST_DIRS += ['js/src/tests']

if not CONFIG['JS_STANDALONE'] and CONFIG['MOZ_BUILD_APP']:
    # Bring in the configuration for the configured application.
    include('/' + CONFIG['MOZ_BUILD_APP'] + '/app.mozbuild')

include('build/templates.mozbuild')