-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add support for custom target-specific runners #3954
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @brson (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
☔ The latest upstream changes (presumably #3955) made this pull request unmergeable. Please resolve the merge conflicts. |
a386c6b
to
8f0a8ba
Compare
Any config option can be override defining an environment variable, in this case |
@malbarbo Ah, TIL. Perfect, thanks! (although I rather meant something that was suggested in other issues, like just |
142cb33
to
70c8482
Compare
Rebased and squashed documentation with code. |
Looks good to me! I'm ok punting on CLI support for now, but I do think that we'll eventually add it (it's more ergonomic for the gdb/strace use case). I wonder though if we can perhaps soup up the configuration here, where a change may otherwise be backwards incompatible. For example:
That way we can support passing arguments, doing so in an ergonomic fashion for easy cases, and then also supporting the fully general case. |
I've been thinking about space/array thing but I'm not sure how adding it later might be backwards incompatible? |
Ah sorry meant to respond sooner. My intention is that we interepret strings as space-separated lists of arguments, so the interpretation today (just an opaque name for a binary) would be backwards incompatible with the space-separated interpretation. For example runner = 'C:\Program Files\nodejs\bin\node' Today that'd be valid but if we started interpreting spaces as separators it'd break. Instead that'd ideally be specified as: runner = ['C:\Program Files\nodejs\bin\node'] |
@alexcrichton Ah yeah. I just thought - if we don't add support for space-separated arguments, then
could be valid now and
could be added later without breaking backward compatibility (basically supporting two syntaxes). Anyway, yeah, adding arguments should be quite trivial - I'll try to do that soon. |
ping @RReverser, do you think you'll be able to update this PR? If not no worries, I can take it over! |
😟 I need to parallelize myself. I definitely will (as well as for the other PR). If this is urgent, feel free to take over, otherwise, I should be able to finish a little bit later this week. |
Oh no worries! Just wanted to ping :) |
When `target.$triple.runner` is specified, it will be used for any execution commands by cargo including `cargo run`, `cargo test` and `cargo bench`. The original file is passed to the runner executable as a first argument. This allows to run tests when cross-comping Rust projects. This is not a complete solution, and might be extended in future for better ergonomics to support passing extra arguments to the runner itself or overriding runner from command line, but it should already unlock major existing usecases. Fixes rust-lang#1411 Resolves rust-lang#3626
Added runner params support (can be passed by using a list or space-separated string). |
@bors: r+ Looks great to me! |
📌 Commit 851a284 has been approved by |
Add support for custom target-specific runners When `target.$triple.runner` is specified, it will be used for any execution commands by cargo including `cargo run`, `cargo test` and `cargo bench`. The original file is passed to the runner executable as a first argument. This allows to run tests when cross-comping Rust projects. This is not a complete solution and might be extended in future for better ergonomics to support passing extra arguments to the runner itself or overriding runner from the command line, but it should already unlock major existing use cases. Fixes #1411 Resolves #3626
💔 Test failed - status-travis |
Tidy failure: |
I will run tidy before submitting PRs... |
@bors: r+ Thanks @RReverser! |
📌 Commit 0f1c687 has been approved by |
⌛ Testing commit 0f1c687 with merge 3fa09c2... |
Add support for custom target-specific runners When `target.$triple.runner` is specified, it will be used for any execution commands by cargo including `cargo run`, `cargo test` and `cargo bench`. The original file is passed to the runner executable as a first argument. This allows to run tests when cross-comping Rust projects. This is not a complete solution and might be extended in future for better ergonomics to support passing extra arguments to the runner itself or overriding runner from the command line, but it should already unlock major existing use cases. Fixes #1411 Resolves #3626
☀️ Test successful - status-appveyor, status-travis |
Thanks for review! |
When
target.$triple.runner
is specified, it will be used for any execution commands by cargo includingcargo run
,cargo test
andcargo bench
. The original file is passed to the runner executable as a first argument.This allows to run tests when cross-comping Rust projects.
This is not a complete solution and might be extended in future for better ergonomics to support passing extra arguments to the runner itself or overriding runner from the command line, but it should already unlock major existing use cases.
Fixes #1411
Resolves #3626