Bug#1061120: rust-ahash-0.7 autopkgtest failure

2024-01-18 Thread Jonas Smedegaard
Quoting Jonas Smedegaard (2024-01-18 20:50:38)
> Quoting Peter Green (2024-01-18 19:29:59)
> > 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.
> 
> Thanks for the valuable input.
> 
> I am not convinced about the assessment related to and need for
> disabling runtime-rng, however, and it also seems that you applied not
> one but several measures for the atomic-polyfill issue - I will try do a
> more minimal fix for the atomic-polyfill issue to see if that is
> adequate.

Ahh, now I see the runtime-rng failure.  Seems to not be a confusion but
a hidden feature dynamically added to the publicly advertised ones, and
unexpected by the bench resolver to be explicitly declared.

Perhaps that's what you meant as well, or perhaps I am rambling - in any
case, I end at the same solution as you proposed.  Again, thanks a lot!

 - Jonas

-- 
 * Jonas Smedegaard - idealist & Internet-arkitekt
 * Tlf.: +45 40843136  Website: http://dr.jones.dk/
 * Sponsorship: https://ko-fi.com/drjones

 [x] quote me freely  [ ] ask before reusing  [ ] keep private

signature.asc
Description: signature


Bug#1061120: rust-ahash-0.7 autopkgtest failure

2024-01-18 Thread Jonas Smedegaard
Quoting Peter Green (2024-01-18 19:29:59)
> 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.

Thanks for the valuable input.

I am not convinced about the assessment related to and need for
disabling runtime-rng, however, and it also seems that you applied not
one but several measures for the atomic-polyfill issue - I will try do a
more minimal fix for the atomic-polyfill issue to see if that is
adequate.


 - Jonas

-- 
 * Jonas Smedegaard - idealist & Internet-arkitekt
 * Tlf.: +45 40843136  Website: http://dr.jones.dk/
 * Sponsorship: https://ko-fi.com/drjones

 [x] quote me freely  [ ] ask before reusing  [ ] keep private

signature.asc
Description: signature


Bug#1061120: rust-ahash-0.7 autopkgtest failure

2024-01-18 Thread Peter Green

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.0 
+
+++ rust-ahash-0.7-0.7.7/debian/changelog   2024-01-18 17:11:34.0 
+
@@ -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   Thu, 18 Jan 2024 17:11:34 +
+
 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.0 +
+++ rust-ahash-0.7-0.7.7/debian/control 2024-01-18 17:11:27.0 +
@@ -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.0 +
+++ rust-ahash-0.7-0.7.7/debian/patches/1002_atomic_polyfill.patch  
2024-01-18 17:11:34.0 +
@@ -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 
+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.0 
+
+++ rust-ahash-0.7-0.7.7/debian/patches/series  2024-01-18 17:11:34.0