Package: meli Version: 0.8.7+20241007+dfsg-1 I hope to update rust-nix to version 0.29 soon. For meli this means dropping most of 2001_nix.patch, bumping the nix dependency in the tools directory, making some minor adjustments to other packages and bumping the debian build-dependencies.
A debdiff is attached, the new version of nix is available in experimental
diff -Nru meli-0.8.7+20241007+dfsg/debian/changelog meli-0.8.7+20241007+dfsg/debian/changelog --- meli-0.8.7+20241007+dfsg/debian/changelog 2024-10-16 13:28:19.000000000 +0000 +++ meli-0.8.7+20241007+dfsg/debian/changelog 2024-10-19 14:57:22.000000000 +0000 @@ -1,3 +1,15 @@ +meli (0.8.7+20241007+dfsg-1.1) UNRELEASED; urgency=medium + + * Non-maintainer upload. + * Adjust 2001_nix.patch for nix 0.29 + + Stop patching meli and melib directories. + + Raise upper limit in tools directory. + * Reduce context in 2001_sealed_test.patch and 2002_system-shared_libs.patch + so they don't conflict with 2001_nix.patch. + * Update debian build-dependency for nix crate from 0.27 to 0.29. + + -- Peter Michael Green <[email protected]> Sat, 19 Oct 2024 14:57:22 +0000 + meli (0.8.7+20241007+dfsg-1) unstable; urgency=medium [ upstream ] diff -Nru meli-0.8.7+20241007+dfsg/debian/control meli-0.8.7+20241007+dfsg/debian/control --- meli-0.8.7+20241007+dfsg/debian/control 2024-09-21 11:25:37.000000000 +0000 +++ meli-0.8.7+20241007+dfsg/debian/control 2024-10-19 14:57:22.000000000 +0000 @@ -29,15 +29,15 @@ librust-libc-0.2+extra-traits-dev, librust-linkify-0.9+default-dev, librust-native-tls-0.2+default-dev, - librust-nix-0.27+dir-dev, - librust-nix-0.27+fs-dev, - librust-nix-0.27+hostname-dev, - librust-nix-0.27+ioctl-dev, - librust-nix-0.27+poll-dev, - librust-nix-0.27+process-dev, - librust-nix-0.27+signal-dev, - librust-nix-0.27+socket-dev, - librust-nix-0.27+term-dev, + librust-nix-0.29+dir-dev, + librust-nix-0.29+fs-dev, + librust-nix-0.29+hostname-dev, + librust-nix-0.29+ioctl-dev, + librust-nix-0.29+poll-dev, + librust-nix-0.29+process-dev, + librust-nix-0.29+signal-dev, + librust-nix-0.29+socket-dev, + librust-nix-0.29+term-dev, librust-nom-7+default-dev, librust-notify-rust-4+default-dev, librust-notify-6+default-dev, diff -Nru meli-0.8.7+20241007+dfsg/debian/patches/2001_nix.patch meli-0.8.7+20241007+dfsg/debian/patches/2001_nix.patch --- meli-0.8.7+20241007+dfsg/debian/patches/2001_nix.patch 2024-10-16 13:28:19.000000000 +0000 +++ meli-0.8.7+20241007+dfsg/debian/patches/2001_nix.patch 2024-10-19 14:56:12.000000000 +0000 @@ -1,7 +1,7 @@ -Description: use (mostly) older branch of crate nix - This essentially reverts upstream git commit 1cfb0b1. +Description: use newer branch of crate nix Author: Jonas Smedegaard <[email protected]> -Last-Update: 2024-06-09 +Author: Peter Michael Green <[email protected]> +Last-Update: 2024-10-19 --- This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ --- a/tools/Cargo.toml @@ -11,385 +11,7 @@ meli = { path = "../meli", version = "0.8" } melib = { path = "../melib", version = "0.8", features = ["debug-tracing" ] } -nix = { version = "^0.24", default-features = false } -+nix = { version = ">= 0.24, <= 0.27", default-features = false } ++nix = { version = ">= 0.24, <= 0.29", default-features = false } signal-hook = { version = "^0.3", default-features = false, features = ["iterator"] } signal-hook-registry = { version = "1.2.0", default-features = false } ---- a/meli/Cargo.toml -+++ b/meli/Cargo.toml -@@ -34,7 +34,7 @@ - libz-sys = { version = "1.1", features = ["static"], optional = true } - linkify = { version = ">= 0.9.0, <= 0.10", default-features = false } - melib = { path = "../melib", version = "0.8.7", features = [] } --nix = { version = "0.29", default-features = false, features = ["signal", "poll", "term", "ioctl", "process"] } -+nix = { version = "0.27.1", default-features = false, features = ["signal", "poll", "term", "ioctl", "process"] } - regex = { version = "1" } - serde = { version = "1.0.71" } - serde_derive = { version = "1.0.71" } ---- a/melib/Cargo.toml -+++ b/melib/Cargo.toml -@@ -35,7 +35,7 @@ - libloading = { version = "^0.8" } - log = { version = "0.4", features = ["std"] } - native-tls = { version = "0.2.3", default-features = false, optional = true } --nix = { version = "0.29", default-features = false, features = ["fs", "socket", "dir", "hostname"] } -+nix = { version = "0.27.1", default-features = false, features = ["fs", "socket", "dir", "hostname"] } - nom = { version = "7" } - notify = { version = "6.1.1", optional = true } - polling = { version = "3" } ---- a/meli/src/conf.rs -+++ b/meli/src/conf.rs -@@ -310,7 +310,7 @@ - xdg_dirs.get_config_home().display() - ) - }) -- .chain_err_kind(ErrorKind::Platform) -+ .chain_err_kind(ErrorKind::OSError) - } - - impl FileSettings { ---- a/meli/src/conf/preprocessing.rs -+++ b/meli/src/conf/preprocessing.rs -@@ -255,7 +255,7 @@ - _ => { - return Err(Error::new("Could not process configuration with `m4`") - .set_source(Some(Arc::new(err))) -- .set_kind(ErrorKind::Platform)) -+ .set_kind(ErrorKind::OSError)) - } - }, - }; ---- a/meli/src/signal_handlers.rs -+++ b/meli/src/signal_handlers.rs -@@ -20,12 +20,7 @@ - // - // SPDX-License-Identifier: EUPL-1.2 OR GPL-3.0-or-later - --//! Signal handler setup. -- --use std::os::{ -- fd::{AsFd, AsRawFd}, -- raw::c_int, --}; -+use std::os::raw::c_int; - - use crate::*; - -@@ -39,7 +34,7 @@ - nix::unistd::pipe().map_err(|err| std::io::Error::from_raw_os_error(err as i32))?; - let alarm_handler = move |info: &nix::libc::siginfo_t| { - let value = unsafe { info.si_value().sival_ptr as u8 }; -- let _ = nix::unistd::write(alarm_pipe_w.as_fd(), &[value]); -+ let _ = nix::unistd::write(alarm_pipe_w, &[value]); - }; - unsafe { - signal_hook_registry::register_sigaction(signal_hook::consts::SIGALRM, alarm_handler)?; -@@ -47,7 +42,7 @@ - let (s, r) = crossbeam::channel::bounded(100); - let mut signals = signal_hook::iterator::Signals::new(signals)?; - let _ = nix::fcntl::fcntl( -- alarm_pipe_r.as_raw_fd(), -+ alarm_pipe_r, - nix::fcntl::FcntlArg::F_SETFL(nix::fcntl::OFlag::O_NONBLOCK), - ); - std::thread::spawn(move || { ---- a/meli/src/state.rs -+++ b/meli/src/state.rs -@@ -100,7 +100,7 @@ - } - - fn kill(&self) { -- let _ = nix::unistd::write(&self.pipe.1, &[1]); -+ let _ = nix::unistd::write(self.pipe.1.as_raw_fd(), &[1]); - self.tx.send(InputCommand::Kill).unwrap(); - } - ---- a/meli/src/terminal/keys.rs -+++ b/meli/src/terminal/keys.rs -@@ -23,7 +23,7 @@ - - use crossbeam::{channel::Receiver, select}; - use melib::log; --use nix::poll::{poll, PollFd, PollFlags, PollTimeout}; -+use nix::poll::{poll, PollFd, PollFlags}; - use serde::{Serialize, Serializer}; - use termion::{ - event::{ -@@ -244,15 +244,15 @@ - ) { - let stdin = std::io::stdin(); - let stdin2 = std::io::stdin(); -- let stdin_fd = PollFd::new(stdin2.as_fd(), PollFlags::POLLIN); -- let new_command_pollfd = PollFd::new(new_command_fd.as_fd(), PollFlags::POLLIN); -+ let stdin2_fd = stdin2.as_fd(); -+ let stdin_fd = PollFd::new(&stdin2_fd, PollFlags::POLLIN); -+ let new_command_pollfd = nix::poll::PollFd::new(new_command_fd, nix::poll::PollFlags::POLLIN); - let mut input_mode = InputMode::Normal; - let mut esc_seq_buf = vec![]; - let mut palette = (None, None); - let mut paste_buf = String::with_capacity(256); - let mut stdin_iter = stdin.events_and_raw(); -- 'poll_while: while let Ok(_n_raw) = poll(&mut [new_command_pollfd, stdin_fd], PollTimeout::NONE) -- { -+ 'poll_while: while let Ok(_n_raw) = poll(&mut [new_command_pollfd, stdin_fd], -1) { - select! { - default => { - if stdin_fd.revents().is_some() { -@@ -338,9 +338,9 @@ - use nix::sys::time::TimeValLike; - let mut buf = [0;2]; - let mut read_fd_set = nix::sys::select::FdSet::new(); -- read_fd_set.insert(new_command_fd.as_fd()); -+ read_fd_set.insert(new_command_fd); - let mut error_fd_set = nix::sys::select::FdSet::new(); -- error_fd_set.insert(new_command_fd.as_fd()); -+ error_fd_set.insert(new_command_fd); - let timeval: nix::sys::time::TimeSpec = nix::sys::time::TimeSpec::seconds(2); - let pselect_result = nix::sys::select::pselect(None, Some(&mut read_fd_set), None, Some(&mut error_fd_set), Some(&timeval), None); - if pselect_result.is_err() || error_fd_set.highest().map(|bfd| bfd.as_raw_fd()) == Some(new_command_fd.as_raw_fd()) || read_fd_set.highest().map(|bfd| bfd.as_raw_fd()) != Some(new_command_fd.as_raw_fd()) { ---- a/meli/src/types/helpers.rs -+++ b/meli/src/types/helpers.rs -@@ -23,9 +23,13 @@ - fs, - fs::OpenOptions, - io::{Read, Write}, -- os::{fd::OwnedFd, unix::fs::PermissionsExt}, -+ os::{ -+ fd::{FromRawFd, OwnedFd}, -+ unix::fs::PermissionsExt, -+ }, - path::{Path, PathBuf}, - }; -+use nix::errno::Errno; - - use melib::{ - error::*, -@@ -164,7 +168,7 @@ - (Err(err), Some(ref mut val)) - if matches!( - err.kind, -- ErrorKind::OSError(Errno::ENAMETOOLONG | Errno::EEXIST) -+ ErrorKind::OSError - ) && val.grapheme_len() > 1 => - { - val.truncate_at_boundary(val.grapheme_len().saturating_sub(1)); -@@ -182,13 +186,15 @@ - } - - pub fn pipe() -> Result<(OwnedFd, OwnedFd)> { -- nix::unistd::pipe().map_err(|err| { -- Error::new("Could not create pipe") -- .set_source(Some( -- (Box::new(err) as Box<dyn std::error::Error + Send + Sync + 'static>).into(), -- )) -- .set_kind(ErrorKind::Platform) -- }) -+ nix::unistd::pipe() -+ .map(|(fd1, fd2)| unsafe { (OwnedFd::from_raw_fd(fd1), OwnedFd::from_raw_fd(fd2)) }) -+ .map_err(|err| { -+ Error::new("Could not create pipe") -+ .set_source(Some( -+ (Box::new(err) as Box<dyn std::error::Error + Send + Sync + 'static>).into(), -+ )) -+ .set_kind(ErrorKind::OSError) -+ }) - } - - /// Create a shell-friendly filename by removing control characters and ---- a/melib/src/error.rs -+++ b/melib/src/error.rs -@@ -29,8 +29,6 @@ - sync::Arc, - }; - --pub use nix::errno::Errno; -- - pub type Result<T> = result::Result<T, Error>; - - mod network; -@@ -54,7 +52,7 @@ - Bug, - Network(NetworkErrorKind), - TimedOut, -- OSError(Errno), -+ OSError, - Platform, - NotImplemented, - NotSupported, -@@ -78,7 +76,7 @@ - ), - Self::Platform => write!(fmt, "Platform/Runtime environment error (OS or hardware)"), - Self::TimedOut => write!(fmt, "Timed out error"), -- Self::OSError(errno) => write!(fmt, "OS error {}: {}", *errno as i32, errno.desc()), -+ Self::OSError => write!(fmt, "OS error"), - Self::Configuration => write!(fmt, "Configuration error"), - Self::NotImplemented => write!(fmt, "Not implemented error"), - Self::NotSupported => write!(fmt, "Not supported error"), -@@ -99,7 +97,7 @@ - - impl ErrorKind { - /// Handy alias for "Already exists" error. -- pub const ALREADY_EXISTS: Self = Self::OSError(Errno::EEXIST); -+ pub const ALREADY_EXISTS: Self = Self::OSError; - - is_variant! { is_authentication, Authentication } - is_variant! { is_bug, Bug } -@@ -111,7 +109,7 @@ - is_variant! { is_not_implemented, NotImplemented } - is_variant! { is_not_supported, NotSupported } - is_variant! { is_not_found, NotFound } -- is_variant! { is_oserror, OSError(_) } -+ is_variant! { is_oserror, OSError } - is_variant! { is_protocol_error, ProtocolError } - is_variant! { is_protocol_not_supported, ProtocolNotSupported } - is_variant! { is_timeout, TimedOut } -@@ -439,7 +437,7 @@ - | io::ErrorKind::ConnectionAborted - | io::ErrorKind::NotConnected => Self::Network(NetworkErrorKind::ConnectionFailed), - io::ErrorKind::TimedOut => Self::TimedOut, -- _ => Self::Platform, -+ _ => Self::OSError, - } - } - } -@@ -455,8 +453,6 @@ - let s = err.to_string(); - let kind = if s.contains("failed to lookup address information") { - ErrorKind::Network(NetworkErrorKind::HostLookupFailed) -- } else if let Some(errno) = err.raw_os_error() { -- ErrorKind::OSError(Errno::from_raw(errno)) - } else { - err.kind().into() - }; -@@ -557,7 +553,7 @@ - impl From<nix::Error> for Error { - #[inline] - fn from(err: nix::Error) -> Self { -- Self::from_inner(Arc::new(err)).set_kind(ErrorKind::OSError(err)) -+ Self::from_inner(Arc::new(err)).set_kind(ErrorKind::Platform) - } - } - -@@ -576,8 +572,8 @@ - let kind = match err.kind { - notify::ErrorKind::MaxFilesWatch - | notify::ErrorKind::WatchNotFound -- | notify::ErrorKind::Generic(_) -- | notify::ErrorKind::Io(_) => ErrorKind::Platform, -+ | notify::ErrorKind::Generic(_) => ErrorKind::Platform, -+ notify::ErrorKind::Io(_) => ErrorKind::OSError, - notify::ErrorKind::PathNotFound => ErrorKind::Configuration, - notify::ErrorKind::InvalidConfig(_) => ErrorKind::Bug, - }; ---- a/melib/src/imap/connection.rs -+++ b/melib/src/imap/connection.rs -@@ -309,7 +309,7 @@ - .chain_err_summary(|| format!("Could not initiate TLS negotiation to {}.", path))?; - AsyncWrapper::new(Connection::new_tls(conn)) - .chain_err_summary(|| format!("{} connection failed.", path)) -- .chain_err_kind(ErrorKind::External)? -+ .chain_err_kind(ErrorKind::OSError)? - } - } else { - AsyncWrapper::new({ ---- a/melib/src/smtp.rs -+++ b/melib/src/smtp.rs -@@ -145,15 +145,14 @@ - }) - .await - .chain_err_summary(|| format!("Could not execute CommandEval value: {}", command)) -- .chain_err_kind(ErrorKind::External)?; -+ .chain_err_kind(ErrorKind::OSError)?; - if !output.status.success() { - return Err(Error::new(format!( - "SMTP password evaluation command `{}` returned {}: {}", - command, - output.status, - String::from_utf8_lossy(&output.stderr) -- )) -- .set_kind(ErrorKind::External)); -+ ))); - } - if output.stdout.ends_with(b"\n") { - output.stdout.pop(); ---- a/melib/src/utils/mod.rs -+++ b/melib/src/utils/mod.rs -@@ -233,7 +233,7 @@ - let retval = nix::unistd::gethostname().map_err(|err| { - Error::new("Could not discover local hostname") - .set_source(Some(src_err_arc_wrap! {err})) -- .set_kind(ErrorKind::Platform) -+ .set_kind(ErrorKind::OSError) - }); - if retval.is_err() { - let mut hostn_buf = String::with_capacity(256); ---- a/melib/src/utils/shellexpand.rs -+++ b/melib/src/utils/shellexpand.rs -@@ -237,14 +237,14 @@ - }; - - let dir = match ::nix::dir::Dir::openat( -- Some(::libc::AT_FDCWD), -+ ::libc::AT_FDCWD, - prefix, - OFlag::O_DIRECTORY | OFlag::O_NOATIME | OFlag::O_RDONLY | OFlag::O_CLOEXEC, - ::nix::sys::stat::Mode::S_IRUSR | ::nix::sys::stat::Mode::S_IXUSR, - ) - .or_else(|_| { - ::nix::dir::Dir::openat( -- Some(::libc::AT_FDCWD), -+ ::libc::AT_FDCWD, - prefix, - OFlag::O_DIRECTORY | OFlag::O_RDONLY | OFlag::O_CLOEXEC, - ::nix::sys::stat::Mode::S_IRUSR | ::nix::sys::stat::Mode::S_IXUSR, ---- a/melib/src/utils/lock.rs -+++ b/melib/src/utils/lock.rs -@@ -24,7 +24,8 @@ - /// (Linux-only). - use std::{os::fd::AsRawFd, path::Path, thread::sleep, time::Duration}; - --use crate::error::{Errno, Error, ErrorKind, Result}; -+use crate::error::{Error, ErrorKind, Result}; -+use nix::errno::Errno; - - pub enum FileLockOptions { - Nonblocking { -@@ -134,7 +135,7 @@ - path.display(), - err.desc() - )) -- .set_kind(ErrorKind::OSError(err))) -+ .set_kind(ErrorKind::OSError)) - } - } - ---- a/melib/src/utils/tests.rs -+++ b/melib/src/utils/tests.rs -@@ -30,7 +30,8 @@ - use sealed_test::prelude::*; - use tempfile::TempDir; - --use crate::error::{Errno, ErrorKind}; -+use crate::error::ErrorKind; -+use nix::errno::Errno; - - #[sealed_test] - #[ignore] -@@ -308,7 +309,7 @@ - ) - .unwrap_err() - .kind, -- ErrorKind::OSError(Errno::EAGAIN) -+ ErrorKind::OSError - ); - assert_eq!( - open() -@@ -321,7 +322,7 @@ - ) - .unwrap_err() - .kind, -- ErrorKind::OSError(Errno::EAGAIN) -+ ErrorKind::OSError - ); - drop(f); - open() diff -Nru meli-0.8.7+20241007+dfsg/debian/patches/2001_sealed_test.patch meli-0.8.7+20241007+dfsg/debian/patches/2001_sealed_test.patch --- meli-0.8.7+20241007+dfsg/debian/patches/2001_sealed_test.patch 2024-09-21 11:29:34.000000000 +0000 +++ meli-0.8.7+20241007+dfsg/debian/patches/2001_sealed_test.patch 2024-10-19 14:57:22.000000000 +0000 @@ -42,23 +42,15 @@ toml = { version = "0.8", default-features = false, features = ["display","preserve_order","parse"] } --- a/melib/src/utils/tests.rs +++ b/melib/src/utils/tests.rs -@@ -27,15 +27,13 @@ - path::Path, - }; - +@@ -27,1 +27,0 @@ -use sealed_test::prelude::*; - use tempfile::TempDir; - - use crate::error::ErrorKind; - use nix::errno::Errno; +@@ -40,5 +40,4 @@ -#[sealed_test] -#[ignore] #[test] +#[ignore] fn test_shellexpandtrait() { - use super::shellexpand::*; - @@ -155,9 +153,8 @@ } diff -Nru meli-0.8.7+20241007+dfsg/debian/patches/2002_system-shared_libs.patch meli-0.8.7+20241007+dfsg/debian/patches/2002_system-shared_libs.patch --- meli-0.8.7+20241007+dfsg/debian/patches/2002_system-shared_libs.patch 2024-09-21 11:29:35.000000000 +0000 +++ meli-0.8.7+20241007+dfsg/debian/patches/2002_system-shared_libs.patch 2024-10-19 14:57:22.000000000 +0000 @@ -6,14 +6,12 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ --- a/meli/Cargo.toml +++ b/meli/Cargo.toml -@@ -31,7 +31,6 @@ - indexmap = { version = "2.2.6", default-features = false, features = ["serde", "std"] } +@@ -32,5 +32,4 @@ itoa = { version = "1.0.9", default-features = false } libc = { version = "0.2.125", default-features = false, features = ["extra_traits"] } -libz-sys = { version = "1.1", features = ["static"], optional = true } linkify = { version = ">= 0.9.0, <= 0.10", default-features = false } melib = { path = "../melib", version = "0.8.7", features = [] } - nix = { version = "0.27.1", default-features = false, features = ["signal", "poll", "term", "ioctl", "process"] } @@ -49,7 +48,7 @@ xdg = { version = "2.1.0" }

