Package: rust-imap-client
I hope to update rustls-native-certs to version 0.8 soon.
The version of rust-imap-client currently in debian already
uses 0.8 upstream and the patched cargo dependency already
allows both versions, so I initially thought this would
just be a case of updating the debian dependency.
However, upon testing I discovered that code introduced by
2001_tokio-rustls.patch needed adjustment to build
successfully with rustls-native-certs 0.8.
debdiff is attached.
diff -Nru rust-imap-client-0.1.5/debian/changelog
rust-imap-client-0.1.5/debian/changelog
--- rust-imap-client-0.1.5/debian/changelog 2025-02-07 08:06:55.000000000
+0000
+++ rust-imap-client-0.1.5/debian/changelog 2025-02-18 20:26:23.000000000
+0000
@@ -1,3 +1,12 @@
+rust-imap-client (0.1.5-2.1) UNRELEASED; urgency=medium
+
+ * Non-maintainer upload.
+ * Update for rustls-native-certs 0.8
+ + Adjust dependency in Debian packaging.
+ + Drop 2001
+
+ -- Peter Michael Green <plugw...@debian.org> Tue, 18 Feb 2025 20:26:23 +0000
+
rust-imap-client (0.1.5-2) unstable; urgency=medium
* declare rust-related build-dependencies unconditionally,
diff -Nru rust-imap-client-0.1.5/debian/control
rust-imap-client-0.1.5/debian/control
--- rust-imap-client-0.1.5/debian/control 2025-02-07 08:03:48.000000000
+0000
+++ rust-imap-client-0.1.5/debian/control 2025-02-18 20:26:23.000000000
+0000
@@ -15,7 +15,7 @@
librust-imap-next-0.3+ext-id-dev,
librust-imap-next-0.3+ext-metadata-dev,
librust-once-cell-1+default-dev,
- librust-rustls-native-certs-dev (<< 0.8),
+ librust-rustls-native-certs-0.8-dev,
librust-static-assertions-1+default-dev,
librust-thiserror-1+default-dev,
librust-tokio-1+default-dev,
diff -Nru rust-imap-client-0.1.5/debian/patches/2001_rustls-native-certs.patch
rust-imap-client-0.1.5/debian/patches/2001_rustls-native-certs.patch
--- rust-imap-client-0.1.5/debian/patches/2001_rustls-native-certs.patch
2025-02-07 07:58:44.000000000 +0000
+++ rust-imap-client-0.1.5/debian/patches/2001_rustls-native-certs.patch
1970-01-01 00:00:00.000000000 +0000
@@ -1,17 +0,0 @@
-Description: accept older branches of crate rustls-native-certs
-Author: Jonas Smedegaard <d...@jones.dk>
-Forwarded: not-needed
-Last-Update: 2024-11-10
----
-This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
---- a/Cargo.toml
-+++ b/Cargo.toml
-@@ -18,7 +18,7 @@
- [dependencies]
- imap-next = { version = "0.3", features = ["expose_stream", "tag_generator",
"starttls", "ext_id", "ext_metadata"] }
- once_cell = "1"
--rustls-native-certs = "0.8"
-+rustls-native-certs = ">= 0.6.3, <= 0.8"
- thiserror = "1"
- tokio = { version = "1.37", features = ["net", "time"] }
- tokio-rustls = { version = "0.26", default-features = false, features =
["logging", "tls12", "ring"] }
diff -Nru rust-imap-client-0.1.5/debian/patches/2001_tokio-rustls.patch
rust-imap-client-0.1.5/debian/patches/2001_tokio-rustls.patch
--- rust-imap-client-0.1.5/debian/patches/2001_tokio-rustls.patch
2025-02-07 08:01:56.000000000 +0000
+++ rust-imap-client-0.1.5/debian/patches/2001_tokio-rustls.patch
2025-02-18 20:26:23.000000000 +0000
@@ -1,21 +1,21 @@
Description: use older branch of crate tokio-rustls
Author: Jonas Smedegaard <d...@jones.dk>
Forwarded: not-needed
-Last-Update: 2024-11-10
+Last-Update: 2025-02-18 by Peter Michael Green.
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
---- a/Cargo.toml
-+++ b/Cargo.toml
-@@ -21,5 +21,5 @@
- rustls-native-certs = ">= 0.6.3, <= 0.8"
- thiserror = "1"
- tokio = { version = "1.37", features = ["net", "time"] }
+Index: rust-imap-client-0.1.5/Cargo.toml
+===================================================================
+--- rust-imap-client-0.1.5.orig/Cargo.toml
++++ rust-imap-client-0.1.5/Cargo.toml
+@@ -24,1 +24,1 @@
-tokio-rustls = { version = "0.26", default-features = false, features =
["logging", "tls12", "ring"] }
+tokio-rustls = "0.24"
- tracing = "0.1"
---- a/src/lib.rs
-+++ b/src/lib.rs
-@@ -60,7 +60,7 @@
+Index: rust-imap-client-0.1.5/src/lib.rs
+===================================================================
+--- rust-imap-client-0.1.5.orig/src/lib.rs
++++ rust-imap-client-0.1.5/src/lib.rs
+@@ -60,7 +60,7 @@ use tasks::{
use thiserror::Error;
use tokio::net::TcpStream;
use tokio_rustls::{
@@ -24,16 +24,16 @@
TlsConnector, TlsStream,
};
use tracing::{debug, trace, warn};
-@@ -69,7 +69,7 @@
+@@ -69,7 +69,7 @@ static ROOT_CERT_STORE: Lazy<RootCertSto
let mut root_store = RootCertStore::empty();
for cert in rustls_native_certs::load_native_certs().unwrap() {
- root_store.add(cert).unwrap();
-+ root_store.add(&Certificate(cert.0)).unwrap();
++ root_store.add(&Certificate(cert.to_vec())).unwrap();
}
root_store
-@@ -191,6 +191,7 @@
+@@ -191,6 +191,7 @@ impl Client {
}
let mut config = ClientConfig::builder()
@@ -41,7 +41,7 @@
.with_root_certificates(ROOT_CERT_STORE.clone())
.with_no_client_auth();
-@@ -198,7 +199,7 @@
+@@ -198,7 +199,7 @@ impl Client {
config.alpn_protocols = vec![b"imap".to_vec()];
let connector = TlsConnector::from(Arc::new(config));
diff -Nru rust-imap-client-0.1.5/debian/patches/series
rust-imap-client-0.1.5/debian/patches/series
--- rust-imap-client-0.1.5/debian/patches/series 2025-02-07
07:58:44.000000000 +0000
+++ rust-imap-client-0.1.5/debian/patches/series 2025-02-18
20:26:23.000000000 +0000
@@ -1,2 +1 @@
-2001_rustls-native-certs.patch
2001_tokio-rustls.patch