bug 1350093 - fix sccache configuration to handle changes in the format of TASKCLUSTER_WORKER_GROUP. r?froydnj draft
authorTed Mielczarek <ted@mielczarek.org>
Thu, 06 Apr 2017 12:03:14 -0400
changeset 557289 0e9ed97c75179251da4237d72c0257d14f20f324
parent 556946 3c68d659c2b715f811708f043a1e7169d77be2ba
child 623010 d172144ac8056cd6223df946c83060b8b8e5f08d
push id52673
push userbmo:ted@mielczarek.org
push dateThu, 06 Apr 2017 16:03:40 +0000
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
--- a/build/mozconfig.cache
+++ b/build/mozconfig.cache
@@ -44,17 +44,20 @@ 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.x
+            availability_zone="${TASKCLUSTER_WORKER_GROUP}x"
             # 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 - || true)
         if test -z "$availability_zone" -o "$availability_zone" = "not-ec2"; then
--- 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)
 # 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"
 # 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=$?