mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-26 04:09:50 +00:00
Backed out 2 changesets (bug 1782323, bug 1685588) for causing failures on hazard.
Backed out changeset 6d2a56a0fa58 (bug 1782323) Backed out changeset e778b7fceb69 (bug 1685588)
This commit is contained in:
parent
e193916b93
commit
58a2a7989d
@ -37,9 +37,12 @@ class MultiInput(str):
|
||||
|
||||
def env(config):
|
||||
e = dict(os.environ)
|
||||
e["PATH"] = ":".join(p for p in (config.get("sixgill_bin"), e["PATH"]) if p)
|
||||
e["PATH"] = ":".join(
|
||||
p for p in (config.get("gcc_bin"), config.get("sixgill_bin"), e["PATH"]) if p
|
||||
)
|
||||
e["XDB"] = "%(sixgill_bin)s/xdb.so" % config
|
||||
e["SOURCE"] = config["source"]
|
||||
e["ANALYZED_OBJDIR"] = config["objdir"]
|
||||
return e
|
||||
|
||||
|
||||
@ -95,6 +98,21 @@ def print_command(command, outfile=None, env=None):
|
||||
|
||||
|
||||
JOBS = {
|
||||
"dbs": {
|
||||
"command": [
|
||||
"{analysis_scriptdir}/run_complete",
|
||||
"--foreground",
|
||||
"--no-logs",
|
||||
"--build-root={objdir}",
|
||||
"--wrap-dir={sixgill}/scripts/wrap_gcc",
|
||||
"--work-dir=work",
|
||||
"-b",
|
||||
"{sixgill_bin}",
|
||||
"--buildcommand={buildcommand}",
|
||||
".",
|
||||
],
|
||||
"outputs": [],
|
||||
},
|
||||
"list-dbs": {"command": ["ls", "-l"]},
|
||||
"rawcalls": {
|
||||
"command": [
|
||||
@ -188,7 +206,7 @@ JOBS = {
|
||||
}
|
||||
|
||||
|
||||
# Generator of (i, j, item) tuples corresponding to outputs:
|
||||
# Generator of (i, j, item) tuples:
|
||||
# - i is just the index of the yielded tuple (a la enumerate())
|
||||
# - j is the index of the item in the command list
|
||||
# - item is command[j]
|
||||
@ -312,6 +330,13 @@ parser.add_argument(
|
||||
parser.add_argument(
|
||||
"--source", metavar="SOURCE", type=str, nargs="?", help="source code to analyze"
|
||||
)
|
||||
parser.add_argument(
|
||||
"--objdir",
|
||||
metavar="DIR",
|
||||
type=str,
|
||||
nargs="?",
|
||||
help="object directory of compiled files",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--js",
|
||||
metavar="JSSHELL",
|
||||
@ -340,6 +365,21 @@ parser.add_argument(
|
||||
parser.add_argument(
|
||||
"--list", const=True, nargs="?", type=bool, help="display available steps"
|
||||
)
|
||||
parser.add_argument(
|
||||
"--buildcommand",
|
||||
"--build",
|
||||
"-b",
|
||||
type=str,
|
||||
nargs="?",
|
||||
help="command to build the tree being analyzed",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--tag",
|
||||
"-t",
|
||||
type=str,
|
||||
nargs="?",
|
||||
help='name of job, also sets build command to "build.<tag>"',
|
||||
)
|
||||
parser.add_argument(
|
||||
"--expect-file",
|
||||
type=str,
|
||||
@ -372,17 +412,31 @@ for k, v in vars(args).items():
|
||||
if v is not None:
|
||||
data[k] = v
|
||||
|
||||
if args.tag and not args.buildcommand:
|
||||
args.buildcommand = "build.%s" % args.tag
|
||||
|
||||
if args.jobs is not None:
|
||||
data["jobs"] = args.jobs
|
||||
if not data.get("jobs"):
|
||||
data["jobs"] = max_parallel_jobs()
|
||||
|
||||
if args.buildcommand:
|
||||
data["buildcommand"] = args.buildcommand
|
||||
elif "BUILD" in os.environ:
|
||||
data["buildcommand"] = os.environ["BUILD"]
|
||||
else:
|
||||
data["buildcommand"] = "make -j{} -s".format(data["jobs"])
|
||||
|
||||
if "ANALYZED_OBJDIR" in os.environ:
|
||||
data["objdir"] = os.environ["ANALYZED_OBJDIR"]
|
||||
|
||||
if "GECKO_PATH" in os.environ:
|
||||
data["source"] = os.environ["GECKO_PATH"]
|
||||
if "SOURCE" in os.environ:
|
||||
data["source"] = os.environ["SOURCE"]
|
||||
|
||||
steps = [
|
||||
"dbs",
|
||||
"gcTypes",
|
||||
"rawcalls",
|
||||
"gcFunctions",
|
||||
|
@ -10,6 +10,7 @@ from __future__ import absolute_import, print_function, unicode_literals
|
||||
import argparse
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
import textwrap
|
||||
|
||||
# Command files like this are listed in build/mach_initialize.py in alphabetical
|
||||
@ -237,6 +238,7 @@ def gather_hazard_data(command_context, **kwargs):
|
||||
source = "{srcdir}"
|
||||
sixgill = "{sixgill_dir}/usr/libexec/sixgill"
|
||||
sixgill_bin = "{sixgill_dir}/usr/bin"
|
||||
gcc_bin = "{gcc_dir}/bin"
|
||||
"""
|
||||
).format(
|
||||
script_dir=script_dir(command_context),
|
||||
@ -256,16 +258,11 @@ def gather_hazard_data(command_context, **kwargs):
|
||||
]
|
||||
)
|
||||
args = [
|
||||
os.path.join(script_dir(command_context), "run_complete"),
|
||||
"--foreground",
|
||||
"--no-logs",
|
||||
"--build-root=" + objdir,
|
||||
"--wrap-dir=" + sixgill_dir() + "/usr/libexec/sixgill/scripts/wrap_gcc",
|
||||
"--work-dir=work",
|
||||
"-b",
|
||||
sixgill_dir() + "/usr/bin",
|
||||
sys.executable,
|
||||
os.path.join(script_dir(command_context), "analyze.py"),
|
||||
"dbs",
|
||||
"-v",
|
||||
"--buildcommand=" + buildscript,
|
||||
".",
|
||||
]
|
||||
|
||||
return command_context.run_process(args=args, cwd=work_dir, pass_thru=True)
|
||||
@ -358,37 +355,12 @@ def inner_compile(command_context, **kwargs):
|
||||
@CommandArgument(
|
||||
"--work-dir", default=None, help="Directory for output and working files."
|
||||
)
|
||||
@CommandArgument(
|
||||
"--jobs", "-j", default=None, type=int, help="Number of parallel analyzers."
|
||||
)
|
||||
@CommandArgument(
|
||||
"--verbose",
|
||||
"-v",
|
||||
default=False,
|
||||
action="store_true",
|
||||
help="Display executed commands.",
|
||||
)
|
||||
@CommandArgument(
|
||||
"--from-stage",
|
||||
default=None,
|
||||
help="Stage to begin running at ('list' to see all).",
|
||||
)
|
||||
@CommandArgument(
|
||||
"extra",
|
||||
nargs=argparse.REMAINDER,
|
||||
default=(),
|
||||
help="Remaining non-optional arguments to analyze.py script",
|
||||
)
|
||||
def analyze(
|
||||
command_context,
|
||||
application,
|
||||
shell_objdir,
|
||||
work_dir,
|
||||
jobs,
|
||||
verbose,
|
||||
from_stage,
|
||||
extra,
|
||||
):
|
||||
def analyze(command_context, application, shell_objdir, work_dir, extra):
|
||||
"""Analyzed gathered data for rooting hazards"""
|
||||
|
||||
shell = ensure_shell(command_context, shell_objdir)
|
||||
@ -396,21 +368,15 @@ def analyze(
|
||||
os.path.join(script_dir(command_context), "analyze.py"),
|
||||
"--js",
|
||||
shell,
|
||||
*extra,
|
||||
]
|
||||
|
||||
if from_stage is None:
|
||||
pass
|
||||
elif from_stage == "list":
|
||||
args.append("--list")
|
||||
if extra:
|
||||
args += extra
|
||||
else:
|
||||
args.extend(["--first", from_stage])
|
||||
|
||||
if jobs is not None:
|
||||
args.extend(["-j", jobs])
|
||||
|
||||
if verbose:
|
||||
args.append("-v")
|
||||
args += [
|
||||
"--first",
|
||||
"gcTypes",
|
||||
"-v",
|
||||
]
|
||||
|
||||
setup_env_for_tools(os.environ)
|
||||
setup_env_for_shell(os.environ, shell)
|
||||
|
Loading…
x
Reference in New Issue
Block a user