bug 1350093 - fix sccache configuration to handle changes in the format of TASKCLUSTER_WORKER_GROUP. r=froydnj
authorTed Mielczarek <ted@mielczarek.org>
Thu, 06 Apr 2017 12:03:14 -0400
changeset 351740 cdb69724b904d4fdd66e3ccf66f0b8c162511479
parent 351739 af12e840ff41bf879d5fc0ca3134db04561a1d22
child 351741 8a3519624432cad53d657ab0452f3ca11aafd936
push id31621
push userarchaeopteryx@coole-files.de
push dateFri, 07 Apr 2017 20:14:04 +0000
treeherdermozilla-central@35c7be9c2db2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1350093
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 1350093 - fix sccache configuration to handle changes in the format of TASKCLUSTER_WORKER_GROUP. r=froydnj The TASKCLUSTER_WORKER_GROUP environment variable used to contain the full AWS availability zone, but a recent docker-worker change changed it to be simply the AWS region, which broke sccache in taskcluster because we were using it as part of the S3 bucket name. MozReview-Commit-ID: 1KsfWpB4PoY
build/mozconfig.cache
taskcluster/scripts/builder/build-linux.sh
--- a/build/mozconfig.cache
+++ b/build/mozconfig.cache
@@ -44,17 +44,20 @@ fi
 fi
 
 # builds where buildprops didn't have the data (eg: taskcluster or non-buildbot) and without sccache disabled:
 if test -z "$bucket" -a -z "$SCCACHE_DISABLE" -a -z "$no_sccache" -a -z "$MOZ_PGO_IS_SET" -a -z "$MOZ_PGO"; then
 
     # prevent rerun if az is set, or wget is not available
     if test -z "$availability_zone" -a -x "$(command -v wget)"; then
         if test -n "${TASKCLUSTER_WORKER_GROUP}"; then
-            availability_zone="${TASKCLUSTER_WORKER_GROUP}"
+            # TASKCLUSTER_WORKER_GROUP is just the region now, so
+            # stick an extra character on to make the already-convoluted logic
+            # here simpler.
+            availability_zone="${TASKCLUSTER_WORKER_GROUP}x"
         else
             # timeout after 1 second, and don't retry (failure indicates instance is not in ec2 or network issue)
             # availability_zone is of the form <region><letter> where region is e.g. us-west-2, and az is us-west-2a
             availability_zone=$(wget -T 1 -t 1 -q -O - http://169.254.169.254/latest/meta-data/placement/availability-zone || true)
         fi
         if test -z "$availability_zone" -o "$availability_zone" = "not-ec2"; then
             availability_zone=not-ec2
         else
--- a/taskcluster/scripts/builder/build-linux.sh
+++ b/taskcluster/scripts/builder/build-linux.sh
@@ -47,17 +47,17 @@ export MOZ_SIMPLE_PACKAGE_NAME=target
 # Do not try to upload symbols (see https://bugzilla.mozilla.org/show_bug.cgi?id=1164615)
 export MOZ_AUTOMATION_UPLOAD_SYMBOLS=0
 
 # Ensure that in tree libraries can be found
 export LIBRARY_PATH=$LIBRARY_PATH:$WORKSPACE/src/obj-firefox:$WORKSPACE/src/gcc/lib64
 
 if [[ -n ${USE_SCCACHE} ]]; then
     # Point sccache at the Taskcluster proxy for AWS credentials.
-    export AWS_IAM_CREDENTIALS_URL="http://taskcluster/auth/v1/aws/s3/read-write/taskcluster-level-${MOZ_SCM_LEVEL}-sccache-${TASKCLUSTER_WORKER_GROUP%?}/?format=iam-role-compat"
+    export AWS_IAM_CREDENTIALS_URL="http://taskcluster/auth/v1/aws/s3/read-write/taskcluster-level-${MOZ_SCM_LEVEL}-sccache-${TASKCLUSTER_WORKER_GROUP}/?format=iam-role-compat"
 fi
 
 # test required parameters are supplied
 if [[ -z ${MOZHARNESS_SCRIPT} ]]; then fail "MOZHARNESS_SCRIPT is not set"; fi
 if [[ -z ${MOZHARNESS_CONFIG} ]]; then fail "MOZHARNESS_CONFIG is not set"; fi
 
 cleanup() {
     local rv=$?