Bug 1469697 - s/GECKO_DIR/GECKO_PATH/ for hazard build scripts. r=nalexander
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 13 Aug 2019 16:30:41 +0900
changeset 488142 993f7ea9b2604c98fecc95225176b238b2aec491
parent 488141 a1e9b49557436acb5dbb7e25668daebb3c5134c3
child 488143 a90eaeb660775d216ab0c011687a9c15dbf7ee59
push id36435
push usercbrindusan@mozilla.com
push dateThu, 15 Aug 2019 09:46:49 +0000
treeherdermozilla-central@0db07ff50ab5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander
bugs1469697
milestone70.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 1469697 - s/GECKO_DIR/GECKO_PATH/ for hazard build scripts. r=nalexander Most other tasks use GECKO_PATH, as that's what run-task uses. Differential Revision: https://phabricator.services.mozilla.com/D41725
js/src/devtools/rootAnalysis/README.md
js/src/devtools/rootAnalysis/run-analysis.sh
taskcluster/scripts/builder/build-haz-linux.sh
taskcluster/scripts/builder/hazard-analysis.sh
taskcluster/taskgraph/transforms/job/hazard.py
--- a/js/src/devtools/rootAnalysis/README.md
+++ b/js/src/devtools/rootAnalysis/README.md
@@ -71,30 +71,30 @@ 3.  Install taskcluster-vcs, eg by doing
         npm install taskcluster-vcs
         export PATH="$PATH:$(pwd)/node_modules/.bin"
 
 4. In some directory, using $SRCDIR as the top of your Gecko source checkout,
     run these commands:
 
         mkdir work
         cd work
-        ( export GECKO_DIR=$SRCDIR; $GECKO_DIR/taskcluster/scripts/builder/build-haz-linux.sh $(pwd) --dep )
+        ( export GECKO_PATH=$SRCDIR; $GECKO_PATH/taskcluster/scripts/builder/build-haz-linux.sh $(pwd) --dep )
 
 The `--dep` is optional, and will avoid rebuilding the JS shell used to run the
 analysis later.
 
 If you see the error ``/lib/../lib64/crti.o: unrecognized relocation (0x2a) in section .init`` then have a version mismatch between the precompiled gcc used in automation and your installed glibc. The easiest way to fix this is to delete the ld provided with the precompiled gcc (it will be in two places, one given in the first part of the error message), which will cause gcc to fall back to your system ld. But you will need to additionally pass ``--no-tooltool`` to build-haz-linux.sh. With the current package, you could do the deletion with
 
     rm gcc/bin/ld
     rm gcc/x86_64-unknown-linux-gnu/bin/ld
 
 Output goes to `analysis/hazards.txt`. This will run the
 analysis on the js/src tree only; if you wish to analyze the full browser, use
 
-    ( export GECKO_DIR=$SRCDIR; $GECKO_DIR/taskcluster/scripts/builder/build-haz-linux.sh --project browser $(pwd) )
+    ( export GECKO_PATH=$SRCDIR; $GECKO_PATH/taskcluster/scripts/builder/build-haz-linux.sh --project browser $(pwd) )
 
 After running the analysis once, you can reuse the `*.xdb` database files
 generated, using modified analysis scripts, by running
 `analysis/run-analysis.sh` (or pass `--list` to see ways to select even more
 restrictive parts of the overall analysis; the default is `gcTypes` which will
 do everything but regenerate the xdb files).
 
 Also, you can pass `-v` to get exact command lines to cut & paste for running the
--- a/js/src/devtools/rootAnalysis/run-analysis.sh
+++ b/js/src/devtools/rootAnalysis/run-analysis.sh
@@ -1,4 +1,4 @@
 #!/bin/sh
 
 SRCDIR=$(cd $(dirname $0)/../../../..; pwd)
