Revision control

Other Tools

1
# This Source Code Form is subject to the terms of the Mozilla Public
2
# License, v. 2.0. If a copy of the MPL was not distributed with this
3
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
4
5
# Used in mail/config/mozconfigs by various mozconfigs.
6
7
# Setup for build cache
8
9
# Avoid duplication if the file happens to be included twice.
10
if test -z "$NO_CACHE" -a -z "$SCCACHE_DISABLE"; then
11
12
# ${region} is set by m-c's build/mozconfig.cache
13
if test -n "$region"; then
14
# set S3 bucket according to tree (level)
15
case "${COMM_HEAD_REPOSITORY}" in
16
*hg.mozilla.org/try-comm-central*)
17
bucket=comm-central-level-1-sccache-${region}
18
;;
19
*hg.mozilla.org/comm-central*)
20
bucket=comm-central-level-3-sccache-${region}
21
;;
22
esac
23
fi
24
25
if test -n "$bucket"; then
26
mk_add_options "export SCCACHE_BUCKET=$bucket"
27
mk_add_options "export SCCACHE_NAMESERVER=169.254.169.253"
28
case "${SYSTEMROOT}" in
29
*Windows)
30
platform=win
31
;;
32
*)
33
mk_add_options "export AWS_IAM_CREDENTIALS_URL=http://taskcluster/auth/v1/aws/s3/read-write/${bucket}/?format=iam-role-compat"
34
;;
35
esac
36
37
export CCACHE="$MOZ_FETCHES_DIR/sccache/sccache${suffix}"
38
export SCCACHE_VERBOSE_STATS=1
39
mk_add_options "MOZBUILD_MANAGE_SCCACHE_DAEMON=$MOZ_FETCHES_DIR/sccache/sccache"
40
mk_add_options "UPLOAD_EXTRA_FILES+=sccache.log.gz"
41
42
case "$platform" in
43
win)
44
# sccache supports a special flag to create depfiles.
45
#TODO: bug 1318370 - move this all into toolchain.configure
46
export _DEPEND_CFLAGS='-deps$(MDDEPDIR)/$(@F).pp'
47
# Windows builds have a default wrapper that needs to be overridden
48
mk_add_options "export CC_WRAPPER="
49
mk_add_options "export CXX_WRAPPER="
50
# For now, sccache doesn't support separate PDBs so force debug info to be
51
# in object files.
52
mk_add_options "export COMPILE_PDB_FLAG="
53
mk_add_options "export HOST_PDB_FLAG="
54
mk_add_options "export MOZ_DEBUG_FLAGS=-Z7"
55
;;
56
esac
57
fi
58
59
fi # NO_CACHE && SCCACHE_DISABLE