Bug 1318565 - Allow extensions with permission to read from tainted Canvas r=bz
[gecko.git] / build / mozconfig.cache
blob86997dcdbacc7018cfce4a0b3b21f4d8b0a5ae7b
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 # Avoid duplication if the file happens to be included twice.
8 if test -z "$bucket" -a -z "$NO_CACHE"; then
10 # buildbot (or builders that use buildprops.json):
11 if [ -f $topsrcdir/../buildprops.json ]; then
12 read branch platform master <<EOF
13 $(python2.7 -c 'import json; p = json.loads(open("'"$topsrcdir"'/../buildprops.json").read())["properties"]; print p["branch"], p["platform"], p["master"]' 2> /dev/null)
14 EOF
16 bucket=
17 if test -z "$SCCACHE_DISABLE" -a -z "$no_sccache" -a -z "$MOZ_PGO_IS_SET" -a -z "$MOZ_PGO"; then
18     case "${branch}" in
19     try)
20         case "${master}" in
21         *scl1.mozilla.com*|*.scl3.mozilla.com*)
22             bucket=mozilla-releng-s3-cache-us-west-1-try
23             ;;
24         *use1.mozilla.com*)
25             bucket=mozilla-releng-s3-cache-us-east-1-try
26             ;;
27         *usw2.mozilla.com*)
28             bucket=mozilla-releng-s3-cache-us-west-2-try
29             ;;
30         esac
31         ;;
32     autoland|mozilla-inbound)
33         case "${master}" in
34         *use1.mozilla.com*)
35             bucket=mozilla-releng-s3-cache-us-east-1-prod
36             ;;
37         *usw2.mozilla.com*)
38             bucket=mozilla-releng-s3-cache-us-west-2-prod
39             ;;
40         esac
41         ;;
42     esac
46 # builds where buildprops didn't have the data (eg: taskcluster or non-buildbot) and without sccache disabled:
47 if test -z "$bucket" -a -z "$SCCACHE_DISABLE" -a -z "$no_sccache" -a -z "$MOZ_PGO_IS_SET" -a -z "$MOZ_PGO"; then
49     # prevent rerun if az is set, or wget is not available
50     if test -z "$availability_zone" -a -x "$(command -v wget)"; then
51         if test -n "${TASKCLUSTER_WORKER_GROUP}"; then
52             # TASKCLUSTER_WORKER_GROUP is just the region now, so
53             # stick an extra character on to make the already-convoluted logic
54             # here simpler.
55             availability_zone="${TASKCLUSTER_WORKER_GROUP}x"
56         else
57             # timeout after 1 second, and don't retry (failure indicates instance is not in ec2 or network issue)
58             # availability_zone is of the form <region><letter> where region is e.g. us-west-2, and az is us-west-2a
59             availability_zone=$(wget -T 1 -t 1 -q -O - http://169.254.169.254/latest/meta-data/placement/availability-zone || true)
60         fi
61         if test -z "$availability_zone" -o "$availability_zone" = "not-ec2"; then
62             availability_zone=not-ec2
63         else
64             # region is az with last letter trimmed
65             region=${availability_zone%?}
66             # set S3 bucket according to tree (level)
67             case "${GECKO_HEAD_REPOSITORY}" in
68             *hg.mozilla.org/try*)
69                 bucket=taskcluster-level-1-sccache-${region}
70                 ;;
71             *hg.mozilla.org/integration/autoland*|*hg.mozilla.org/integration/mozilla-inbound*)
72                 bucket=taskcluster-level-3-sccache-${region}
73                 ;;
74             esac
76             # set a dummy master
77             case "${region}" in
78             eu-central-1)
79                 master=dummy.euc1.mozilla.com
80                 ;;
81             us-east-1)
82                 master=dummy.use1.mozilla.com
83                 ;;
84             us-west-1)
85                 master=dummy.usw1.mozilla.com
86                 ;;
87             us-west-2)
88                 master=dummy.usw2.mozilla.com
89                 ;;
90             esac
91         fi
92     fi
95 # if platform hasn't been determined from buildprops, and we're on windows,
96 # it must be set to prevent adding ac_add_options --with-ccache below
97 if test -z "$platform"; then
98     # set platform based on the SYSTEMROOT env var
99     case "${SYSTEMROOT}" in
100     *Windows)
101         platform=windows
102         suffix=.exe
103         ;;
104     esac
107 if test -z "$bucket"; then
108     case "$platform" in
109     win*) : ;;
110     *)
111         ac_add_options --with-ccache
112     esac
113 else
114     mk_add_options "export SCCACHE_BUCKET=$bucket"
115     case "$master" in
116     *us[ew][12].mozilla.com*|*euc1.mozilla.com*)
117         mk_add_options "export SCCACHE_NAMESERVER=169.254.169.253"
118         ;;
119     esac
120     ac_add_options "--with-ccache=$topsrcdir/sccache2/sccache${suffix}"
121     export SCCACHE_VERBOSE_STATS=1
122     mk_add_options MOZ_PREFLIGHT_ALL+=build/sccache.mk
123     mk_add_options MOZ_POSTFLIGHT_ALL+=build/sccache.mk
124     mk_add_options "UPLOAD_EXTRA_FILES+=sccache.log.gz"
125     case "$platform" in
126     win*)
127         # sccache supports a special flag to create depfiles.
128         #TODO: bug 1318370 - move this all into toolchain.configure
129         export _DEPEND_CFLAGS='-deps$(MDDEPDIR)/$(@F).pp'
130         # Windows builds have a default wrapper that needs to be overridden
131         mk_add_options "export CC_WRAPPER="
132         mk_add_options "export CXX_WRAPPER="
133         # For now, sccache doesn't support separate PDBs so force debug info to be
134         # in object files.
135         mk_add_options "export COMPILE_PDB_FLAG="
136         mk_add_options "export HOST_PDB_FLAG="
137         mk_add_options "export MOZ_DEBUG_FLAGS=-Z7"
138         ;;
139     esac