Closed Bug 1107193 Opened 7 years ago Closed 7 years ago

Make it easier to run the static rooting analysis

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla38

People

(Reporter: jorendorff, Assigned: jorendorff)

Details

Attachments

(1 file, 2 obsolete files)

(resisting the temptation to file this under "Core :: Spelling checker")

I'm writing a script that downloads sixgill and gcc from people.m.o, unzips them in a directory, builds SpiderMonkey with the custom gcc, and finally runs the analysis. I don't know if it's the right thing to have this in-tree, but since I'm doing it...
Attachment #8531936 - Attachment is obsolete: true
Attachment #8531936 - Flags: review?(josfinkenstein)
Assignee: nobody → jorendorff
Status: NEW → ASSIGNED
Attachment #8531937 - Attachment is obsolete: true
Attachment #8531937 - Flags: review?(sphink)
Comment on attachment 8531941 [details] [diff] [review]
Add a script that makes it easy to run the static rooting analysis

Review of attachment 8531941 [details] [diff] [review]:
-----------------------------------------------------------------

Sure, why not?

::: js/src/devtools/rootAnalysis/README.txt
@@ +7,2 @@
>  
> +1.  Be on Linux x86_64.

You may want to warn that you will need to be on Fedora/CentOS/RedHat, or another distro that installs libstdc++ in the same place that they do. (Specifically, the prebuilt GCC won't work on Ubuntu without the CFLAGS and CXXFLAGS settings from trac.wildfiregames.com/wiki/StaticRootingAnalysis and Ubuntu is pretty common.)

@@ +17,2 @@
>  
> +`setup.sh` is kind of like `configure` and `make` combined:

That seems like an odd name. It's not just setting stuff up, it's running the whole dang thing. run-analysis.sh?

::: js/src/devtools/rootAnalysis/setup.sh
@@ +6,5 @@
> +set -eu
> +
> +BUILD_DIR="$PWD"
> +ANALYSIS_SCRIPTDIR="$(dirname $0)"
> +MOZILLA_SRCDIR="$(cd $ANALYSIS_SCRIPTDIR && (hg root || git rev-parse --show-toplevel))"

Uh, what the heck is that git thing doing in there? Seems redundant, and on my system it spews

fatal: Not a git repository (or any parent up to mount point /home)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

@@ +35,5 @@
> +# ==============================
> +#
> +# The first step is to generate the .xdb files that contain the information
> +# needed by the analysis. This is done by compiling SpiderMonkey with the
> +# sixgill plugin enabled. The plugin creates .xdb files which the analysis

grammar nazi says s/which/that/.

@@ +81,5 @@
> +echo "js = '${JS}'" >> defaults.py
> +echo "analysis_scriptdir = '${ANALYSIS_SCRIPTDIR}'" >> defaults.py
> +
> +# Run the script that runs the scripts that do the analysis.
> +python2.7 "${MOZILLA_SRCDIR}/js/src/devtools/rootAnalysis/analyze.py" -j 8 callgraph

I worry slightly that python2.7 might make this a little more distro-sensitive, because I thought some used python27 instead, but meh.
Attachment #8531941 - Flags: review?(sphink) → review+
https://hg.mozilla.org/mozilla-central/rev/d7b40d5a4577
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
You need to log in before you can comment on or make changes to this bug.