Bug 1557785 - Update run-profileserver.sh for Windows compatibility; r=firefox-build-system-reviewers,chmanchester

The run-profileserver.sh script is a bridge between the Taskcluster task
and profileserver.py. It was originally written as a Linux-only script,
but with a few modifications it can support Windows as well. The xvfb
support needs to be optional, and the UPLOAD_PATH and PGO_RUNDIR
variables must not assume a Linux filesystem.

Differential Revision: https://phabricator.services.mozilla.com/D34796

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Mike Shal 2019-06-19 22:05:41 +00:00
parent 3bdb950687
commit f1f2c9715a
2 changed files with 18 additions and 13 deletions

View File

@ -33,6 +33,8 @@ jobs:
platform: linux64-shippable/opt
worker-type: b-linux
worker:
env:
NEED_XVFB: "true"
max-run-time: 1200
docker-image: {in-tree: debian9-amd64-build}
artifacts:

View File

@ -4,33 +4,36 @@ set -x -e
echo "running as" $(id)
: NEED_XVFB ${NEED_XVFB:=false}
: UPLOAD_PATH ${UPLOAD_PATH:=$HOME/artifacts}
####
# Taskcluster friendly wrapper for running the profileserver
####
PGO_RUNDIR=/builds/worker/workspace/build/src/obj-firefox/dist
export UPLOAD_PATH=$HOME/artifacts
PGO_RUNDIR=obj-firefox/dist
export JARLOG_FILE="en-US.log"
set -v
# run XVfb in the background
. /builds/worker/scripts/xvfb.sh
if $NEED_XVFB; then
# run XVfb in the background
. /builds/worker/scripts/xvfb.sh
cleanup() {
local rv=$?
cleanup_xvfb
exit $rv
}
trap cleanup EXIT INT
cleanup() {
local rv=$?
cleanup_xvfb
exit $rv
}
trap cleanup EXIT INT
start_xvfb '1024x768x24' 2
cd /builds/worker/checkouts/gecko
start_xvfb '1024x768x24' 2
fi
# Move our fetched firefox into objdir/dist so the jarlog entries will match
# the paths when the final PGO stage packages the build.
mkdir -p $PGO_RUNDIR
mkdir -p $UPLOAD_PATH
mv $MOZ_FETCHES_DIR/firefox $PGO_RUNDIR
./mach python build/pgo/profileserver.py --binary $PGO_RUNDIR/firefox/firefox