Bug 1492664 - generate portable URLs for Android mach commands; r=nalexander
[gecko.git] / build / mozconfig.cache
blob3111e1c700149c74d63dd8c46a0c66f95715234b
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/.
5 # Setup for build cache
7 # builds where buildprops didn't have the data (eg: taskcluster) and without sccache disabled:
8 if test -z "$bucket" -a -z "$SCCACHE_DISABLE" -a -z "$MOZ_PGO"; then
10     # prevent rerun if az is set, or wget is not available
11     if test -z "$availability_zone" -a -x "$(command -v wget)"; then
12         if test -n "${TASKCLUSTER_WORKER_GROUP}"; then
13             # TASKCLUSTER_WORKER_GROUP is just the region now, so
14             # stick an extra character on to make the already-convoluted logic
15             # here simpler.
16             availability_zone="${TASKCLUSTER_WORKER_GROUP}x"
17         else
18             # timeout after 1 second, and don't retry (failure indicates instance is not in ec2 or network issue)
19             # availability_zone is of the form <region><letter> where region is e.g. us-west-2, and az is us-west-2a
20             availability_zone=$(wget -T 1 -t 1 -q -O - http://169.254.169.254/latest/meta-data/placement/availability-zone || true)
21         fi
22         if test -z "$availability_zone" -o "$availability_zone" = "not-ec2"; then
23             availability_zone=not-ec2
24         else
25             # region is az with last letter trimmed
26             region=${availability_zone%?}
27             # set S3 bucket according to tree (level)
28             case "${GECKO_HEAD_REPOSITORY}" in
29             *hg.mozilla.org/try*)
30                 bucket=taskcluster-level-1-sccache-${region}
31                 ;;
32             *hg.mozilla.org/integration/autoland*|*hg.mozilla.org/integration/mozilla-inbound*)
33                 bucket=taskcluster-level-3-sccache-${region}
34                 ;;
35             esac
37             # set a dummy master
38             case "${region}" in
39             eu-central-1)
40                 master=dummy.euc1.mozilla.com
41                 ;;
42             us-east-1)
43                 master=dummy.use1.mozilla.com
44                 ;;
45             us-west-1)
46                 master=dummy.usw1.mozilla.com
47                 ;;
48             us-west-2)
49                 master=dummy.usw2.mozilla.com
50                 ;;
51             esac
52         fi
53     fi
56 # if platform hasn't been determined from buildprops, and we're on windows,
57 # it must be set to prevent adding ac_add_options --with-ccache below
58 if test -z "$platform"; then
59     # set platform based on the SYSTEMROOT env var
60     case "${SYSTEMROOT}" in
61     *Windows)
62         platform=windows
63         suffix=.exe
64         ;;
65     esac
68 if test -n "$bucket"; then
69     mk_add_options "export SCCACHE_BUCKET=$bucket"
70     case "$master" in
71     *us[ew][12].mozilla.com*|*euc1.mozilla.com*)
72         mk_add_options "export SCCACHE_NAMESERVER=169.254.169.253"
73         ;;
74     esac
75     export CCACHE="$topsrcdir/sccache2/sccache${suffix}"
76     export SCCACHE_VERBOSE_STATS=1
77     mk_add_options MOZBUILD_MANAGE_SCCACHE_DAEMON=${topsrcdir}/sccache2/sccache
78     case "$platform" in
79     win*)
80         # For now, sccache doesn't support separate PDBs so force debug info to be
81         # in object files.
82         mk_add_options "export COMPILE_PDB_FLAG="
83         mk_add_options "export HOST_PDB_FLAG="
84         mk_add_options "export MOZ_DEBUG_FLAGS=-Z7"
85         ;;
86     esac