mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Update mach bootstrap for changes to wpt harness path in gecko
Gecko is now using the wpt harness under the wpt tools directory rather than a copy in an adjacent directory. Therefore the path to the requirements files, and the required model paths, have changed.
This commit is contained in:
parent
d767e6046b
commit
06cdf7bb3b
1 changed files with 18 additions and 11 deletions
|
@ -14,11 +14,6 @@ SEARCH_PATHS = [
|
|||
os.path.join("python", "tidy"),
|
||||
]
|
||||
|
||||
WPT_SEARCH_PATHS = [
|
||||
".",
|
||||
"harness",
|
||||
]
|
||||
|
||||
# Individual files providing mach commands.
|
||||
MACH_MODULES = [
|
||||
os.path.join('python', 'servo', 'bootstrap_commands.py'),
|
||||
|
@ -106,7 +101,7 @@ def _get_virtualenv_script_dir():
|
|||
return "bin"
|
||||
|
||||
|
||||
def wpt_path(topdir, paths, is_firefox):
|
||||
def wpt_path(is_firefox, topdir, *paths):
|
||||
if is_firefox:
|
||||
rel = os.path.join("..", "testing", "web-platform")
|
||||
else:
|
||||
|
@ -115,6 +110,16 @@ def wpt_path(topdir, paths, is_firefox):
|
|||
return os.path.join(topdir, rel, *paths)
|
||||
|
||||
|
||||
def wpt_harness_path(is_firefox, topdir, *paths):
|
||||
wpt_root = wpt_path(is_firefox, topdir)
|
||||
if is_firefox:
|
||||
rel = os.path.join(wpt_root, "tests", "tools", "wptrunner")
|
||||
else:
|
||||
rel = os.path.join(wpt_root, "harness")
|
||||
|
||||
return os.path.join(topdir, rel, *paths)
|
||||
|
||||
|
||||
def _activate_virtualenv(topdir, is_firefox):
|
||||
virtualenv_path = os.path.join(topdir, "python", "_virtualenv")
|
||||
check_exec_path = lambda path: path.startswith(virtualenv_path)
|
||||
|
@ -157,9 +162,9 @@ def _activate_virtualenv(topdir, is_firefox):
|
|||
# and it will check for conflicts.
|
||||
requirements_paths = [
|
||||
os.path.join("python", "requirements.txt"),
|
||||
wpt_path(topdir, ("harness", "requirements.txt"), is_firefox),
|
||||
wpt_path(topdir, ("harness", "requirements_firefox.txt"), is_firefox),
|
||||
wpt_path(topdir, ("harness", "requirements_servo.txt"), is_firefox),
|
||||
wpt_harness_path(is_firefox, topdir, "requirements.txt",),
|
||||
wpt_harness_path(is_firefox, topdir, "requirements_firefox.txt"),
|
||||
wpt_harness_path(is_firefox, topdir, "requirements_servo.txt"),
|
||||
]
|
||||
|
||||
if need_pip_upgrade:
|
||||
|
@ -257,8 +262,10 @@ def bootstrap(topdir):
|
|||
raise AttributeError(key)
|
||||
|
||||
sys.path[0:0] = [os.path.join(topdir, path) for path in SEARCH_PATHS]
|
||||
sys.path[0:0] = [wpt_path(topdir, (path,), is_firefox)
|
||||
for path in WPT_SEARCH_PATHS]
|
||||
|
||||
sys.path[0:0] = [wpt_path(is_firefox, topdir),
|
||||
wpt_harness_path(is_firefox, topdir)]
|
||||
|
||||
import mach.main
|
||||
mach = mach.main.Mach(os.getcwd())
|
||||
mach.populate_context_handler = populate_context
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue