From 7e78c0e9b7b57f3b7ec50a535270a8ae64788ae6 Mon Sep 17 00:00:00 2001 From: Peter Michael Green Date: Sat, 18 Dec 2021 21:40:00 +0000 Subject: [PATCH] zbus - prepare minimal fix upload. --- src/zbus/debian/changelog | 9 ++- src/zbus/debian/copyright.debcargo.hint | 2 +- src/zbus/debian/patches/relax-deps.patch | 12 ++-- src/zbus/debian/patches/relax-nix.patch | 68 ++++++++--------------- src/zbus/debian/patches/relax-ntest.patch | 44 --------------- src/zbus/debian/patches/series | 1 - src/zbus/debian/rules | 6 ++ src/zbus/debian/rules.debcargo.hint | 3 + 8 files changed, 44 insertions(+), 101 deletions(-) delete mode 100644 src/zbus/debian/patches/relax-ntest.patch create mode 100755 src/zbus/debian/rules create mode 100755 src/zbus/debian/rules.debcargo.hint diff --git a/src/zbus/debian/changelog b/src/zbus/debian/changelog index 62057bbbc..3f07094d3 100644 --- a/src/zbus/debian/changelog +++ b/src/zbus/debian/changelog @@ -1,9 +1,12 @@ -rust-zbus (1.9.2-1) UNRELEASED-FIXME-AUTOGENERATED-DEBCARGO; urgency=medium +rust-zbus (1.0.0-4) UNRELEASED-FIXME-AUTOGENERATED-DEBCARGO; urgency=medium * Team upload. - * Package zbus 1.9.2 from crates.io using debcargo 2.4.4 + * Package zbus 1.0.0 from crates.io using debcargo 2.5.0 + * Apply patch to make build work with latest rust-nix. + * Disable test build at package build time for now to get + the rust-nix fix into testing despite bug #1000942 - -- Henry-Nicolas Tourneur Mon, 06 Dec 2021 21:32:38 +0000 + -- Peter Michael Green Sat, 18 Dec 2021 21:48:48 +0000 rust-zbus (1.0.0-3) unstable; urgency=medium diff --git a/src/zbus/debian/copyright.debcargo.hint b/src/zbus/debian/copyright.debcargo.hint index 6f20d4195..1c4a8dda4 100644 --- a/src/zbus/debian/copyright.debcargo.hint +++ b/src/zbus/debian/copyright.debcargo.hint @@ -1,7 +1,7 @@ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: zbus Upstream-Contact: Zeeshan Ali -Source: https://gitlab.freedesktop.org/dbus/zbus/ +Source: https://gitlab.freedesktop.org/zeenix/zbus/ Files: * Copyright: FIXME (overlay) UNKNOWN-YEARS Zeeshan Ali diff --git a/src/zbus/debian/patches/relax-deps.patch b/src/zbus/debian/patches/relax-deps.patch index d4b7959b8..c9ba38352 100644 --- a/src/zbus/debian/patches/relax-deps.patch +++ b/src/zbus/debian/patches/relax-deps.patch @@ -1,11 +1,11 @@ --- a/Cargo.toml +++ b/Cargo.toml -@@ -47,7 +47,7 @@ version = "0.3.8" - version = "1.0.2" +@@ -39,7 +39,7 @@ features = ["serde"] + version = "1.2.4" [dependencies.nix] --version = "0.20.2" -+version = ">= 0.20.2" +-version = "^0.17" ++version = ">= 0.17" - [dependencies.once_cell] - version = "1.4.0" + [dependencies.scoped-tls] + version = "1.0.0" diff --git a/src/zbus/debian/patches/relax-nix.patch b/src/zbus/debian/patches/relax-nix.patch index 92a9352b3..c5f225763 100644 --- a/src/zbus/debian/patches/relax-nix.patch +++ b/src/zbus/debian/patches/relax-nix.patch @@ -1,51 +1,27 @@ -Author: Zeeshan Ali -Origin: f9959f03c8241ea1ede5eb4079bec364301aad8d -Description: zb: Upgrade nix requirement to latest release ---- -This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ ---- a/src/error.rs -+++ b/src/error.rs -@@ -106,9 +106,7 @@ impl From for Error { - - impl From for Error { - fn from(val: nix::Error) -> Self { -- val.as_errno() -- .map(|errno| io::Error::from_raw_os_error(errno as i32).into()) -- .unwrap_or_else(|| io::Error::new(io::ErrorKind::Other, val).into()) -+ io::Error::from_raw_os_error(val as i32).into() - } - } - ---- a/src/raw/socket.rs -+++ b/src/raw/socket.rs -@@ -85,8 +85,7 @@ impl Socket for UnixStream { - } - Ok((msg.bytes, fds)) +This patch is inspired by upstream commit f9959f03c8241ea1ede5eb4079bec364301aad8d +re-written by Peter Michael Green to apply to zbus 1.0.0 + +--- a/src/utils.rs 2020-07-16 14:53:32.000000000 +0000 ++++ b/src/utils.rs 2021-12-18 21:33:36.446975934 +0000 +@@ -39,8 +39,8 @@ + buf = &buf[n..]; + cmsg = vec![]; } -- Err(nix::Error::Sys(e)) => Err(e.into()), -- _ => Err(io::Error::new(io::ErrorKind::Other, "unhandled nix error")), -+ Err(e) => Err(e.into()), +- Err(nix::Error::Sys(Errno::EINPROGRESS)) => {} +- Err(nix::Error::Sys(e)) => return Err(e.into()), ++ Err(Errno::EINPROGRESS) => {} ++ Err(e) => return Err(e.into()), + _ => return Err(Error::new(ErrorKind::Other, "unhandled nix error")), } } - -@@ -104,8 +103,7 @@ impl Socket for UnixStream { - "failed to write to buffer", - )), - Ok(n) => Ok(n), -- Err(nix::Error::Sys(e)) => Err(e.into()), -- _ => Err(io::Error::new(io::ErrorKind::Other, "unhandled nix error")), -+ Err(e) => Err(e.into()), +@@ -79,8 +79,8 @@ + let tmp = buf; + buf = &mut tmp[msg.bytes..]; + } +- Err(nix::Error::Sys(Errno::EINPROGRESS)) => {} +- Err(nix::Error::Sys(e)) => return Err(e.into()), ++ Err(Errno::EINPROGRESS) => {} ++ Err(e) => return Err(e.into()), + _ => return Err(Error::new(ErrorKind::Other, "unhandled nix error")), } } - ---- a/src/utils.rs -+++ b/src/utils.rs -@@ -21,7 +21,7 @@ pub(crate) fn wait_on(fd: RawFd, flags: - loop { - match poll(&mut [pollfd], -1) { - Ok(_) => break, -- Err(nix::Error::Sys(e)) => { -+ Err(e) => { - if e == Errno::EAGAIN || e == Errno::EINTR { - // we got interupted, try polling again - continue; diff --git a/src/zbus/debian/patches/relax-ntest.patch b/src/zbus/debian/patches/relax-ntest.patch deleted file mode 100644 index 316068cfd..000000000 --- a/src/zbus/debian/patches/relax-ntest.patch +++ /dev/null @@ -1,44 +0,0 @@ ---- a/src/lib.rs -+++ b/src/lib.rs -@@ -206,7 +206,6 @@ mod tests { - }; - - use enumflags2::BitFlags; -- use ntest::timeout; - use serde_repr::{Deserialize_repr, Serialize_repr}; - - use zvariant::{derive::Type, Fd, OwnedValue, Type}; -@@ -546,7 +545,6 @@ mod tests { - } - - #[test] -- #[timeout(1000)] - fn issue_68() { - // Tests the fix for https://gitlab.freedesktop.org/dbus/zbus/-/issues/68 - // -@@ -580,7 +578,6 @@ mod tests { - } - - #[test] -- #[timeout(1000)] - fn issue104() { - // Tests the fix for https://gitlab.freedesktop.org/dbus/zbus/-/issues/104 - // ---- a/src/object_server.rs -+++ b/src/object_server.rs -@@ -635,7 +635,6 @@ impl<'a> ObjectServer<'a> { - mod tests { - use std::{cell::Cell, collections::HashMap, convert::TryInto, error::Error, rc::Rc, thread}; - -- use ntest::timeout; - use serde::{Deserialize, Serialize}; - use zvariant::derive::Type; - -@@ -801,7 +800,6 @@ mod tests { - } - - #[test] -- #[timeout(2000)] - fn basic_iface() { - let conn = Connection::new_session().unwrap(); - let mut object_server = ObjectServer::new(&conn); diff --git a/src/zbus/debian/patches/series b/src/zbus/debian/patches/series index 473cbc8bd..b5237d967 100644 --- a/src/zbus/debian/patches/series +++ b/src/zbus/debian/patches/series @@ -1,3 +1,2 @@ relax-nix.patch -relax-ntest.patch relax-deps.patch diff --git a/src/zbus/debian/rules b/src/zbus/debian/rules new file mode 100755 index 000000000..6edc168fd --- /dev/null +++ b/src/zbus/debian/rules @@ -0,0 +1,6 @@ +#!/usr/bin/make -f +%: + dh $@ --buildsystem cargo + +override_dh_auto_test: + echo not running build-time tests due to bug 1000942 diff --git a/src/zbus/debian/rules.debcargo.hint b/src/zbus/debian/rules.debcargo.hint new file mode 100755 index 000000000..044c1c21b --- /dev/null +++ b/src/zbus/debian/rules.debcargo.hint @@ -0,0 +1,3 @@ +#!/usr/bin/make -f +%: + dh $@ --buildsystem cargo -- 2.39.5