--- Begin Message ---
Package: fish
I hope to update the nix crate to 0.30.1 soon. I put together
a patch to make fish build with the new upstream version.
Debdiff is attached.
diff -Nru fish-4.0.2/debian/changelog fish-4.0.2/debian/changelog
--- fish-4.0.2/debian/changelog 2025-04-20 17:01:54.000000000 +0000
+++ fish-4.0.2/debian/changelog 2025-09-25 11:25:33.000000000 +0000
@@ -1,3 +1,11 @@
+fish (4.0.2-1.1) UNRELEASED; urgency=medium
+
+ * Non-maintainer upload.
+ * Add upstream patch for nix 0.30
+ * Tighten debian build-dependency on nix to match Cargo dependency.
+
+ -- Peter Michael Green <[email protected]> Thu, 25 Sep 2025 11:25:33 +0000
+
fish (4.0.2-1) unstable; urgency=medium
* New upstream version 4.0.2
diff -Nru fish-4.0.2/debian/control fish-4.0.2/debian/control
--- fish-4.0.2/debian/control 2025-02-27 21:55:28.000000000 +0000
+++ fish-4.0.2/debian/control 2025-09-25 11:25:33.000000000 +0000
@@ -20,7 +20,7 @@
librust-lazy-static-dev,
librust-libc-dev (>= 0.2.169~),
librust-lru-dev,
- librust-nix-dev,
+ librust-nix-0.30-dev (>= 0.30.1),
librust-num-traits-dev,
librust-once-cell-dev,
librust-portable-atomic-dev,
diff -Nru fish-4.0.2/debian/patches/nix-0.31.patch
fish-4.0.2/debian/patches/nix-0.31.patch
--- fish-4.0.2/debian/patches/nix-0.31.patch 1970-01-01 00:00:00.000000000
+0000
+++ fish-4.0.2/debian/patches/nix-0.31.patch 2025-09-25 11:25:33.000000000
+0000
@@ -0,0 +1,144 @@
+commit c2eaef7273c5558678bc0465bdf5bdaef90859cd
+Author: Yuyi Wang <[email protected]>
+Date: Tue May 6 16:52:54 2025 +0800
+
+ Update nix to 0.30.1 (#11458)
+
+ After nix updated to 0.30, all functions related to file descriptor
accepts impl AsFd, e.g., BorrowedFd. This PR is a minimal update. It tries to
use impl AsFd as long as possible, but uses BorrowedFd in some places. Yes it
introduces unsafe, but doesn't introduce new unsafe code.
+
+Index: fish-4.0.2/Cargo.toml
+===================================================================
+--- fish-4.0.2.orig/Cargo.toml
++++ fish-4.0.2/Cargo.toml
+@@ -46,7 +46,7 @@ libc = "0.2.155"
+ # disabling default features uses the stdlib instead, but it doubles the time
to rewrite the history
+ # files as of 22 April 2024.
+ lru = "0.12.3"
+-nix = { version = "0.29.0", default-features = false, features = [
++nix = { version = "0.30.1", default-features = false, features = [
+ "event",
+ "inotify",
+ "resource",
+Index: fish-4.0.2/src/common.rs
+===================================================================
+--- fish-4.0.2.orig/src/common.rs
++++ fish-4.0.2/src/common.rs
+@@ -1340,7 +1340,7 @@ fn can_be_encoded(wc: char) -> bool {
+ /// Return the number of bytes read, or 0 on EOF, or an error.
+ pub fn read_blocked(fd: RawFd, buf: &mut [u8]) -> nix::Result<usize> {
+ loop {
+- let res = nix::unistd::read(fd, buf);
++ let res = nix::unistd::read(unsafe { BorrowedFd::borrow_raw(fd) },
buf);
+ if let Err(nix::Error::EINTR) = res {
+ continue;
+ }
+@@ -1387,7 +1387,7 @@ pub fn write_loop<Fd: AsRawFd>(fd: &Fd,
+ pub fn read_loop<Fd: AsRawFd>(fd: &Fd, buf: &mut [u8]) ->
std::io::Result<usize> {
+ let fd = fd.as_raw_fd();
+ loop {
+- match nix::unistd::read(fd, buf) {
++ match nix::unistd::read(unsafe { BorrowedFd::borrow_raw(fd) }, buf) {
+ Ok(read) => {
+ return Ok(read);
+ }
+Index: fish-4.0.2/src/fds.rs
+===================================================================
+--- fish-4.0.2.orig/src/fds.rs
++++ fish-4.0.2/src/fds.rs
+@@ -34,7 +34,7 @@ pub struct AutoCloseFd {
+
+ impl Read for AutoCloseFd {
+ fn read(&mut self, buf: &mut [u8]) -> std::io::Result<usize> {
+- nix::unistd::read(self.as_raw_fd(), buf).map_err(std::io::Error::from)
++ nix::unistd::read(self, buf).map_err(std::io::Error::from)
+ }
+ }
+
+@@ -191,7 +191,7 @@ fn heightenize_fd(fd: OwnedFd, input_has
+ }
+
+ // Here we are asking the kernel to give us a cloexec fd.
+- let newfd = match nix::fcntl::fcntl(raw_fd,
FcntlArg::F_DUPFD_CLOEXEC(FIRST_HIGH_FD)) {
++ let newfd = match nix::fcntl::fcntl(&fd,
FcntlArg::F_DUPFD_CLOEXEC(FIRST_HIGH_FD)) {
+ Ok(newfd) => newfd,
+ Err(err) => {
+ perror("fcntl");
+@@ -244,7 +244,7 @@ pub fn open_cloexec(path: &CStr, flags:
+ // If it is that's our cancel signal, so we abort.
+ loop {
+ let ret = nix::fcntl::open(path, flags | OFlag::O_CLOEXEC, mode);
+- let ret = ret.map(|raw_fd| unsafe { File::from_raw_fd(raw_fd) });
++ let ret = ret.map(File::from);
+ match ret {
+ Ok(file) => {
+ set_errno(saved_errno);
+Index: fish-4.0.2/src/reader.rs
+===================================================================
+--- fish-4.0.2.orig/src/reader.rs
++++ fish-4.0.2/src/reader.rs
+@@ -29,6 +29,7 @@ use std::io::Write;
+ use std::num::NonZeroUsize;
+ use std::ops::ControlFlow;
+ use std::ops::Range;
++use std::os::fd::BorrowedFd;
+ use std::os::fd::RawFd;
+ use std::pin::Pin;
+ use std::rc::Rc;
+@@ -752,7 +753,7 @@ fn read_ni(parser: &Parser, fd: RawFd, i
+ loop {
+ let mut buff = [0_u8; 4096];
+
+- match nix::unistd::read(fd, &mut buff) {
++ match nix::unistd::read(unsafe { BorrowedFd::borrow_raw(fd) }, &mut
buff) {
+ Ok(0) => {
+ // EOF.
+ break;
+Index: fish-4.0.2/src/tests/fd_monitor.rs
+===================================================================
+--- fish-4.0.2.orig/src/tests/fd_monitor.rs
++++ fish-4.0.2/src/tests/fd_monitor.rs
+@@ -82,7 +82,7 @@ impl ItemMaker {
+ }
+ ItemWakeReason::Readable => {
+ let mut buf = [0u8; 1024];
+- let res = nix::unistd::read(fd.as_raw_fd(), &mut buf);
++ let res = nix::unistd::read(&fd, &mut buf);
+ let amt = res.expect("read error!");
+ self.length_read.fetch_add(amt as usize, Ordering::Relaxed);
+ was_closed = amt == 0;
+Index: fish-4.0.2/src/topic_monitor.rs
+===================================================================
+--- fish-4.0.2.orig/src/topic_monitor.rs
++++ fish-4.0.2/src/topic_monitor.rs
+@@ -243,7 +243,7 @@ impl BinarySemaphore {
+ let _ = FdReadableSet::is_fd_readable(fd,
FdReadableSet::kNoTimeout);
+ }
+ let mut ignored: u8 = 0;
+- match unistd::read(fd, std::slice::from_mut(&mut
ignored)) {
++ match unistd::read(&pipes.read, std::slice::from_mut(&mut
ignored)) {
+ Ok(1) => break,
+ Ok(_) => continue,
+ // EAGAIN should only be possible if TSAN workarounds
have been applied
+Index: fish-4.0.2/src/universal_notifier/notifyd.rs
+===================================================================
+--- fish-4.0.2.orig/src/universal_notifier/notifyd.rs
++++ fish-4.0.2/src/universal_notifier/notifyd.rs
+@@ -5,7 +5,7 @@ use crate::universal_notifier::Universal
+ use crate::wchar::prelude::*;
+ use libc::{c_char, c_int};
+ use std::ffi::CString;
+-use std::os::fd::RawFd;
++use std::os::fd::{BorrowedFd, RawFd};
+
+ extern "C" {
+ fn notify_register_file_descriptor(
+@@ -114,7 +114,8 @@ impl UniversalNotifier for NotifydNotifi
+ let mut read_something = false;
+ let mut buff: [u8; 64] = [0; 64];
+ loop {
+- let res = nix::unistd::read(self.notify_fd, &mut buff);
++ let res =
++ nix::unistd::read(unsafe {
BorrowedFd::borrow_raw(self.notify_fd) }, &mut buff);
+
+ if let Ok(amt_read) = res {
+ read_something |= amt_read > 0;
diff -Nru fish-4.0.2/debian/patches/series fish-4.0.2/debian/patches/series
--- fish-4.0.2/debian/patches/series 2025-03-13 22:52:49.000000000 +0000
+++ fish-4.0.2/debian/patches/series 2025-09-25 11:25:33.000000000 +0000
@@ -2,3 +2,4 @@
relax-deps.patch
fix-libc-timespec.patch
ignore-unused-signals.patch
+nix-0.31.patch
--- End Message ---