-GECKO_DIR=$SRCDIR $SRCDIR/taskcluster/scripts/builder/build-haz-linux.sh $(pwd) "$@"
+GECKO_PATH=$SRCDIR $SRCDIR/taskcluster/scripts/builder/build-haz-linux.sh $(pwd) "$@"
--- a/taskcluster/scripts/builder/build-haz-linux.sh
+++ b/taskcluster/scripts/builder/build-haz-linux.sh
@@ -31,37 +31,36 @@ SCRIPT_FLAGS=$*
 
 # Ensure all the scripts in this dir are on the path....
 DIRNAME=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
 PATH=$DIRNAME:$PATH
 
 # Use GECKO_BASE_REPOSITORY as a signal for whether we are running in automation.
 export AUTOMATION=${GECKO_BASE_REPOSITORY:+1}
 
-: "${GECKO_DIR:="$DIRNAME"/../../..}"
+: "${GECKO_PATH:="$DIRNAME"/../../..}"
 : "${TOOLTOOL_CACHE:=$WORKSPACE/tt-cache}"
 
-if ! [ -d "$GECKO_DIR" ]; then
-    echo "GECKO_DIR must be set to a directory containing a gecko source checkout" >&2
+if ! [ -d "$GECKO_PATH" ]; then
+    echo "GECKO_PATH must be set to a directory containing a gecko source checkout" >&2
     exit 1
 fi
