-
Notifications
You must be signed in to change notification settings - Fork 37
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
Allow conversion of std::process::Command
into a openssh::Command
given a openssh::Session
.
#112
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost done from me, some small changes requested...
Regarding the ICEs, there's already a PR in rust-lang/rust to fix this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now we just need to wait for @jonhoo to review this and upstream to fix the ICEs on stable channel.
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! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
Signed-off-by: Aalekh Patel <[email protected]>
Signed-off-by: Aalekh Patel <[email protected]>
Signed-off-by: Aalekh Patel <[email protected]>
Signed-off-by: Aalekh Patel <[email protected]>
Signed-off-by: Aalekh Patel <[email protected]>
Signed-off-by: Aalekh Patel <[email protected]>
Co-authored-by: Jiahao XU <[email protected]>
Signed-off-by: Aalekh Patel <[email protected]>
Signed-off-by: Aalekh Patel <[email protected]>
Co-authored-by: Jiahao XU <[email protected]>
Co-authored-by: Jiahao XU <[email protected]>
Co-authored-by: Jiahao XU <[email protected]>
Signed-off-by: Aalekh Patel <[email protected]>
Signed-off-by: Aalekh Patel <[email protected]>
Signed-off-by: Aalekh Patel <[email protected]>
Signed-off-by: Aalekh Patel <[email protected]>
Co-authored-by: Jiahao XU <[email protected]>
Co-authored-by: Jiahao XU <[email protected]>
Co-authored-by: Jiahao XU <[email protected]>
Signed-off-by: Aalekh Patel <[email protected]>
Signed-off-by: Aalekh Patel <[email protected]>
Signed-off-by: Aalekh Patel <[email protected]>
…the command. Signed-off-by: Aalekh Patel <[email protected]>
Signed-off-by: Aalekh Patel <[email protected]>
Signed-off-by: Aalekh Patel <[email protected]>
Since the ICE is fixed and the CI has passed, I will merge this PR. |
The
std::process::Command
and theopenssh::Command
APIs are fairly similar, so I wonder if it is reasonable to allow an arbitrarystd::process::Command
to be run over ssh.Example