2015-06-16 16:42:16 +03:00
|
|
|
#! /bin/bash -vex
|
|
|
|
|
|
|
|
set -x -e
|
|
|
|
|
2015-08-27 21:13:32 +03:00
|
|
|
echo "running as" $(id)
|
|
|
|
|
2017-07-01 00:45:26 +03:00
|
|
|
. /home/worker/scripts/xvfb.sh
|
2016-07-06 17:06:58 +03:00
|
|
|
|
2015-06-16 16:42:16 +03:00
|
|
|
####
|
|
|
|
# Taskcluster friendly wrapper for performing fx desktop builds via mozharness.
|
|
|
|
####
|
|
|
|
|
|
|
|
# Inputs, with defaults
|
|
|
|
|
|
|
|
: MOZHARNESS_SCRIPT ${MOZHARNESS_SCRIPT}
|
|
|
|
: MOZHARNESS_CONFIG ${MOZHARNESS_CONFIG}
|
2016-03-17 00:11:44 +03:00
|
|
|
: MOZHARNESS_ACTIONS ${MOZHARNESS_ACTIONS}
|
2016-05-17 21:57:48 +03:00
|
|
|
: MOZHARNESS_OPTIONS ${MOZHARNESS_OPTIONS}
|
2015-06-16 16:42:16 +03:00
|
|
|
|
2017-07-01 00:45:26 +03:00
|
|
|
: TOOLTOOL_CACHE ${TOOLTOOL_CACHE:=/home/worker/tooltool-cache}
|
2015-06-16 16:42:16 +03:00
|
|
|
|
|
|
|
: NEED_XVFB ${NEED_XVFB:=false}
|
|
|
|
|
|
|
|
: MH_CUSTOM_BUILD_VARIANT_CFG ${MH_CUSTOM_BUILD_VARIANT_CFG}
|
|
|
|
: MH_BRANCH ${MH_BRANCH:=mozilla-central}
|
|
|
|
: MH_BUILD_POOL ${MH_BUILD_POOL:=staging}
|
2016-03-15 01:17:18 +03:00
|
|
|
: MOZ_SCM_LEVEL ${MOZ_SCM_LEVEL:=1}
|
2015-06-16 16:42:16 +03:00
|
|
|
|
2017-07-01 00:45:26 +03:00
|
|
|
: WORKSPACE ${WORKSPACE:=/home/worker/workspace}
|
2015-06-16 16:42:16 +03:00
|
|
|
|
|
|
|
set -v
|
|
|
|
|
2016-03-11 02:12:29 +03:00
|
|
|
fail() {
|
|
|
|
echo # make sure error message is on a new line
|
|
|
|
echo "[build-linux.sh:error]" "${@}"
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
2015-06-16 16:42:16 +03:00
|
|
|
export MOZ_CRASHREPORTER_NO_REPORT=1
|
|
|
|
export MOZ_OBJDIR=obj-firefox
|
|
|
|
export TINDERBOX_OUTPUT=1
|
|
|
|
|
2015-09-11 18:35:00 +03:00
|
|
|
# use "simple" package names so that they can be hard-coded in the task's
|
|
|
|
# extras.locations
|
|
|
|
export MOZ_SIMPLE_PACKAGE_NAME=target
|
|
|
|
|
2016-07-11 20:31:26 +03:00
|
|
|
# Do not try to upload symbols (see https://bugzilla.mozilla.org/show_bug.cgi?id=1164615)
|
2016-08-02 03:14:46 +03:00
|
|
|
export MOZ_AUTOMATION_UPLOAD_SYMBOLS=0
|
2016-07-11 20:31:26 +03:00
|
|
|
|
2015-06-16 16:42:16 +03:00
|
|
|
# Ensure that in tree libraries can be found
|
|
|
|
export LIBRARY_PATH=$LIBRARY_PATH:$WORKSPACE/src/obj-firefox:$WORKSPACE/src/gcc/lib64
|
|
|
|
|
2016-11-10 21:02:54 +03:00
|
|
|
if [[ -n ${USE_SCCACHE} ]]; then
|
|
|
|
# Point sccache at the Taskcluster proxy for AWS credentials.
|
2017-04-06 19:03:14 +03:00
|
|
|
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"
|
2016-11-10 21:02:54 +03:00
|
|
|
fi
|
|
|
|
|
2015-06-16 16:42:16 +03:00
|
|
|
# test required parameters are supplied
|
2016-03-11 02:12:29 +03:00
|
|
|
if [[ -z ${MOZHARNESS_SCRIPT} ]]; then fail "MOZHARNESS_SCRIPT is not set"; fi
|
|
|
|
if [[ -z ${MOZHARNESS_CONFIG} ]]; then fail "MOZHARNESS_CONFIG is not set"; fi
|
2015-06-16 16:42:16 +03:00
|
|
|
|
|
|
|
cleanup() {
|
2016-02-12 19:31:29 +03:00
|
|
|
local rv=$?
|
2016-07-06 17:06:58 +03:00
|
|
|
cleanup_xvfb
|
2016-02-12 19:31:29 +03:00
|
|
|
exit $rv
|
2015-06-16 16:42:16 +03:00
|
|
|
}
|
|
|
|
trap cleanup EXIT INT
|
|
|
|
|
2016-07-06 17:06:58 +03:00
|
|
|
# run XVfb in the background, if necessary
|
2015-06-16 16:42:16 +03:00
|
|
|
if $NEED_XVFB; then
|
2016-07-06 17:06:58 +03:00
|
|
|
start_xvfb '1024x768x24' 2
|
2015-06-16 16:42:16 +03:00
|
|
|
fi
|
|
|
|
|
|
|
|
# set up mozharness configuration, via command line, env, etc.
|
|
|
|
|
|
|
|
debug_flag=""
|
|
|
|
if [ 0$DEBUG -ne 0 ]; then
|
|
|
|
debug_flag='--debug'
|
|
|
|
fi
|
|
|
|
|
|
|
|
custom_build_variant_cfg_flag=""
|
|
|
|
if [ -n "${MH_CUSTOM_BUILD_VARIANT_CFG}" ]; then
|
|
|
|
custom_build_variant_cfg_flag="--custom-build-variant-cfg=${MH_CUSTOM_BUILD_VARIANT_CFG}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# $TOOLTOOL_CACHE bypasses mozharness completely and is read by tooltool_wrapper.sh to set the
|
|
|
|
# cache. However, only some mozharness scripts use tooltool_wrapper.sh, so this may not be
|
|
|
|
# entirely effective.
|
|
|
|
export TOOLTOOL_CACHE
|
|
|
|
|
|
|
|
# support multiple, space delimited, config files
|
|
|
|
config_cmds=""
|
|
|
|
for cfg in $MOZHARNESS_CONFIG; do
|
|
|
|
config_cmds="${config_cmds} --config ${cfg}"
|
|
|
|
done
|
|
|
|
|
2016-03-17 00:11:44 +03:00
|
|
|
# if MOZHARNESS_ACTIONS is given, only run those actions (completely overriding default_actions
|
|
|
|
# in the mozharness configuration)
|
|
|
|
if [ -n "$MOZHARNESS_ACTIONS" ]; then
|
|
|
|
actions=""
|
|
|
|
for action in $MOZHARNESS_ACTIONS; do
|
|
|
|
actions="$actions --$action"
|
|
|
|
done
|
|
|
|
fi
|
2015-06-16 16:42:16 +03:00
|
|
|
|
2016-05-17 21:57:48 +03:00
|
|
|
# if MOZHARNESS_OPTIONS is given, append them to mozharness command line run
|
|
|
|
# e.g. enable-pgo
|
|
|
|
if [ -n "$MOZHARNESS_OPTIONS" ]; then
|
|
|
|
options=""
|
|
|
|
for option in $MOZHARNESS_OPTIONS; do
|
|
|
|
options="$options --$option"
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
2017-07-01 00:45:26 +03:00
|
|
|
cd /home/worker
|
2016-09-30 01:40:54 +03:00
|
|
|
|
2015-09-08 22:32:38 +03:00
|
|
|
python2.7 $WORKSPACE/build/src/testing/${MOZHARNESS_SCRIPT} ${config_cmds} \
|
2015-06-16 16:42:16 +03:00
|
|
|
$debug_flag \
|
|
|
|
$custom_build_variant_cfg_flag \
|
|
|
|
--disable-mock \
|
2016-03-17 00:11:44 +03:00
|
|
|
$actions \
|
2016-05-17 21:57:48 +03:00
|
|
|
$options \
|
2015-06-16 16:42:16 +03:00
|
|
|
--log-level=debug \
|
2016-03-15 01:17:18 +03:00
|
|
|
--scm-level=$MOZ_SCM_LEVEL \
|
2015-06-16 16:42:16 +03:00
|
|
|
--work-dir=$WORKSPACE/build \
|
|
|
|
--branch=${MH_BRANCH} \
|
|
|
|
--build-pool=${MH_BUILD_POOL}
|