-GECKO_DIR="$( cd "$GECKO_DIR" && pwd )"
 
 # Directory to populate with tooltool-installed tools
 export TOOLTOOL_DIR="$WORKSPACE"
 
 # Directory to hold the (useless) object files generated by the analysis.
 export MOZ_OBJDIR="$WORKSPACE/obj-analyzed"
 mkdir -p "$MOZ_OBJDIR"
 
 if [ -n "$DO_TOOLTOOL" ]; then (
     cd "$TOOLTOOL_DIR"
-    "$GECKO_DIR"/mach artifact toolchain -v\
+    "$GECKO_PATH"/mach artifact toolchain -v\
                 ${TOOLTOOL_MANIFEST:+ --tooltool-url https://tooltool.mozilla-releng.net/ \
-                                      --tooltool-manifest "$GECKO_DIR/$TOOLTOOL_MANIFEST"} \
+                                      --tooltool-manifest "$GECKO_PATH/$TOOLTOOL_MANIFEST"} \
                 --cache-dir "$TOOLTOOL_CACHE"${MOZ_TOOLCHAINS:+ ${MOZ_TOOLCHAINS}}
 ) fi
 
 export NO_MERCURIAL_SETUP_CHECK=1
 
 if [[ "$PROJECT" = "browser" ]]; then (
     cd "$WORKSPACE"
     set "$WORKSPACE"
--- a/taskcluster/scripts/builder/hazard-analysis.sh
+++ b/taskcluster/scripts/builder/hazard-analysis.sh
@@ -1,17 +1,17 @@
 #!/bin/bash -ex
 
 [ -n "$WORKSPACE" ]
 [ -n "$MOZ_OBJDIR" ]
-[ -n "$GECKO_DIR" ]
+[ -n "$GECKO_PATH" ]
 
 HAZARD_SHELL_OBJDIR=$WORKSPACE/obj-haz-shell
 JSBIN="$HAZARD_SHELL_OBJDIR/dist/bin/js"
-JS_SRCDIR=$GECKO_DIR/js/src
+JS_SRCDIR=$GECKO_PATH/js/src
 ANALYSIS_SRCDIR=$JS_SRCDIR/devtools/rootAnalysis
 GCCDIR="$TOOLTOOL_DIR/gcc"
 
 export CC="$GCCDIR/bin/gcc"
 export CXX="$GCCDIR/bin/g++"
 export PATH="$GCCDIR/bin:$TOOLTOOL_DIR/clang/bin:$PATH"
 export LD_LIBRARY_PATH="$GCCDIR/lib64"
 export RUSTC="$TOOLTOOL_DIR/rustc/bin/rustc"
@@ -20,17 +20,17 @@ export CARGO="$TOOLTOOL_DIR/rustc/bin/ca
 PYTHON=python2.7
 if ! which $PYTHON; then
     PYTHON=python
 fi
 
 function check_commit_msg () {
     ( set +e;
     if [[ -n "$AUTOMATION" ]]; then
-        hg --cwd "$GECKO_DIR" log -r. --template '{desc}\n' | grep -F -q -- "$1"
+        hg --cwd "$GECKO_PATH" log -r. --template '{desc}\n' | grep -F -q -- "$1"
     else
         echo -- "$SCRIPT_FLAGS" | grep -F -q -- "$1"
     fi
     )
 }
 
 if check_commit_msg "--dep"; then
     HAZ_DEP=1
@@ -66,23 +66,23 @@ function configure_analysis () {
 
     mkdir -p "$analysis_dir" || true
     (
         cd "$analysis_dir"
         cat > defaults.py <<EOF
 js = "$JSBIN"
 analysis_scriptdir = "$ANALYSIS_SRCDIR"
 objdir = "$MOZ_OBJDIR"
-source = "$GECKO_DIR"
+source = "$GECKO_PATH"
 sixgill = "$TOOLTOOL_DIR/sixgill/usr/libexec/sixgill"
 sixgill_bin = "$TOOLTOOL_DIR/sixgill/usr/bin"
 EOF
 
         local rev
-        rev=$(cd $GECKO_DIR && hg log -r . -T '{node|short}')
+        rev=$(cd $GECKO_PATH && hg log -r . -T '{node|short}')
         cat > run-analysis.sh <<EOF
 #!/bin/sh
 if [ \$# -eq 0 ]; then
   set gcTypes
 fi
 export ANALYSIS_SCRIPTDIR="$ANALYSIS_SRCDIR"
 export URLPREFIX="https://hg.mozilla.org/mozilla-unified/file/$rev/"
 exec "$ANALYSIS_SRCDIR/analyze.py" "\$@"
@@ -98,17 +98,17 @@ function run_analysis () {
     build_type="$2"
 
     if [[ -z "$HAZ_DEP" ]]; then
         [ -d $MOZ_OBJDIR ] && rm -rf $MOZ_OBJDIR
     fi
 
     (
         cd "$analysis_dir"
-        $PYTHON "$ANALYSIS_SRCDIR/analyze.py" -v --buildcommand="$GECKO_DIR/taskcluster/scripts/builder/hazard-${build_type}.sh"
+        $PYTHON "$ANALYSIS_SRCDIR/analyze.py" -v --buildcommand="$GECKO_PATH/taskcluster/scripts/builder/hazard-${build_type}.sh"
     )
 }
 
 function analysis_self_test () {
     LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$(dirname "$JSBIN")" $PYTHON "$ANALYSIS_SRCDIR/run-test.py" -v --js "$JSBIN" --sixgill "$TOOLTOOL_DIR/sixgill" --gccdir "$GCCDIR"
 }
 
 function grab_artifacts () {
--- a/taskcluster/taskgraph/transforms/job/hazard.py
+++ b/taskcluster/taskgraph/transforms/job/hazard.py
@@ -60,16 +60,16 @@ def docker_worker_hazard(config, job, ta
     })
 
     # script parameters
     if run.get('mozconfig'):
         env['MOZCONFIG'] = run['mozconfig']
 
     # build-haz-linux.sh needs this otherwise it assumes the checkout is in
     # the workspace.
-    env['GECKO_DIR'] = '{workdir}/checkouts/gecko'.format(**run)
+    env['GECKO_PATH'] = '{workdir}/checkouts/gecko'.format(**run)
 
     worker['command'] = [
         '{workdir}/bin/run-task'.format(**run),
         '--gecko-checkout', '{workdir}/checkouts/gecko'.format(**run),
         '--',
         '/bin/bash', '-c', run['command']
     ]