# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Setup for build cache
# Thunderbird builds will set prior to including this file
aws_prefix=${aws_prefix:-taskcluster}
gcp_prefix=${gcp_prefix:-sccache}
if test -n "$SCCACHE_DISABLE" -a -n "$USE_SCCACHE"; then
echo "SetupError: SCCACHE_DISABLE and USE_SCCACHE should not be set at the same time" >&yle='color: green'>2
exit 1
fi
# builds where buildprops didn't have the data (eg: taskcluster) and without sccache disabled:
if test -z "$bucket" -a -z "$SCCACHE_DISABLE"; then
if test -n "$bucket"; then
if test "$cloud" = "google"; then
mk_add_options "export SCCACHE_GCS_BUCKET=$bucket"
mk_add_options "export SCCACHE_GCS_RW_MODE=READ_WRITE"
mk_add_options "export SCCACHE_GCS_CREDENTIALS_URL=http://taskcluster/auth/v1/gcp/credentials/$SCCACHE_GCS_PROJECT/${serviceaccount}@$SCCACHE_GCS_PROJECT.iam.gserviceaccount.com"
elif [ -n "${SCCACHE_GCS_KEY_PATH}" ]; then
mk_add_options "export SCCACHE_GCS_BUCKET=$bucket"
else
mk_add_options "export SCCACHE_BUCKET=$bucket"
# instruct sccache to fetch the credentials from the Auth service's awsS3Credentials endpoint, via the Taskcluster proxy.
mk_add_options "export AWS_IAM_CREDENTIALS_URL=http://taskcluster/auth/v1/aws/s3/read-write/${bucket}/?format=iam-role-compat"
fi
export CCACHE="sccache"
export SCCACHE_VERBOSE_STATS=1
# Workaround for https://github.com/mozilla/sccache/issues/459#issuecomment-618756635
mk_add_options "export SCCACHE_MAX_FRAME_LENGTH=50000000"
mk_add_options MOZBUILD_MANAGE_SCCACHE_DAEMON=${MOZ_FETCHES_DIR}/sccache/sccache
elif test -n "$USE_SCCACHE"; then
echo "SetupError: sccache is enabled but there is no shared storage set up for it?" >&'color: green'>2
exit 1
fi
[Dauer der Verarbeitung: 0.14 Sekunden, vorverarbeitet 2026-06-05]