Allow conversion of std::process::Command into a openssh::Command given a openssh::Session.#112
Conversation
NobodyXu
left a comment
There was a problem hiding this comment.
Thanks!
I really like the design and the implementation is simple, but there are a few places where it can be improved.
|
wow thank you for your kind words and a quick review. I'll clean it up right away! Thanks for your time. |
|
Ehhh we now have a rustc ICE. @aalekhpatel07 Would you like to open an issue in rust-lang/rust? |
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files
|
Haha for sure. Any preference for a name? |
|
@aalekhpatel07 Looks like some of the ICEs happens in mir borrow checking, so perhaps "mir borrow checking ICE in openssh-rust" will be a good name. Also I recommend you to create a separate branch, containing the commit causing the ICEs just so it's easier for others to reproduce the ICEs. |
|
I believe the new (I'm sorry I think I accidentally removed the review request for jonhoo). |
No worries, I've re-requested it. |
|
Aha, the CI reliably failed with ICEs from |
|
okay how about these changes? (thank you for being patient.) |
|
@aalekhpatel07 BTW, don't forget to create a new issue on rust-lang/rust and linked it to this. Since we are on rust 1.67, not nightly channel, this might requires a new minor release. I think this ICE might be a regression. |
|
@aalekhpatel07 Hmmm, let me create the bug report for this. |
|
@aalekhpatel07 I've created an ICE bug report on rust-lang/rust. Note that the lint CI did work as intended and you need to fix all |
NobodyXu
left a comment
There was a problem hiding this comment.
Almost done from me, some small changes requested...
Regarding the ICEs, there's already a PR in rust-lang/rust to fix this.
|
They have a PR for that ICE already?? Wow! I'm blown away by how responsive, knowledgeable, and supportive the contributors are in the Rust ecosystem. Thank you for all your help, @NobodyXu, for helping me improve the PR and develop my understanding of |
Though I have no idea on whether it will land in 1.68 or will they have a backport it to 1.67.1 since whether a backport will happen depends on the severity of the bug.
No worries! |
jonhoo
left a comment
There was a problem hiding this comment.
This is a really neat idea! Thank you both for pushing it forward. I've left some notes.
| @@ -0,0 +1,90 @@ | |||
| //! Escape characters that may have special meaning in a shell, including spaces. | |||
| //! This is a modified version of the [`shell-escape::unix`] module of [`shell-escape`] crate. | |||
There was a problem hiding this comment.
Can we submit a PR to shell-escape to add a version supporting OsStr there directly? I'm okay with us landing our own version initially, but it'd be way better if we could just use a version from them in the future.
There was a problem hiding this comment.
Great suggestion! I've initiated a PR to shell-escape and if it gets merged, we can avoid having a src/escape.rs altogether.
… openssh::Session. Signed-off-by: Aalekh Patel <aalekh.gwpeck.7998@icloud.com>
Signed-off-by: Aalekh Patel <aalekh.gwpeck.7998@icloud.com>
Signed-off-by: Aalekh Patel <aalekh.gwpeck.7998@icloud.com>
Signed-off-by: Aalekh Patel <aalekh.gwpeck.7998@icloud.com>
Signed-off-by: Aalekh Patel <aalekh.gwpeck.7998@icloud.com>
Signed-off-by: Aalekh Patel <aalekh.gwpeck.7998@icloud.com>
Signed-off-by: Aalekh Patel <aalekh.gwpeck.7998@icloud.com>
Co-authored-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Aalekh Patel <aalekh.gwpeck.7998@icloud.com>
Signed-off-by: Aalekh Patel <aalekh.gwpeck.7998@icloud.com>
Co-authored-by: Jiahao XU <Jiahao_XU@outlook.com>
Co-authored-by: Jiahao XU <Jiahao_XU@outlook.com>
Co-authored-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Aalekh Patel <aalekh@protectchildren.ca>
Signed-off-by: Aalekh Patel <aalekh@protectchildren.ca>
Signed-off-by: Aalekh Patel <aalekh@protectchildren.ca>
Signed-off-by: Aalekh Patel <aalekh@protectchildren.ca>
Co-authored-by: Jiahao XU <Jiahao_XU@outlook.com>
Co-authored-by: Jiahao XU <Jiahao_XU@outlook.com>
Co-authored-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Aalekh Patel <aalekh.gwpeck.7998@icloud.com>
Signed-off-by: Aalekh Patel <aalekh.gwpeck.7998@icloud.com>
Signed-off-by: Aalekh Patel <aalekh.gwpeck.7998@icloud.com>
…the command. Signed-off-by: Aalekh Patel <aalekh.gwpeck.7998@icloud.com>
Signed-off-by: Aalekh Patel <aalekh.gwpeck.7998@icloud.com>
Signed-off-by: Aalekh Patel <aalekh.gwpeck.7998@icloud.com>
|
Since the ICE is fixed and the CI has passed, I will merge this PR. |
The
std::process::Commandand theopenssh::CommandAPIs are fairly similar, so I wonder if it is reasonable to allow an arbitrarystd::process::Commandto be run over ssh.Example