diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2017-01-26 14:43:21 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-26 14:43:21 -0800 |
commit | bc5004b05ca0a54ddcbe7f308f8df8f61a4d7a99 (patch) | |
tree | 5366cc689120c0e2060813d706ec95638a394a52 /python | |
parent | 5427e68572c034e6a12ca9766563bda88ee0c610 (diff) | |
parent | a465fbb87a03caf589691fbcb2df0d49f67f1fb8 (diff) | |
download | servo-bc5004b05ca0a54ddcbe7f308f8df8f61a4d7a99.tar.gz servo-bc5004b05ca0a54ddcbe7f308f8df8f61a4d7a99.zip |
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 -->
Diffstat (limited to 'python')
-rw-r--r-- | python/servo/post_build_commands.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/python/servo/post_build_commands.py b/python/servo/post_build_commands.py index 145b2eecbad..d6637601697 100644 --- a/python/servo/post_build_commands.py +++ b/python/servo/post_build_commands.py @@ -25,7 +25,7 @@ from mach.decorators import ( from servo.command_base import ( CommandBase, call, check_call, - is_windows, is_macosx, set_osmesa_env, + is_linux, is_windows, is_macosx, set_osmesa_env, get_browserhtml_path, ) @@ -59,11 +59,13 @@ class PostBuildCommands(CommandBase): help='Launch with Browser.html') @CommandArgument('--headless', '-z', action='store_true', help='Launch in headless mode') + @CommandArgument('--software', '-s', action='store_true', + help='Launch with software rendering') @CommandArgument( 'params', nargs='...', 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, - headless=False): + headless=False, software=False): env = self.build_env() env["RUST_BACKTRACE"] = "1" @@ -115,6 +117,13 @@ class PostBuildCommands(CommandBase): set_osmesa_env(args[0], env) 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: # http://hg.mozilla.org/mozilla-central/file/c9cfa9b91dea/python/mozbuild/mozbuild/mach_commands.py#l883 if debug: |