arbitrary icon indicating copy to clipboard operation
arbitrary copied to clipboard

Add support for `no_std` compilation (updated)

Open pitdicker opened this issue 1 year ago • 5 comments

See discussion in #74.

This is useful to fuzz crates in their no_std configuration, which may utilize different code paths in such a crate.

I started by rebasing #74 but made a number of changes to split it in an std and alloc feature.

Fixes #38.

pitdicker avatar Feb 26 '24 10:02 pitdicker

This was the conclusion of #74: https://github.com/rust-fuzz/arbitrary/pull/74#issuecomment-902114435

fitzgen avatar Feb 26 '24 14:02 fitzgen

What do you think of the use case mentioned above?

This is useful to fuzz crates in their no_std configuration, which may utilize different code paths in such a crate.

pitdicker avatar Feb 26 '24 15:02 pitdicker

I am not sure how to replicate the warnings in the "Run int_in_range fuzz target" CI job. Hopefully this fixes it.

pitdicker avatar Feb 26 '24 18:02 pitdicker

@fitzgen counter question to the implementation constraints concern: is it really as bad as your comment makes it seem to restrict ourselves to libcore in the few circumstances where doing so would be necessary? I'm asking because arbitrary is largely a collection of impl Arbitrary for .... Since most of the implementing types hail from libstd, those will be able to use std in their implementation. Outside of the Arbitrary trait and the few impls for the basic libcore types, everything else (including Unstructured) can be made libstd-only and considered for no_std compatibility on a case-by-case basis. Wouldn't that be good enough?

nagisa avatar Jul 04 '24 08:07 nagisa

Landing this would be highly appreciated.

refcell avatar Sep 04 '24 21:09 refcell