Javascript:Hazard Builds: Difference between revisions

→‎Static Analysis for Rooting Hazards: updated with new names, instructions
(→‎Running the analysis: ordering B.S.)
(→‎Static Analysis for Rooting Hazards: updated with new names, instructions)
Line 1: Line 1:
== Static Analysis for Rooting Hazards ==
== Static Analysis for Rooting Hazards ==


Treeherder can run three static analysis builds: the full browser (linux64-br-haz), B2G (linux64-b2g-haz), and just the JS shell (linux64-sh-haz). They show up on treeherder as '''H''' (or '''SM(H)''').
Treeherder can run two static analysis builds: the full browser (linux64-haz), just the JS shell (linux64-shell-haz), and if you're not fixated on counting to two, B2G (linux64-mulet-haz). They show up on treeherder as '''H''' (or '''SM(H)''').


These builds are performed as follows:
These builds are performed as follows:


* run the mozharness script http://hg.mozilla.org/build/mozharness/scripts/spidermonkey_build.py, which sets up a mozilla_mock environment and runs the analysis within it, then uploads the resulting files
* run the script testing/taskcluster/scripts/builder/build-haz-linux.sh, which sets up a build environment and runs the analysis within it, then uploads the resulting files
** compile an optimized JS shell to later run the analysis
** compile an optimized JS shell to later run the analysis
** compile the browser with gcc, using a slightly modified version of the sixgill (http://svn.sixgill.org) gcc plugin, producing a set of .xdb files describing everything encountered during the compilation
** compile the browser with gcc, using a slightly modified version of the sixgill (http://svn.sixgill.org) gcc plugin, producing a set of .xdb files describing everything encountered during the compilation
Line 12: Line 12:
=== Running the analysis ===
=== Running the analysis ===


To run the browser analysis, you must be on a Fedora/RedHat/CentOS linux64 machine and do:
To run the browser analysis, you must be on a Fedora/RedHat/CentOS linux64 machine. See js/src/devtools/rootAnalysis/README.md.
 
  mkdir ~/haz
  cd ~/haz
  python $SRCDIR/testing/mozharness/scripts/spidermonkey_build.py -c hazards/common.py -c hazards/build_browser.py -c developer_config.py --source $SRCDIR
 
It doesn't matter what directory you run from, as long as it's not at the top of a source checkout.
 
If your hazards are all contained within js/src, you could use hazards/build_shell.py in place of hazards/build_browser.py. It will complete much more quickly.


If you are running Debian or Ubuntu, then there is currently a problem running the full browser analysis. You can coerce the shell-only build to work by doing something like:
If you are running Debian or Ubuntu, then there is currently a problem running the full browser analysis. You can coerce the shell-only build to work by doing something like:
Line 31: Line 23:
before running the script.
before running the script.


The easiest way to run an analysis is to push to try with the trychooser line |try: -b do -p linux64-br-haz| (or, if the hazards of interest are contained entirely within js/src, use |try: -b do -p linux64-sh-haz| for a much faster result). The expected turnaround time for linux64-br-haz is just under 2 hours. For b2g hazards, you can use -p linux64-b2g-haz.
The easiest way to run an analysis is to push to try with the trychooser line |try: -b do -p linux64-haz| (or, if the hazards of interest are contained entirely within js/src, use |try: -b do -p linux64-shell-haz| for a much faster result). The expected turnaround time for linux64-haz is just under 2 hours.


The output will be uploaded and a link named "results" will be placed into the "job details" info pane on treeherder. If the analysis fails, you will see the number of failures. Navigate to the hazards.txt.gz file.
The output will be uploaded and a link named "results" will be placed into the "job details" info pane on treeherder. If the analysis fails, you will see the number of failures. Navigate to the hazards.txt.gz file.
Confirmed users
328

edits