-
Notifications
You must be signed in to change notification settings - Fork 63
PtyProcess: add NO_CTTY flag #101
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
Conversation
bors try |
tryBuild succeeded: |
@matthiasbeyer so far this passes 100% of the tests. |
bors try |
Ah. This failed as well. |
tryBuild failed: |
rust-cache@v1 seems to generate some deprecation warnings, so better update to v2. Signed-off-by: Petre Eftime <[email protected]>
The default behavior of posix_openpt seems to be to replace the controlling terminal for the calling process, and PtyProcess should only change it for child instead. I think this might be a reason why some of the tests were failing non-deterministacally sometimes, although I am not 100% confident in this fix. Signed-off-by: Petre Eftime <[email protected]>
Signed-off-by: Petre Eftime <[email protected]>
7d85dac
to
ab53025
Compare
bors try |
tryBuild failed: |
Signed-off-by: Petre Eftime <[email protected]>
bors try |
tryBuild succeeded: |
bors try |
tryBuild failed: |
In pexpect, a similar issue is called out: https://github.com/pexpect/pexpect/blob/2532721644781543ca660e52d48a35bd93872fc1/doc/commonissues.rst#timing-issue-with-send-and-sendline |
Signed-off-by: Petre Eftime <[email protected]>
1eb0ce6
to
7156464
Compare
bors try |
tryBuild succeeded: |
bors try |
tryBuild failed: |
Signed-off-by: Petre Eftime <[email protected]>
bors try |
tryBuild failed: |
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.
I am fine with the patch per se, if it helps. Only one annotation to simplify a bit of code here.
But as far as I can see, CI still fails? Or am I missing something?
unsafe { | ||
match ioctl(master_fd.as_raw_fd(), TIOCSCTTY) { | ||
0 => Ok(()), | ||
_ => Err(nix::Error::last()), | ||
}?; | ||
} |
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.
I assume the unsafe block is only needed for the ioctl
call here, isn't it?
also, we don't need to match here, I think.
unsafe { | |
match ioctl(master_fd.as_raw_fd(), TIOCSCTTY) { | |
0 => Ok(()), | |
_ => Err(nix::Error::last()), | |
}?; | |
} | |
if 0 != unsafe { ioctl(master_fd.as_raw_fd(), TIOCSCTTY) } { | |
return Err(nix::Error::last()) | |
} |
Yes, so far I was reading through how pexpect or some other terminal emulators set this up and see if we're missing anything. So far, not luck with getting the issue fixed unfortunately, and no matter what I do I can't seem to be able to reproduce it on my setup. |
Yeah that also was the case for me... it seems like we only have this issue in CI, which makes it even worse. |
The default behavior of posix_openpt seems to be to replace the controlling terminal for the calling process, and PtyProcess should only change it for child instead. I think this might be a reason why some of the tests were failing non-deterministacally sometimes, although I am not 100% confident in this fix.
Signed-off-by: Petre Eftime [email protected]