Package: rust-ahash-0.7
Version: 0.7.7-1
Severity: serious

The autopkgtests for rust-ahash-0.7 are failing, this is blocking the
migration of rust-ahash-0.7 to testing which is in turn blocking the
migration of at least one rc bug fix to testing.

There are two issues, the first is that the autopkgtests are trying
to test a "runtime-rng" feature, but no such feature exists. My guess
is that there was some confusion between versions of ahash. I removed
the tests and the corresponding provides.

The second issue is more subtle. The "atomic-polyfill" feature
enables the dependency on the atomic-polyfill crate. However the
dependency on the atomic-polyfill crate is disabled on linux
(among many other targets). Disabling of a dependency on a target
overrides enabling the dependency in a feature. However the code
is not aware of this. The result is that building on Linux with
the atomic-polyfill feature enabled fails.

I see three possible routes for dealing with this.

1. Add target guards to the imports in the code, matching those
   in Cargo.toml
2. Remove the target restrictions from the atomic-polyfill dependency
3. Simply accept that the atomic-polyfill feature is broken on linux
   and stop testing it (this would also mean not having an "all features"
   test.

My patch implements the first option but I don't have a strong
preference for any of them.
diff -Nru rust-ahash-0.7-0.7.7/debian/changelog 
rust-ahash-0.7-0.7.7/debian/changelog
--- rust-ahash-0.7-0.7.7/debian/changelog       2023-12-30 10:22:55.000000000 
+0000
+++ rust-ahash-0.7-0.7.7/debian/changelog       2024-01-18 17:11:34.000000000 
+0000
@@ -1,3 +1,13 @@
+rust-ahash-0.7 (0.7.7-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix autopkgtests
+    + Remove provides and autopkgtests for feature runtime-rng which does not
+      exist.
+    + Only import atomic-polyfill on platforms where the dependency is enabled
+
+ -- Peter Michael Green <plugw...@debian.org>  Thu, 18 Jan 2024 17:11:34 +0000
+
 rust-ahash-0.7 (0.7.7-1) unstable; urgency=medium
 
   [ upstream ]
diff -Nru rust-ahash-0.7-0.7.7/debian/control 
rust-ahash-0.7-0.7.7/debian/control
--- rust-ahash-0.7-0.7.7/debian/control 2023-12-30 10:18:50.000000000 +0000
+++ rust-ahash-0.7-0.7.7/debian/control 2024-01-18 17:11:27.000000000 +0000
@@ -40,7 +40,6 @@
  librust-ahash-0.7+atomic-polyfill-dev (= ${binary:Version}),
  librust-ahash-0.7+compile-time-rng-dev (= ${binary:Version}),
  librust-ahash-0.7+default-dev (= ${binary:Version}),
- librust-ahash-0.7+runtime-rng-dev (= ${binary:Version}),
  librust-ahash-0.7+serde-dev (= ${binary:Version}),
  librust-ahash-0.7+std-dev (= ${binary:Version}),
  librust-ahash-0.7.7-dev (= ${binary:Version}),
diff -Nru rust-ahash-0.7-0.7.7/debian/patches/1002_atomic_polyfill.patch 
rust-ahash-0.7-0.7.7/debian/patches/1002_atomic_polyfill.patch
--- rust-ahash-0.7-0.7.7/debian/patches/1002_atomic_polyfill.patch      
1970-01-01 00:00:00.000000000 +0000
+++ rust-ahash-0.7-0.7.7/debian/patches/1002_atomic_polyfill.patch      
2024-01-18 17:11:34.000000000 +0000
@@ -0,0 +1,23 @@
+Description: limit atomic-polyfill import architectures
+ The atomic-polyfill dependency is target limited, but the import
+ is not. This leads to import errors when building with the
+ atomic-polyfill feature enabled (or building with --all-features).
+
+ This patch makes the imports reflect the dependency
+Author: Peter Michael Green <plugw...@debian.org>
+Last-Update: 2024-01-18
+
+--- rust-ahash-0.7-0.7.7.orig/src/random_state.rs
++++ rust-ahash-0.7-0.7.7/src/random_state.rs
+@@ -29,9 +29,9 @@ extern crate alloc;
+ #[cfg(feature = "std")]
+ extern crate std as alloc;
+ 
+-#[cfg(feature = "atomic-polyfill")]
++#[cfg(all(feature = "atomic-polyfill",not(any(target_os = "linux", target_os 
= "android", target_os = "windows", target_os = "macos", target_os = "ios", 
target_os = "freebsd", target_os = "openbsd", target_os = "netbsd", target_os = 
"dragonfly", target_os = "solaris", target_os = "illumos", target_os = 
"fuchsia", target_os = "redox", target_os = "cloudabi", target_os = "haiku", 
target_os = "vxworks", target_os = "emscripten", target_os = "wasi"))))]
+ use atomic_polyfill as atomic;
+-#[cfg(not(feature = "atomic-polyfill"))]
++#[cfg(not(all(feature = "atomic-polyfill",not(any(target_os = "linux", 
target_os = "android", target_os = "windows", target_os = "macos", target_os = 
"ios", target_os = "freebsd", target_os = "openbsd", target_os = "netbsd", 
target_os = "dragonfly", target_os = "solaris", target_os = "illumos", 
target_os = "fuchsia", target_os = "redox", target_os = "cloudabi", target_os = 
"haiku", target_os = "vxworks", target_os = "emscripten", target_os = 
"wasi")))))]
+ use core::sync::atomic;
+ 
+ use alloc::boxed::Box;
diff -Nru rust-ahash-0.7-0.7.7/debian/patches/series 
rust-ahash-0.7-0.7.7/debian/patches/series
--- rust-ahash-0.7-0.7.7/debian/patches/series  2023-12-30 09:53:32.000000000 
+0000
+++ rust-ahash-0.7-0.7.7/debian/patches/series  2024-01-18 17:11:34.000000000 
+0000
@@ -1,3 +1,4 @@
 020220518~4c340f5.patch
 1001_criterion.patch
 1001_rand.patch
+1002_atomic_polyfill.patch
diff -Nru rust-ahash-0.7-0.7.7/debian/tests/control 
rust-ahash-0.7-0.7.7/debian/tests/control
--- rust-ahash-0.7-0.7.7/debian/tests/control   2023-12-30 10:13:51.000000000 
+0000
+++ rust-ahash-0.7-0.7.7/debian/tests/control   2024-01-18 17:11:00.000000000 
+0000
@@ -80,22 +80,6 @@
 Restrictions: allow-stderr
 
 Test-Command: /usr/share/cargo/bin/cargo-auto-test ahash 0.7.7
- --all-targets --no-default-features --features runtime-rng
-Features: test-name=rust-ahash:runtime-rng
-Depends:
- dh-cargo (>= 18),
- librust-ahash-0.7+runtime-rng-dev,
- librust-criterion-0.5+default-dev,
- librust-fnv-1+default-dev,
- librust-fxhash-0.2+default-dev,
- librust-hex-0.4+default-dev (>= 0.4.2),
- librust-no-panic-0.1+default-dev,
- librust-rand-0.8+default-dev,
- librust-seahash-4+default-dev,
- librust-serde-json-1+default-dev (>= 1.0.59),
-Restrictions: allow-stderr
-
-Test-Command: /usr/share/cargo/bin/cargo-auto-test ahash 0.7.7
  --all-targets --no-default-features --features serde
 Features: test-name=rust-ahash:serde
 Depends:

Reply via email to