mirror of
https://github.com/servo/servo.git
synced 2025-06-19 22:59:03 +01:00
Auto merge of #15138 - mdevlamynck:software-flag, r=jdm
Allow running servo in software rendering mode from ./mach run <!-- Please describe your changes on the following line: --> This adds a flag to ./mach run to use software rendering on Linux (through the LIBGL_ALWAYS_SOFTWARE env var). --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #14982. <!-- Either: --> - [X] These changes do not require tests because like said in the issue "There's no way to add automated tests for this". <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15138) <!-- Reviewable:end -->
This commit is contained in:
commit
bc5004b05c
1 changed files with 11 additions and 2 deletions
|
@ -25,7 +25,7 @@ from mach.decorators import (
|
||||||
from servo.command_base import (
|
from servo.command_base import (
|
||||||
CommandBase,
|
CommandBase,
|
||||||
call, check_call,
|
call, check_call,
|
||||||
is_windows, is_macosx, set_osmesa_env,
|
is_linux, is_windows, is_macosx, set_osmesa_env,
|
||||||
get_browserhtml_path,
|
get_browserhtml_path,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -59,11 +59,13 @@ class PostBuildCommands(CommandBase):
|
||||||
help='Launch with Browser.html')
|
help='Launch with Browser.html')
|
||||||
@CommandArgument('--headless', '-z', action='store_true',
|
@CommandArgument('--headless', '-z', action='store_true',
|
||||||
help='Launch in headless mode')
|
help='Launch in headless mode')
|
||||||
|
@CommandArgument('--software', '-s', action='store_true',
|
||||||
|
help='Launch with software rendering')
|
||||||
@CommandArgument(
|
@CommandArgument(
|
||||||
'params', nargs='...',
|
'params', nargs='...',
|
||||||
help="Command-line arguments to be passed through to Servo")
|
help="Command-line arguments to be passed through to Servo")
|
||||||
def run(self, params, release=False, dev=False, android=None, debug=False, debugger=None, browserhtml=False,
|
def run(self, params, release=False, dev=False, android=None, debug=False, debugger=None, browserhtml=False,
|
||||||
headless=False):
|
headless=False, software=False):
|
||||||
env = self.build_env()
|
env = self.build_env()
|
||||||
env["RUST_BACKTRACE"] = "1"
|
env["RUST_BACKTRACE"] = "1"
|
||||||
|
|
||||||
|
@ -115,6 +117,13 @@ class PostBuildCommands(CommandBase):
|
||||||
set_osmesa_env(args[0], env)
|
set_osmesa_env(args[0], env)
|
||||||
args.append('-z')
|
args.append('-z')
|
||||||
|
|
||||||
|
if software:
|
||||||
|
if not is_linux():
|
||||||
|
print("Software rendering is only supported on Linux at the moment.")
|
||||||
|
return
|
||||||
|
|
||||||
|
env['LIBGL_ALWAYS_SOFTWARE'] = "1"
|
||||||
|
|
||||||
# Borrowed and modified from:
|
# Borrowed and modified from:
|
||||||
# http://hg.mozilla.org/mozilla-central/file/c9cfa9b91dea/python/mozbuild/mozbuild/mach_commands.py#l883
|
# http://hg.mozilla.org/mozilla-central/file/c9cfa9b91dea/python/mozbuild/mozbuild/mach_commands.py#l883
|
||||||
if debug:
|
if debug:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue