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)
|
|
|
|
|
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}
|
2017-11-15 01:16:22 +03:00
|
|
|
: MOZHARNESS_CONFIG_PATHS ${MOZHARNESS_CONFIG_PATHS}
|
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-08-28 14:44:51 +03:00
|
|
|
: TOOLTOOL_CACHE ${TOOLTOOL_CACHE:=/builds/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-08-28 14:44:51 +03:00
|
|
|
: WORKSPACE ${WORKSPACE:=/builds/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
|
|
|
|
|
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
|
|
|
|
|
|
|
|
# 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
|
2018-04-24 02:39:35 +03:00
|
|
|
if [[ -z "${MOZHARNESS_CONFIG}" && -z "${EXTRA_MOZHARNESS_CONFIG}" ]]; then fail "MOZHARNESS_CONFIG or EXTRA_MOZHARNESS_CONFIG is not set"; fi
|
2015-06-16 16:42:16 +03:00
|
|
|
|
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
|
2017-09-15 21:52:24 +03:00
|
|
|
. /builds/worker/scripts/xvfb.sh
|
|
|
|
|
|
|
|
cleanup() {
|
|
|
|
local rv=$?
|
|
|
|
cleanup_xvfb
|
|
|
|
exit $rv
|
|
|
|
}
|
|
|
|
trap cleanup EXIT INT
|
|
|
|
|
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
|
|
|
|
|
2017-11-15 01:16:22 +03:00
|
|
|
config_path_cmds=""
|
|
|
|
for path in ${MOZHARNESS_CONFIG_PATHS}; do
|
2019-04-05 18:39:50 +03:00
|
|
|
config_path_cmds="${config_path_cmds} --extra-config-path ${GECKO_PATH}/${path}"
|
2017-11-15 01:16:22 +03:00
|
|
|
done
|
|
|
|
|
2015-06-16 16:42:16 +03:00
|
|
|
# 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
|
|
|
|
if [ -n "$MOZHARNESS_OPTIONS" ]; then
|
|
|
|
options=""
|
|
|
|
for option in $MOZHARNESS_OPTIONS; do
|
|
|
|
options="$options --$option"
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
2017-08-28 14:44:51 +03:00
|
|
|
cd /builds/worker
|
2016-09-30 01:40:54 +03:00
|
|
|
|
2019-04-05 18:39:50 +03:00
|
|
|
$GECKO_PATH/mach python $GECKO_PATH/testing/${MOZHARNESS_SCRIPT} \
|
2017-11-15 01:16:22 +03:00
|
|
|
${config_path_cmds} \
|
|
|
|
${config_cmds} \
|
2015-06-16 16:42:16 +03:00
|
|
|
$debug_flag \
|
|
|
|
$custom_build_variant_cfg_flag \
|
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 \
|
|
|
|
--work-dir=$WORKSPACE/build \
|
|
|
|
--branch=${MH_BRANCH} \
|
|
|
|
--build-pool=${MH_BUILD_POOL}
|