build/mozconfig.sccache
author Masatoshi Kimura <VYV03354@nifty.ne.jp>
Sat, 17 Mar 2018 19:16:45 +0900
changeset 30476 43daf17883d1e37688af61ed84f0a1a87ad85324
parent 29890 678d7a3b822aa27c2d7371b7b9596e89fb753cda
child 30851 8dc4a26ee33fbb0306c33d744e23180888df7265
permissions -rw-r--r--
Bug 1445853 - Work-around for mailbox:// URL not supporting UTF-8 paths. r=jorgk a=jorgk

# 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/.

# Setup for build cache

if [ "$MOZ_IS_COMM_TOPDIR" != "1" ]; then

# Avoid duplication if the file happens to be included twice.
if test -z "$NO_CACHE" -a -z "$SCCACHE_DISABLE"; then

# ${region} is set by m-c's build/mozconfig.cache
if test -n "$region"; then
    # set S3 bucket according to tree (level)
    case "${COMM_HEAD_REPOSITORY}" in
    *hg.mozilla.org/try-comm-central*)
	bucket=comm-central-level-1-sccache-${region}
	;;
    *hg.mozilla.org/comm-central*)
	bucket=comm-central-level-3-sccache-${region}
	;;
    esac
fi

if test -n "$bucket"; then
    mk_add_options "export SCCACHE_BUCKET=$bucket"
    mk_add_options "export SCCACHE_NAMESERVER=169.254.169.253"
    case "${SYSTEMROOT}" in
    *Windows)
        platform=win
	;;
    *)
        mk_add_options "export AWS_IAM_CREDENTIALS_URL=http://taskcluster/auth/v1/aws/s3/read-write/${bucket}/?format=iam-role-compat"
	;;
    esac

    export CCACHE="$topsrcdir/sccache2/sccache${suffix}"
    export SCCACHE_VERBOSE_STATS=1
    mk_add_options "MOZBUILD_MANAGE_SCCACHE_DAEMON=${topsrcdir}/sccache2/sccache"
    mk_add_options "UPLOAD_EXTRA_FILES+=sccache.log.gz"

    case "$platform" in
    win)
        # sccache supports a special flag to create depfiles.
        #TODO: bug 1318370 - move this all into toolchain.configure
        export _DEPEND_CFLAGS='-deps$(MDDEPDIR)/$(@F).pp'
        # Windows builds have a default wrapper that needs to be overridden
        mk_add_options "export CC_WRAPPER="
        mk_add_options "export CXX_WRAPPER="
        # For now, sccache doesn't support separate PDBs so force debug info to be
        # in object files.
        mk_add_options "export COMPILE_PDB_FLAG="
        mk_add_options "export HOST_PDB_FLAG="
        mk_add_options "export MOZ_DEBUG_FLAGS=-Z7"
        ;;
    esac
fi

fi # NO_CACHE && SCCACHE_DISABLE

fi # MOZ_IS_COMM_TOPDIR