[Pkg-rust-maintainers] Bug#1099780: rust-if-watch: Unsatisfied build dependecies (rnetlink 0.17, if-addrs 0.10)
Peter Green
plugwash at debian.org
Sat Mar 8 05:01:59 GMT 2025
> I couldn't compile it because it rnetlink deps
> are not satisfied. I tried to prepare an NMU today but the rnetlink
> changes are beyond my rust skills.
For what it's worth, the attatched debdiff will make rust-if-watch
build and pass it's autopkgtests in current sid.
-------------- next part --------------
diff -Nru rust-if-watch-3.2.1/debian/changelog rust-if-watch-3.2.1/debian/changelog
--- rust-if-watch-3.2.1/debian/changelog 2025-02-07 07:36:11.000000000 +0000
+++ rust-if-watch-3.2.1/debian/changelog 2025-03-08 03:59:15.000000000 +0000
@@ -1,3 +1,12 @@
+rust-if-watch (3.2.1-8.1) UNRELEASED; urgency=medium
+
+ * Non-maintainer upload.
+ * Add patches to support new versions of rtnetlink, netlink-packet-route
+ if-addrs crates, update Debian build-dependencies accordingly.
+ (Closes: #1099780)
+
+ -- Peter Michael Green <plugwash at debian.org> Sat, 08 Mar 2025 03:59:15 +0000
+
rust-if-watch (3.2.1-8) unstable; urgency=medium
* add metadata about upstream project
diff -Nru rust-if-watch-3.2.1/debian/control rust-if-watch-3.2.1/debian/control
--- rust-if-watch-3.2.1/debian/control 2025-01-01 13:00:36.000000000 +0000
+++ rust-if-watch-3.2.1/debian/control 2025-03-08 03:59:01.000000000 +0000
@@ -7,19 +7,19 @@
debhelper-compat (= 13),
dh-sequence-rust,
librust-async-io-2+default-dev,
- librust-env-logger-0.11+default-dev,
+ librust-env-logger-0.7+default-dev,
librust-fnv-1+default-dev,
librust-futures-0.3+default-dev,
- librust-if-addrs-0.10+default-dev,
+ librust-if-addrs-0.13+default-dev,
librust-ipnet-2+default-dev,
librust-log-0.4+default-dev,
librust-netlink-sys-0.8-dev,
librust-netlink-packet-core-0.7-dev,
- librust-netlink-packet-route-0.17-dev,
+ librust-netlink-packet-route-0.19-dev,
librust-netlink-proto-0.11-dev,
librust-netlink-sys-0.8-dev,
- librust-rtnetlink-0.13+smol-socket-dev,
- librust-rtnetlink-0.13+tokio-socket-dev,
+ librust-rtnetlink-0.14+smol-socket-dev,
+ librust-rtnetlink-0.14+tokio-socket-dev,
librust-smol-2+default-dev,
librust-tokio-1+default-dev,
librust-tokio-1+macros-dev,
@@ -36,15 +36,15 @@
librust-async-io-2+default-dev,
librust-fnv-1+default-dev,
librust-futures-0.3+default-dev,
- librust-if-addrs-0.10+default-dev,
+ librust-if-addrs-0.13+default-dev,
librust-ipnet-2+default-dev,
librust-log-0.4+default-dev,
librust-netlink-sys-0.8-dev,
librust-netlink-packet-core-0.7-dev,
- librust-netlink-packet-route-0.17-dev,
+ librust-netlink-packet-route-0.19-dev,
librust-netlink-proto-0.11-dev,
- librust-rtnetlink-0.13+smol-socket-dev,
- librust-rtnetlink-0.13+tokio-socket-dev,
+ librust-rtnetlink-0.14+smol-socket-dev,
+ librust-rtnetlink-0.14+tokio-socket-dev,
librust-smol-2+default-dev,
librust-tokio-1+default-dev,
librust-tokio-1+macros-dev,
diff -Nru rust-if-watch-3.2.1/debian/patches/1004_netlink.patch rust-if-watch-3.2.1/debian/patches/1004_netlink.patch
--- rust-if-watch-3.2.1/debian/patches/1004_netlink.patch 1970-01-01 00:00:00.000000000 +0000
+++ rust-if-watch-3.2.1/debian/patches/1004_netlink.patch 2025-03-08 03:55:37.000000000 +0000
@@ -0,0 +1,110 @@
+Description: support newer versions of netlink crates.
+ This patch updates the code to use the latest version of rtnetlink
+ and the corresponding version of netlink-packet-route.
+Author: Peter Michael Green <plugwash at debian.org>
+Forwarded: no
+Last-Update: 2024-03-08
+Index: rust-if-watch-3.2.1/Cargo.toml
+===================================================================
+--- rust-if-watch-3.2.1.orig/Cargo.toml
++++ rust-if-watch-3.2.1/Cargo.toml
+@@ -24,9 +24,9 @@ log = "0.4.14"
+ [target.'cfg(target_os = "linux")'.dependencies]
+ netlink-sys = { version = "0.8.0", default-features = false }
+ netlink-packet-core = { version = "0.7.0", default-features = false }
+-netlink-packet-route = { version = "0.17.0", default-features = false }
++netlink-packet-route = { version = "0.19.0", default-features = false }
+ netlink-proto = { version = "0.11.0", default-features = false }
+-rtnetlink = { version = "0.13.0", default-features = false }
++rtnetlink = { version = "0.14.0", default-features = false }
+
+ [target.'cfg(any(target_os = "macos", target_os = "ios"))'.dependencies]
+ core-foundation = "0.9.2"
+Index: rust-if-watch-3.2.1/src/linux.rs
+===================================================================
+--- rust-if-watch-3.2.1.orig/src/linux.rs
++++ rust-if-watch-3.2.1/src/linux.rs
+@@ -4,15 +4,16 @@ use futures::ready;
+ use futures::stream::{FusedStream, Stream, TryStreamExt};
+ use futures::StreamExt;
+ use netlink_packet_core::NetlinkPayload;
+-use netlink_packet_route::rtnl::address::nlas::Nla;
+-use netlink_packet_route::rtnl::{AddressMessage, RtnlMessage};
++use netlink_packet_route::RouteNetlinkMessage;
++use netlink_packet_route::address::AddressMessage;
++use netlink_packet_route::address::AddressAttribute;
+ use netlink_proto::Connection;
+ use netlink_sys::{AsyncSocket, SocketAddr};
+ use rtnetlink::constants::{RTMGRP_IPV4_IFADDR, RTMGRP_IPV6_IFADDR};
+ use std::collections::VecDeque;
+ use std::future::Future;
+ use std::io::{Error, ErrorKind, Result};
+-use std::net::{Ipv4Addr, Ipv6Addr};
++use std::net::{Ipv4Addr, Ipv6Addr, IpAddr};
+ use std::pin::Pin;
+ use std::task::{Context, Poll};
+
+@@ -35,8 +36,8 @@ pub mod smol {
+ }
+
+ pub struct IfWatcher<T> {
+- conn: Connection<RtnlMessage, T>,
+- messages: Pin<Box<dyn Stream<Item = Result<RtnlMessage>> + Send>>,
++ conn: Connection<RouteNetlinkMessage, T>,
++ messages: Pin<Box<dyn Stream<Item = Result<RouteNetlinkMessage>> + Send>>,
+ addrs: FnvHashSet<IpNet>,
+ queue: VecDeque<IfEvent>,
+ }
+@@ -63,7 +64,7 @@ where
+ .address()
+ .get()
+ .execute()
+- .map_ok(RtnlMessage::NewAddress)
++ .map_ok(RouteNetlinkMessage::NewAddress)
+ .map_err(|err| Error::new(ErrorKind::Other, err));
+ let msg_stream = messages.filter_map(|(msg, _)| async {
+ match msg.payload {
+@@ -129,8 +130,8 @@ where
+ }
+ };
+ match message {
+- RtnlMessage::NewAddress(msg) => self.add_address(msg),
+- RtnlMessage::DelAddress(msg) => self.rem_address(msg),
++ RouteNetlinkMessage::NewAddress(msg) => self.add_address(msg),
++ RouteNetlinkMessage::DelAddress(msg) => self.rem_address(msg),
+ _ => {}
+ }
+ }
+@@ -143,25 +144,19 @@ fn socket_err(error: &str) -> std::io::E
+
+ fn iter_nets(msg: AddressMessage) -> impl Iterator<Item = IpNet> {
+ let prefix = msg.header.prefix_len;
+- let family = msg.header.family;
+- msg.nlas.into_iter().filter_map(move |nla| {
+- if let Nla::Address(octets) = nla {
+- match family {
+- 2 => {
+- let mut addr = [0; 4];
+- addr.copy_from_slice(&octets);
++ msg.attributes.into_iter().filter_map(move |attribute| {
++ if let AddressAttribute::Address(addr) = attribute {
++ match addr {
++ IpAddr::V4(addr) => {
+ Some(IpNet::V4(
+- Ipv4Net::new(Ipv4Addr::from(addr), prefix).unwrap(),
++ Ipv4Net::new(addr, prefix).unwrap(),
+ ))
+ }
+- 10 => {
+- let mut addr = [0; 16];
+- addr.copy_from_slice(&octets);
++ IpAddr::V6(addr) => {
+ Some(IpNet::V6(
+- Ipv6Net::new(Ipv6Addr::from(addr), prefix).unwrap(),
++ Ipv6Net::new(addr, prefix).unwrap(),
+ ))
+ }
+- _ => None,
+ }
+ } else {
+ None
diff -Nru rust-if-watch-3.2.1/debian/patches/1005_if_addrs.patch rust-if-watch-3.2.1/debian/patches/1005_if_addrs.patch
--- rust-if-watch-3.2.1/debian/patches/1005_if_addrs.patch 1970-01-01 00:00:00.000000000 +0000
+++ rust-if-watch-3.2.1/debian/patches/1005_if_addrs.patch 2025-03-08 03:52:07.000000000 +0000
@@ -0,0 +1,19 @@
+Description: support newer versions of netlink crates.
+ This patch updates the code to use the latest version of rtnetlink
+ and the corresponding version of netlink-packet-route.
+Author: Peter Michael Green <plugwash at debian.org>
+Forwarded: no
+Last-Update: 2024-03-08
+Index: rust-if-watch-3.2.1/Cargo.toml
+===================================================================
+--- rust-if-watch-3.2.1.orig/Cargo.toml
++++ rust-if-watch-3.2.1/Cargo.toml
+@@ -33,7 +33,7 @@ smol = { version = "2", optional = true
+
+ [target.'cfg(not(any(target_os = "ios", target_os = "linux", target_os = "macos", target_os = "windows")))'.dependencies]
+ async-io = "2.0.0"
+-if-addrs = "0.10.0"
++if-addrs = "0.13.0"
+
+ [dev-dependencies]
+ env_logger = ">= 0.10.0, <= 0.11"
diff -Nru rust-if-watch-3.2.1/debian/patches/2002_no_mac.patch rust-if-watch-3.2.1/debian/patches/2002_no_mac.patch
--- rust-if-watch-3.2.1/debian/patches/2002_no_mac.patch 2024-11-28 22:48:40.000000000 +0000
+++ rust-if-watch-3.2.1/debian/patches/2002_no_mac.patch 2025-03-08 03:56:34.000000000 +0000
@@ -7,11 +7,13 @@
Last-Update: 2024-01-02
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
---- a/Cargo.toml
-+++ b/Cargo.toml
-@@ -28,10 +28,6 @@
+Index: rust-if-watch-3.2.1/Cargo.toml
+===================================================================
+--- rust-if-watch-3.2.1.orig/Cargo.toml
++++ rust-if-watch-3.2.1/Cargo.toml
+@@ -28,10 +28,6 @@ netlink-packet-route = { version = "0.19
netlink-proto = { version = "0.11.0", default-features = false }
- rtnetlink = { version = "0.13.0", default-features = false }
+ rtnetlink = { version = "0.14.0", default-features = false }
-[target.'cfg(any(target_os = "macos", target_os = "ios"))'.dependencies]
-core-foundation = "0.9.2"
diff -Nru rust-if-watch-3.2.1/debian/patches/2002_no_windows.patch rust-if-watch-3.2.1/debian/patches/2002_no_windows.patch
--- rust-if-watch-3.2.1/debian/patches/2002_no_windows.patch 2024-11-28 22:48:41.000000000 +0000
+++ rust-if-watch-3.2.1/debian/patches/2002_no_windows.patch 2025-03-08 03:56:38.000000000 +0000
@@ -4,9 +4,11 @@
Last-Update: 2024-01-02
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
---- a/Cargo.toml
-+++ b/Cargo.toml
-@@ -31,10 +31,6 @@
+Index: rust-if-watch-3.2.1/Cargo.toml
+===================================================================
+--- rust-if-watch-3.2.1.orig/Cargo.toml
++++ rust-if-watch-3.2.1/Cargo.toml
+@@ -31,10 +31,6 @@ rtnetlink = { version = "0.14.0", defaul
tokio = { version = "1.21.2", features = ["rt"], optional = true }
smol = { version = "2", optional = true }
@@ -16,4 +18,4 @@
-
[target.'cfg(not(any(target_os = "ios", target_os = "linux", target_os = "macos", target_os = "windows")))'.dependencies]
async-io = "2.0.0"
- if-addrs = "0.10.0"
+ if-addrs = "0.13.0"
diff -Nru rust-if-watch-3.2.1/debian/patches/series rust-if-watch-3.2.1/debian/patches/series
--- rust-if-watch-3.2.1/debian/patches/series 2025-01-01 13:01:04.000000000 +0000
+++ rust-if-watch-3.2.1/debian/patches/series 2025-03-08 03:54:12.000000000 +0000
@@ -1,5 +1,7 @@
1001_dead_code.patch
1002_fence_tests.patch
1003_env_logger.patch
+1004_netlink.patch
+1005_if_addrs.patch
2002_no_mac.patch
2002_no_windows.patch
More information about the Pkg-rust-maintainers
mailing list