Skip to content
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

3.1.0 switch to rustix again for glibc compat #32

Closed
wants to merge 4 commits into from

Conversation

jackyzha0
Copy link
Member

No description provided.

@jackyzha0 jackyzha0 changed the title switch to rustix again for glibc compat 3.1.0 switch to rustix again for glibc compat Jun 11, 2024
@jackyzha0 jackyzha0 requested a review from lhchavez June 11, 2024 23:07
index.d.ts Outdated
@@ -27,7 +27,7 @@ export class Pty {
* Returns a file descriptor for the PTY controller.
* See the docstring of the class for an usage example.
*/
fd(): c_int
fd(): RawFd
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't think this is a legit type, ha. how can we make this return number?

src/lib.rs Outdated
@@ -272,7 +269,7 @@ impl Pty {
/// See the docstring of the class for an usage example.
#[napi]
#[allow(dead_code)]
pub fn fd(&mut self) -> Result<c_int, napi::Error> {
pub fn fd(&mut self) -> Result<RawFd, napi::Error> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pub fn fd(&mut self) -> Result<RawFd, napi::Error> {
pub fn fd(&mut self) -> Result<i32, napi::Error> {

it's disgusting, but i think we need to cast this to i32 so that the codegen emits a nice number https://napi.rs/docs/concepts/function

src/lib.rs Outdated
Comment on lines 200 to 201
let controller_fd = unsafe { OwnedFd::from_raw_fd(raw_controller_fd) };
poll_controller_fd_until_read(controller_fd);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm i think this is unsafe, because we don't truly own the raw controller fd in this context, and exiting the poll will .close it! but then we will .close it again in .close()!!!

we probably need to reintroduce the fd copying that we had earlier 😭.

@jackyzha0
Copy link
Member Author

this is a lil borked, closing for now and trying ubuntu-2004

@jackyzha0 jackyzha0 closed this Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants