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
Update nix to 0.28.0 #2728
Update nix to 0.28.0 #2728
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #2728 +/- ##
==========================================
- Coverage 65.21% 65.20% -0.02%
==========================================
Files 133 133
Lines 16981 16981
==========================================
- Hits 11074 11072 -2
- Misses 5907 5909 +2 |
Where can I find this change? I couldn't find the change you mentioned. |
Yeah, I could not find that in the change-log too. The change was done in this PR: nix-rust/nix#2100. Sorry, it seems that only write() has been changed. Close() still takes |
// Since nix = "0.27.1", `mmap()` requires a generic type `F: AsFd`. | ||
// `::<File>` doesn't have any meaning because we won't use it. | ||
mman::mmap::<File>( | ||
mman::mmap_anonymous( | ||
None, | ||
NonZeroUsize::new(default_stack_size).ok_or(CloneError::ZeroStackSize)?, | ||
mman::ProtFlags::PROT_READ | mman::ProtFlags::PROT_WRITE, | ||
mman::MapFlags::MAP_PRIVATE | mman::MapFlags::MAP_ANONYMOUS | mman::MapFlags::MAP_STACK, | ||
None, | ||
0, | ||
) |
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.
Need to check if this change is ok (should be, just have to confirm), but in that case, we should also remove the comment above, as not applicable anymore.
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.
Hey, this still needs to be addressed, the function change is valid, so comment should be updated/removed.
crates/libcontainer/src/process/container_intermediate_process.rs
Outdated
Show resolved
Hide resolved
e4ccbbd
to
493da85
Compare
@omprakaash It seems CI failed with lint. May I ask you to check it? |
Oh sorry about that, should have fixed the linting issues now. |
@omprakaash Thanks! |
@zahash @anti-entropy123 @YJDoc2 May I ask you to leave this PR to you? |
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.
looks good
@@ -148,13 +149,13 @@ impl TenantContainerBuilder { | |||
let mut notify_socket = NotifySocket::new(notify_path); | |||
notify_socket.notify_container_start()?; | |||
|
|||
close(write_end).map_err(LibcontainerError::OtherSyscall)?; | |||
close(write_end.as_raw_fd()).map_err(LibcontainerError::OtherSyscall)?; |
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.
Since write_end is OwnedFd
, why don't you close it by drop(write_end)
?
#[stable(feature = "io_safety", since = "1.63.0")]
impl Drop for OwnedFd {
#[inline]
fn drop(&mut self) {
unsafe {
...
let _ = libc::close(self.fd);
...
https://doc.rust-lang.org/nightly/src/std/os/fd/owned.rs.html#174-186
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.
You beat me to it 😂 #2728 (comment)
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.
While other changes are ok, I have some points of concern here regarding the mix of OwnedFd
and RawFd
. Main point of concern for this PR, is that in several places, we are converting a RawFd to OwnedFd, and then calling close on it manually when the OwnedFd gets closed in its drop. I feel this should be addressed here.
crates/libcontainer/src/process/container_intermediate_process.rs
Outdated
Show resolved
Hide resolved
0ec5908
to
f3f417f
Compare
Hey, thanks for updating. Two notes :
|
e4e7429
to
1123b43
Compare
Hey @omprakaash , it seems there are still some more conflicts here. In case you are busy, is it ok if I resolve them and push? because the conflicts are in cargo* files, not code, it would be pretty straight forward to resolve. Apart from that, the code is lgtm. |
Hey sorry for the late reply. I did not have the chance to look at this and missed your comment. Would be great if you could that. Thank you ! |
I will take care of this. |
630cccc
to
5e23878
Compare
Merge conflict is resolved. I will look over the review comments over the weekend and address them. |
commit f0a6b388e7f132648157ca2712e20a1ee93f265a Author: yihuaf <yihuaf@unkies.org> Date: Sun May 19 21:16:21 2024 -0700 Fix the explicit close Signed-off-by: yihuaf <yihuaf@unkies.org> commit 5e23878 Author: yihuaf <yihuaf@unkies.org> Date: Thu May 16 21:31:09 2024 -0700 Rebase to the latest main branch Signed-off-by: yihuaf <yihuaf@unkies.org> commit 3144355 Author: omprakaash <omsuseela@gmail.com> Date: Sat Mar 16 03:28:40 2024 +0000 Update nix to 0.28.0 Signed-off-by: omprakaash <omsuseela@gmail.com> Signed-off-by: om prakaash <omsuseela@gmail.com> Signed-off-by: yihuaf <yihuaf@unkies.org>
@YJDoc2 This is ready for review one last time. I have addressed the merge conflicts and went over the reviews. One note, the closing of the pipes (The fds that were converted from Let me know if there is anything else you would like to make change. |
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.
Looks good code itself, but please wait for release v0.3.3 🙏 https://github.com/containers/youki/pulls
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.
Code looks good, but unfortunately there's another conflict due to latest release. Approving so that after resolving and @utam0k 's approval, this can get merged. Thank you @omprakaash and @yihuaf for taking care of 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.
Thanks!
close #2723 |
Updates nix to 0.28.0. Changed the deprecated functions to new recommended ones. Another noticeable change was the write()
and close()functionsin nix now take inOwnedFd
instead ofRawFd
. Included changes for them as well.