mirror of
https://github.com/servo/servo.git
synced 2025-07-30 10:40:27 +01:00
Add OSMesa headless mode, run WPT against Webrender, update tests.
This commit is contained in:
parent
06bb57bdcb
commit
cdb69d4423
164 changed files with 2095 additions and 458 deletions
|
@ -7,6 +7,7 @@
|
|||
# option. This file may not be copied, modified, or distributed
|
||||
# except according to those terms.
|
||||
|
||||
from glob import glob
|
||||
import gzip
|
||||
import itertools
|
||||
import locale
|
||||
|
@ -47,6 +48,17 @@ def setlocale(name):
|
|||
locale.setlocale(locale.LC_ALL, saved_locale)
|
||||
|
||||
|
||||
def find_dep_path_newest(package, bin_path):
|
||||
deps_path = path.join(path.split(bin_path)[0], "build")
|
||||
with cd(deps_path):
|
||||
candidates = glob(package + '-*')
|
||||
candidates = (path.join(deps_path, c) for c in candidates)
|
||||
candidate_times = sorted(((path.getmtime(c), c) for c in candidates), reverse=True)
|
||||
if len(candidate_times) > 0:
|
||||
return candidate_times[0][1]
|
||||
return None
|
||||
|
||||
|
||||
def archive_deterministically(dir_to_archive, dest_archive, prepend_path=None):
|
||||
"""Create a .tar.gz archive in a deterministic (reproducible) manner.
|
||||
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
|
||||
from __future__ import print_function, unicode_literals
|
||||
|
||||
from glob import glob
|
||||
import os
|
||||
import os.path as path
|
||||
import subprocess
|
||||
|
@ -23,7 +22,7 @@ from mach.decorators import (
|
|||
Command,
|
||||
)
|
||||
|
||||
from servo.command_base import CommandBase, cd, call, check_call, is_windows, is_macosx
|
||||
from servo.command_base import CommandBase, call, check_call, find_dep_path_newest, is_windows, is_macosx
|
||||
|
||||
|
||||
def read_file(filename, if_exists=False):
|
||||
|
@ -33,18 +32,6 @@ def read_file(filename, if_exists=False):
|
|||
return f.read()
|
||||
|
||||
|
||||
def find_dep_path_newest(package, bin_path):
|
||||
deps_path = path.join(path.split(bin_path)[0], "build")
|
||||
with cd(deps_path):
|
||||
print(os.getcwd())
|
||||
candidates = glob(package + '-*')
|
||||
candidates = (path.join(deps_path, c) for c in candidates)
|
||||
candidate_times = sorted(((path.getmtime(c), c) for c in candidates), reverse=True)
|
||||
if len(candidate_times) > 0:
|
||||
return candidate_times[0][1]
|
||||
return None
|
||||
|
||||
|
||||
@CommandProvider
|
||||
class PostBuildCommands(CommandBase):
|
||||
@Command('run',
|
||||
|
|
|
@ -25,7 +25,7 @@ from mach.decorators import (
|
|||
Command,
|
||||
)
|
||||
|
||||
from servo.command_base import CommandBase, call, cd, check_call, host_triple
|
||||
from servo.command_base import BuildNotFound, CommandBase, call, cd, check_call, find_dep_path_newest, host_triple
|
||||
from wptrunner import wptcommandline
|
||||
from update import updatecommandline
|
||||
from servo_tidy import tidy
|
||||
|
@ -413,6 +413,32 @@ class MachCommands(CommandBase):
|
|||
|
||||
# Helper for test_css and test_wpt:
|
||||
def wptrunner(self, run_file, **kwargs):
|
||||
# On Linux and mac, find the OSMesa software rendering library and
|
||||
# add it to the dynamic linker search path.
|
||||
if sys.platform.startswith('linux'):
|
||||
try:
|
||||
args = [self.get_binary_path(True, False)]
|
||||
osmesa_path = path.join(find_dep_path_newest('osmesa-src', args[0]), "out", "lib", "gallium")
|
||||
os.environ["LD_LIBRARY_PATH"] = osmesa_path
|
||||
os.environ["GALLIUM_DRIVER"] = "softpipe"
|
||||
except BuildNotFound:
|
||||
# This can occur when cross compiling (e.g. arm64), in which case
|
||||
# we won't run the tests anyway so can safely ignore this step.
|
||||
pass
|
||||
if sys.platform.startswith('darwin'):
|
||||
try:
|
||||
args = [self.get_binary_path(True, False)]
|
||||
osmesa_path = path.join(find_dep_path_newest('osmesa-src', args[0]),
|
||||
"out", "src", "gallium", "targets", "osmesa", ".libs")
|
||||
glapi_path = path.join(find_dep_path_newest('osmesa-src', args[0]),
|
||||
"out", "src", "mapi", "shared-glapi", ".libs")
|
||||
os.environ["DYLD_LIBRARY_PATH"] = osmesa_path + ":" + glapi_path
|
||||
os.environ["GALLIUM_DRIVER"] = "softpipe"
|
||||
except BuildNotFound:
|
||||
# This can occur when cross compiling (e.g. arm64), in which case
|
||||
# we won't run the tests anyway so can safely ignore this step.
|
||||
pass
|
||||
|
||||
os.environ["RUST_BACKTRACE"] = "1"
|
||||
kwargs["debug"] = not kwargs["release"]
|
||||
if kwargs.pop("chaos"):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue