Bug 1821117 [wpt PR 38888] - Expose desired{Execution|Render}Start in LoAF+ScriptTimi...
[gecko.git] / taskcluster / scripts / misc / run-profileserver.sh
blobdd0ad31f05a049a64ebdc5fff6dba1286b4009b2
1 #! /bin/bash -vex
3 set -x -e
5 echo "running as" $(id)
7 : NEED_XVFB ${NEED_XVFB:=false}
8 : UPLOAD_PATH ${UPLOAD_PATH:=$HOME/artifacts}
9 export UPLOAD_PATH
11 ####
12 # Taskcluster friendly wrapper for running the profileserver
13 ####
15 PGO_RUNDIR=obj-firefox/dist
16 export JARLOG_FILE="en-US.log"
17 export LLVM_PROFDATA=$MOZ_FETCHES_DIR/clang/bin/llvm-profdata
19 set -v
21 if $NEED_XVFB; then
22 # run XVfb in the background
23 . /builds/worker/scripts/xvfb.sh
25 cleanup() {
26 local rv=$?
27 cleanup_xvfb
28 exit $rv
30 trap cleanup EXIT INT
32 start_xvfb '1024x768x24' 2
35 # Move our fetched firefox into objdir/dist so the jarlog entries will match
36 # the paths when the final PGO stage packages the build.
37 mkdir -p $PGO_RUNDIR
38 mkdir -p $UPLOAD_PATH
39 mv $MOZ_FETCHES_DIR/firefox $PGO_RUNDIR
40 ./mach python build/pgo/profileserver.py --binary $PGO_RUNDIR/firefox/firefox
42 tar -acvf $UPLOAD_PATH/profdata.tar.xz merged.profdata en-US.log