servo: Merge #19944 - Add a --bin flag to the |mach run and rr-record commands (from o0Ignition0o:mach_run_bin); r=jdm

Add a --bin flag to the |mach run and rr-record commands to specify which servo binary to run

<!-- Please describe your changes on the following line: -->

Step 1 for #19505.
This flag allows to specify a downloaded servo binary for the ./mach run and ./mach rr-record commands.
The base issue is mentored by @jdm

---
<!-- 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
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because | I would love to write tests on this, but I'm not really sure I can, since it's on ./mach commands

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 7c112c7dcca276a24883c8e44d203283b545e88e

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : a250cb80f940845596e240ea49fcdb1677f0472f
This commit is contained in:
o0Ignition0o 2018-02-04 10:13:52 -05:00
Родитель 6247b6be40
Коммит 67b18a026f
1 изменённых файлов: 8 добавлений и 4 удалений

Просмотреть файл

@ -59,11 +59,13 @@ class PostBuildCommands(CommandBase):
help='Launch in headless mode')
@CommandArgument('--software', '-s', action='store_true',
help='Launch with software rendering')
@CommandArgument('--bin', default=None,
help='Launch with specific binary')
@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, software=False):
headless=False, software=False, bin=None):
env = self.build_env()
env["RUST_BACKTRACE"] = "1"
@ -96,7 +98,7 @@ class PostBuildCommands(CommandBase):
shell.communicate("\n".join(script) + "\n")
return shell.wait()
args = [self.get_binary_path(release, dev)]
args = [bin or self.get_binary_path(release, dev)]
if browserhtml:
browserhtml_path = get_browserhtml_path(args[0])
@ -173,14 +175,16 @@ class PostBuildCommands(CommandBase):
help='Use release build')
@CommandArgument('--dev', '-d', action='store_true',
help='Use dev build')
@CommandArgument('--bin', default=None,
help='Launch with specific binary')
@CommandArgument(
'params', nargs='...',
help="Command-line arguments to be passed through to Servo")
def rr_record(self, release=False, dev=False, params=[]):
def rr_record(self, release=False, dev=False, bin=None, params=[]):
env = self.build_env()
env["RUST_BACKTRACE"] = "1"
servo_cmd = [self.get_binary_path(release, dev)] + params
servo_cmd = [bin or self.get_binary_path(release, dev)] + params
rr_cmd = ['rr', '--fatal-errors', 'record']
try:
check_call(rr_cmd + servo_cmd)