Bug 1557785 - Update run-profileserver.sh for Windows compatibility; r=firefox-build-system-reviewers,chmanchester
authorMike Shal <mshal@mozilla.com>
Wed, 19 Jun 2019 22:05:41 +0000
changeset 480091 2989571031f9691269ef4441129432d31c5b66dc
parent 480090 1bc6ee0c6672a37dd40e4ca5e0c8331042bb2781
child 480092 516aa5eb97328ea43f3a2c2a7de17c947d023f79
push id36201
push usercsabou@mozilla.com
push dateWed, 26 Jun 2019 03:57:29 +0000
treeherdermozilla-central@a3cad1d7836c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfirefox-build-system-reviewers, chmanchester
bugs1557785
milestone69.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
taskcluster/ci/generate-profile/kind.yml
taskcluster/scripts/misc/run-profileserver.sh
--- a/taskcluster/ci/generate-profile/kind.yml
+++ b/taskcluster/ci/generate-profile/kind.yml
@@ -28,16 +28,18 @@ jobs:
         shipping-product: firefox
         index:
             product: firefox
             job-name: linux64-profile
         treeherder:
             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:
                 - type: file
                   name: public/build/profdata.tar.xz
                   path: /builds/worker/artifacts/profdata.tar.xz
                 - type: file
                   name: public/build/xvfb.log
--- a/taskcluster/scripts/misc/run-profileserver.sh
+++ b/taskcluster/scripts/misc/run-profileserver.sh
@@ -1,41 +1,44 @@
 #! /bin/bash -vex
 
 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
 
 # Fail the build if for some reason we didn't collect any profile data.
 if test -z "$(find . -maxdepth 1 -name '*.profraw' -print -quit)"; then
     echo "ERROR: no profile data produced"
     exit 1
 fi