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
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"
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=$?