Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow `./mach build` to enable Servo's headless mode #7734

Merged
merged 2 commits into from Dec 4, 2015
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Prev

Allow `./mach build-tests` to enable Servo's headless mode

This allows mach's build-tests command to use the option --headless
instead of checking for the value of SERVO_HEADLESS.
  • Loading branch information
nerith committed Dec 3, 2015
commit 2342b1bc6f068cc70302c26a7c06d72a31ca0f91
@@ -29,6 +29,16 @@ def is_headless_build():
return int(os.getenv('SERVO_HEADLESS', 0)) == 1


def headless_supported():
supported = sys.platform.startswith("linux")

if not supported:
print("Headless mode (OSMesa) is not supported on your platform.")
print("Building without headless mode.")

return supported


def notify_linux(title, text):
try:
import dbus
@@ -207,13 +217,9 @@ def build(self, target=None, release=False, dev=False, jobs=None,
if debug_mozjs or self.config["build"]["debug-mozjs"]:
features += ["script/debugmozjs"]

if headless or is_headless_build():
if sys.platform.startswith("linux"):
opts += ["--no-default-features"]
features += ["headless"]
else:
print("Headless mode (OSMesa) is not supported on your platform.")
print("Building without headless mode.")
if (headless or is_headless_build()) and headless_supported():
opts += ["--no-default-features"]
features += ["headless"]

if android:
features += ["android_glue"]
@@ -332,15 +338,19 @@ def build_gonk(self, jobs=None, verbose=False, release=False):
@Command('build-tests',
description='Build the Servo test suites',
category='build')
@CommandArgument('--headless',
default=None,
action='store_true',
help='Enable headless mode (OSMesa)')
@CommandArgument('--jobs', '-j',
default=None,
help='Number of jobs to run in parallel')
@CommandArgument('--release', default=False, action="store_true",
help="Build tests with release mode")
def build_tests(self, jobs=None, verbose=False, release=False):
def build_tests(self, headless=False, jobs=None, verbose=False, release=False):
self.ensure_bootstrapped()
args = ["cargo", "test", "--no-run"]
if is_headless_build():
if (headless or is_headless_build()) and headless_supported():
args += ["--no-default-features", "--features", "headless"]
if release:
args += ["--release"]
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.