Skip to content

Commit

Permalink
Backed out changeset e1921c5112d8 (bug 1696251) for causing bustages …
Browse files Browse the repository at this point in the history
…complaining about 'CommandContext'. CLOSED TREE
  • Loading branch information
Butkovits Atila committed Jul 16, 2021
1 parent d021d94 commit a07f790
Show file tree
Hide file tree
Showing 53 changed files with 1,427 additions and 1,815 deletions.
24 changes: 11 additions & 13 deletions build/valgrind/mach_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def valgrind_test(self, command_context, suppressions):
from six import string_types
from valgrind.output_handler import OutputHandler

build_dir = os.path.join(command_context.topsrcdir, "build")
build_dir = os.path.join(self.topsrcdir, "build")

# XXX: currently we just use the PGO inputs for Valgrind runs. This may
# change in the future.
Expand All @@ -68,9 +68,7 @@ def valgrind_test(self, command_context, suppressions):

with TemporaryDirectory() as profilePath:
# TODO: refactor this into mozprofile
profile_data_dir = os.path.join(
command_context.topsrcdir, "testing", "profiles"
)
profile_data_dir = os.path.join(self.topsrcdir, "testing", "profiles")
with open(os.path.join(profile_data_dir, "profiles.json"), "r") as fh:
base_profiles = json.load(fh)["valgrind"]

Expand All @@ -91,7 +89,7 @@ def valgrind_test(self, command_context, suppressions):
prefs[k] = Preferences.cast(v)

quitter = os.path.join(
command_context.topsrcdir, "tools", "quitter", "[email protected]"
self.topsrcdir, "tools", "quitter", "[email protected]"
)

locations = ServerLocations()
Expand All @@ -115,7 +113,7 @@ def valgrind_test(self, command_context, suppressions):
env["MOZ_DISABLE_NONLOCAL_CONNECTIONS"] = "1"
env["XPCOM_DEBUG_BREAK"] = "warn"

outputHandler = OutputHandler(command_context.log)
outputHandler = OutputHandler(self.log)
kp_kwargs = {
"processOutputLine": [outputHandler],
"universal_newlines": True,
Expand Down Expand Up @@ -173,7 +171,7 @@ def valgrind_test(self, command_context, suppressions):
try:
runner = FirefoxRunner(
profile=profile,
binary=command_context.get_binary_path(),
binary=self.get_binary_path(),
cmdargs=firefox_args,
env=env,
process_args=kp_kwargs,
Expand All @@ -187,7 +185,7 @@ def valgrind_test(self, command_context, suppressions):
supps = outputHandler.suppression_count
if errs != supps:
status = 1 # turns the TBPL job orange
command_context.log(
self.log(
logging.ERROR,
"valgrind-fail-parsing",
{"errs": errs, "supps": supps},
Expand All @@ -197,7 +195,7 @@ def valgrind_test(self, command_context, suppressions):

elif errs == 0:
status = 0
command_context.log(
self.log(
logging.INFO,
"valgrind-pass",
{},
Expand All @@ -209,21 +207,21 @@ def valgrind_test(self, command_context, suppressions):

if binary_not_found_exception:
status = 2 # turns the TBPL job red
command_context.log(
self.log(
logging.ERROR,
"valgrind-fail-errors",
{"error": str(binary_not_found_exception)},
"TEST-UNEXPECTED-FAIL | valgrind-test | {error}",
)
command_context.log(
self.log(
logging.INFO,
"valgrind-fail-errors",
{"help": binary_not_found_exception.help()},
"{help}",
)
elif exitcode is None:
status = 2 # turns the TBPL job red
command_context.log(
self.log(
logging.ERROR,
"valgrind-fail-timeout",
{"timeout": timeout},
Expand All @@ -232,7 +230,7 @@ def valgrind_test(self, command_context, suppressions):
)
elif exitcode != 0:
status = 2 # turns the TBPL job red
command_context.log(
self.log(
logging.ERROR,
"valgrind-fail-errors",
{"exitcode": exitcode},
Expand Down
27 changes: 11 additions & 16 deletions devtools/shared/css/generated/mach_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,39 +49,35 @@ def generate_css_db(self, command_context):
"""Generate the static css properties database for devtools and write it to file."""

print("Re-generating the css properties database...")
db = self.get_properties_db_from_xpcshell(command_context)
db = self.get_properties_db_from_xpcshell()
if not db:
return 1

self.output_template(
command_context,
{
"preferences": stringify(db["preferences"]),
"cssProperties": stringify(db["cssProperties"]),
"pseudoElements": stringify(db["pseudoElements"]),
},
}
)

def get_properties_db_from_xpcshell(self, command_context):
def get_properties_db_from_xpcshell(self):
"""Generate the static css properties db for devtools from an xpcshell script."""
build = MozbuildObject.from_environment()

# Get the paths
script_path = resolve_path(
command_context.topsrcdir,
"devtools/shared/css/generated/generate-properties-db.js",
self.topsrcdir, "devtools/shared/css/generated/generate-properties-db.js"
)
gre_path = resolve_path(command_context.topobjdir, "dist/bin")
browser_path = resolve_path(command_context.topobjdir, "dist/bin/browser")
gre_path = resolve_path(self.topobjdir, "dist/bin")
browser_path = resolve_path(self.topobjdir, "dist/bin/browser")
try:
xpcshell_path = build.get_binary_path(what="xpcshell")
except BinaryNotFoundException as e:
command_context.log(
self.log(
logging.ERROR, "devtools-css-db", {"error": str(e)}, "ERROR: {error}"
)
command_context.log(
logging.INFO, "devtools-css-db", {"help": e.help()}, "{help}"
)
self.log(logging.INFO, "devtools-css-db", {"help": e.help()}, "{help}")
return None

print(browser_path)
Expand All @@ -102,14 +98,13 @@ def get_properties_db_from_xpcshell(self, command_context):

return json.loads(contents)

def output_template(self, command_context, substitutions):
def output_template(self, substitutions):
"""Output a the properties-db.js from a template."""
js_template_path = resolve_path(
command_context.topsrcdir,
"devtools/shared/css/generated/properties-db.js.in",
self.topsrcdir, "devtools/shared/css/generated/properties-db.js.in"
)
destination_path = resolve_path(
command_context.topsrcdir, "devtools/shared/css/generated/properties-db.js"
self.topsrcdir, "devtools/shared/css/generated/properties-db.js"
)

with open(js_template_path, "rb") as handle:
Expand Down
12 changes: 5 additions & 7 deletions dom/bindings/mach_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class WebIDLProvider(MachCommandBase):
def webidl_example(self, command_context, interface):
from mozwebidlcodegen import BuildSystemWebIDL

manager = command_context._spawn(BuildSystemWebIDL).manager
manager = self._spawn(BuildSystemWebIDL).manager
for i in interface:
manager.generate_example_files(i)

Expand All @@ -47,17 +47,15 @@ def webidl_example(self, command_context, interface):
description="Run WebIDL tests (Interface Browser parser).",
)
def webidl_test(self, command_context, **kwargs):
sys.path.insert(
0, os.path.join(command_context.topsrcdir, "other-licenses", "ply")
)
sys.path.insert(0, os.path.join(self.topsrcdir, "other-licenses", "ply"))

# Ensure the topobjdir exists. On a Taskcluster test run there won't be
# an objdir yet.
mkdir(command_context.topobjdir)
mkdir(self.topobjdir)

# Make sure we drop our cached grammar bits in the objdir, not
# wherever we happen to be running from.
os.chdir(command_context.topobjdir)
os.chdir(self.topobjdir)

if kwargs["verbose"] is None:
kwargs["verbose"] = False
Expand All @@ -66,7 +64,7 @@ def webidl_test(self, command_context, **kwargs):
# objdir. But we're going to try loading it as a python
# module, so we need to make sure the objdir is in our search
# path.
sys.path.insert(0, command_context.topobjdir)
sys.path.insert(0, self.topobjdir)

import runtests

Expand Down
Loading

0 comments on commit a07f790

Please sign in to comment.