#1056349 rust-criterion: please enable feature "real_blackbox"

#1056349#5
Date:
2023-11-21 13:32:34 UTC
From:
To:
Dear Maintainer,

I'm currently packaging the "async-oneshot" crate as a dependency for gnome-
podcasts. This crate relies on the "real_blackbox" feature of criterion for its
autopkgtests, so it would be nice to have that feature enabled.

Best regards,
Arnaud

#1056349#10
Date:
2023-11-21 13:58:47 UTC
From:
To:
Hi Arnaud,

Quoting Arnaud Ferraris (2023-11-21 14:32:34)

It is my understanding that the feature "real_blackbox" is only possible
to build with a bleeding-edge "nightly" rustc compiler.  In other words
that feature is inherently unstable.

Debian do not provide a "nightly" rustc compiler, and even if it did
then as I understand it the resulting code would be unsuitable outside
of Debian experimental (or, arguably, Debian unstable).
Therefore I have flagged this request of yours as a "wontfix".

Please note, however, that I might be wrong in my assumptions.  If you
can convince me (e.g. through succesful compilation and testing) that in
fact the "real_blackbox" can be enabled using rustc in Debian, then I am
happy to revisit this issue.

Otherwise the way forward as I see it is to try convince upstream of
async-oneshot and/or gnome-posdcasts to steer clear of such unstable
library features.


Kind regards,

 - Jonas

#1056349#17
Date:
2023-11-21 23:05:54 UTC
From:
To:
Hi Jonas,

Le 21/11/2023 à 14:58, Jonas Smedegaard a écrit :

I sent that bug after checking that `black_box` was now a stable rust
API, but unfortunately, digging out a bit more I realized that's not the
end of the story here:
* black_box is stable (as of 1.66.0) as std::hint::black_box
* criterion relies on test::black_box for its "real_blackbox" feature,
which is still nightly-only

So while in theory it looked good, in practice it is not.

The good news here is that there's a PR upstream[1] for switching to
std::hint::black_box so it will likely all be fixed eventually, even
though there hasn't been much activity lately...

Cheers,
Arnaud

[1] https://github.com/bheisler/criterion.rs/pull/701