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

Upgrade nix #226

Merged
merged 3 commits into from
Aug 28, 2023
Merged

Upgrade nix #226

merged 3 commits into from
Aug 28, 2023

Conversation

rkuris
Copy link
Collaborator

@rkuris rkuris commented Aug 28, 2023

Two major changes:

  • features must be included; we only need two (this will speed up compiles!)
  • FD safety; we now need an OwnedFd, so attempting to use the fd after the object is dropped is no longer valid. Additionally, we don't need to implement Drop, as OwnedFd already has a drop which calls close

References:

Two major changes:
 - features must be included; we only need two (this will speed up
   compiles!)
 - FD safety; we now need an OwnedFd, so attempting to use the fd after
   the object is dropped is no longer valid. Additionally, we don't need
   to implement Drop, as OwnedFd already has a drop which calls close

References:

 * nix-rust/nix#2091 - nix PR for features drop
 * https://doc.rust-lang.org/stable/src/std/os/fd/owned.rs.html#170-182 - OwnedFd docs
 * nix-rust/nix#1906 - nix PR for FD I/O safety
@rkuris rkuris marked this pull request as ready for review August 28, 2023 16:20
pub struct File {
fd: Fd,
fd: OwnedFd,
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

}

type Target = OwnedFd;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: can you move this to the top of the impl block, please?

@rkuris rkuris merged commit 42111f1 into main Aug 28, 2023
5 checks passed
@rkuris rkuris deleted the rkuris/nix-old-nix branch August 28, 2023 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants