Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to redo workspace deps #2672

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,43 @@ exclude = [
[workspace.package]
version = "0.13.2"

[workspace.dependencies]
backtrace = { version = "0.3.74", default-features = false } # Used to get the stacktrace in StacktraceObserver
bindgen = "0.70.1"
clap = "4.5.18"
cc = "1.1.21"
cmake = "0.1.51"
document-features = "0.2.10"
foldhash = { version = "0.1.2", default-features = false } # The hash function already used in hashbrown
hashbrown = { version = "0.15.1", default-features = false } # A faster hashmap, nostd compatible
libc = "0.2.159" # For (*nix) libc
log = "0.4.22"
meminterval = "0.4.1"
mimalloc = { version = "0.1.43", default-features = false }
nix = { version = "0.29.0", default-features = false }
num_enum = { version = "0.7.3", default-features = false }
num-traits = { version = "0.2.19", default-features = false }
paste = "1.0.15"
postcard = { version = "1.0.10", features = [
"alloc",
], default-features = false } # no_std compatible serde serialization format
rangemap = "1.5.1"
regex = "1.10.6"
rustversion = "1.0.17"
serde = { version = "1.0.210", default-features = false } # serialization lib
serial_test = { version = "3.1.1", default-features = false }
serde_json = { version = "1.0.128", default-features = false }
serde_yaml = { version = "0.9.34" } # For parsing the injections yaml file
strum = "0.26.3"
strum_macros = "0.26.4"
toml = "0.8.19" # For parsing the injections toml file
typed-builder = "0.20.0" # Implement the builder pattern at compiletime
uuid = { version = "1.10.0", features = ["serde", "v4"] }
which = { version = "7.0.0" }
windows = "0.58.0"
z3 = "0.12.1"


[workspace.lints.rust]
# Forbid
unexpected_cfgs = "forbid"
Expand Down
53 changes: 24 additions & 29 deletions libafl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ tcp_manager = ["tokio", "std"]
tcp_compression = ["tcp_manager", "libafl_bolts/gzip"]

## Enable multi-machine support
multi_machine = ["tokio", "std", "enumflags2", "ahash/std"]
multi_machine = ["tokio", "std", "enumflags2", "foldhash/std"]

## Enables the `NaiveTokenizer` and `StacktraceObserver`
regex = ["std", "dep:regex"]
Expand All @@ -126,7 +126,7 @@ concolic_mutation = ["z3"]
tui_monitor = ["ratatui", "crossterm"]

## Enables `UnicodeClassificationStage` and associated mutators, which allow for mutations which preserve the Unicode property data
unicode = ["libafl_bolts/alloc", "ahash/std", "serde/rc", "bitvec"]
unicode = ["libafl_bolts/alloc", "foldhash/std", "serde/rc", "bitvec"]

## Enable multi-part input formats and mutators
multipart_inputs = ["arrayvec", "rand_trait"]
Expand Down Expand Up @@ -189,7 +189,7 @@ nautilus = [
rustversion = "1.0.17"

[dev-dependencies]
serde_json = { version = "1.0.128", default-features = false, features = [
serde_json = { workspace = true, default-features = false, features = [
"alloc",
] }
# clippy-suggested optimised byte counter
Expand All @@ -201,32 +201,27 @@ libafl_bolts = { version = "0.13.2", path = "../libafl_bolts", default-features
] }
libafl_derive = { version = "0.13.2", path = "../libafl_derive", optional = true }

rustversion = { version = "1.0.17" }
rustversion = { workspace = true }
tuple_list = { version = "0.1.3" }
hashbrown = { version = "0.15.0", features = [
hashbrown = { workspace = true, features = [
"serde",
"default-hasher",
], default-features = false } # A faster hashmap, nostd compatible
num-traits = { version = "0.2.19", default-features = false }
serde = { version = "1.0.210", default-features = false, features = [
"alloc",
] } # serialization lib
postcard = { version = "1.0.10", features = [
"alloc",
], default-features = false } # no_std compatible serde serialization format
num-traits = { workspace = true, default-features = false }
serde = { workspace = true, features = ["alloc"] } # serialization lib
postcard = { workspace = true } # no_std compatible serde serialization format
bincode = { version = "1.3.3", optional = true }
c2rust-bitfields = { version = "0.19.0", features = ["no_std"] }
ahash = { version = "0.8.11", default-features = false } # The hash function already used in hashbrown
meminterval = { version = "0.4.1", features = ["serde"] }
backtrace = { version = "0.3.74", default-features = false, optional = true } # Used to get the stacktrace in StacktraceObserver
typed-builder = { version = "0.20.0", optional = true } # Implement the builder pattern at compiletime
foldhash = { workspace = true } # The hash function already used in hashbrown
meminterval = { workspace = true, features = ["serde"] }
backtrace = { workspace = true, optional = true } # Used to get the stacktrace in StacktraceObserver
typed-builder = { workspace = true, optional = true } # Implement the builder pattern at compiletime

serde_json = { version = "1.0.128", optional = true, default-features = false, features = [
serde_json = { workspace = true, optional = true, default-features = false, features = [
"alloc",
] }
nix = { version = "0.29.0", default-features = true, optional = true }
regex = { version = "1.10.6", optional = true }
uuid = { version = "1.10.0", optional = true, features = ["serde", "v4"] }
nix = { workspace = true, default-features = true, optional = true }
regex = { workspace = true, optional = true }
uuid = { workspace = true, optional = true, features = ["serde", "v4"] }
libm = "0.2.8"
ratatui = { version = "0.29.0", default-features = false, features = [
'crossterm',
Expand All @@ -237,7 +232,7 @@ prometheus-client = { version = "0.22.3", optional = true } # For the prometheus
tide = { version = "0.16.0", optional = true }
async-std = { version = "1.13.0", features = ["attributes"], optional = true }
futures = { version = "0.3.30", optional = true }
log = { version = "0.4.22" }
log = { workspace = true }
tokio = { version = "1.40.0", optional = true, features = [
"sync",
"net",
Expand Down Expand Up @@ -268,24 +263,24 @@ pyo3 = { version = "0.22.3", features = ["gil-refs"], optional = true }
regex-syntax = { version = "0.8.4", optional = true } # For nautilus

# optional-dev deps (change when target.'cfg(accessible(::std))'.test-dependencies will be stable)
serial_test = { version = "3.1.1", optional = true, default-features = false, features = [
serial_test = { workspace = true, optional = true, default-features = false, features = [
"logging",
] }

# Document all features of this crate (for `cargo doc`)
document-features = { version = "0.2.10", optional = true }
document-features = { workspace = true, optional = true }
# Optional
clap = { version = "4.5.18", optional = true }
clap = { workspace = true, optional = true }

[lints]
workspace = true

[target.'cfg(unix)'.dependencies]
libc = { version = "0.2.59" } # For (*nix) libc
z3 = { version = "0.12.1", optional = true } # for concolic mutation
libc = { workspace = true } # For (*nix) libc
z3 = { workspace = true, optional = true } # for concolic mutation

[target.'cfg(windows)'.dependencies]
windows = { version = "0.58.0", features = [
windows = { workspace = true, features = [
"Win32_Foundation",
"Win32_System_Threading",
"Win32_System_Diagnostics_Debug",
Expand All @@ -296,4 +291,4 @@ windows = { version = "0.58.0", features = [
] }

[target.'cfg(windows)'.build-dependencies]
windows = { version = "0.58.0" }
windows = { workspace = true }
4 changes: 2 additions & 2 deletions libafl/src/events/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ use core::{
time::Duration,
};

use ahash::RandomState;
pub use broker_hooks::*;
use foldhash::fast::FixedState;
#[cfg(feature = "std")]
pub use launcher::*;
#[cfg(all(unix, feature = "std"))]
Expand Down Expand Up @@ -197,7 +197,7 @@ impl EventConfig {
/// Create a new [`EventConfig`] from a name hash
#[must_use]
pub fn from_name(name: &str) -> Self {
let mut hasher = RandomState::with_seeds(0, 0, 0, 0).build_hasher(); //AHasher::new_with_keys(0, 0);
let mut hasher = FixedState::with_seed(1337).build_hasher(); //AHasher::new_with_keys(0, 0);
hasher.write(name.as_bytes());
EventConfig::FromName {
name_hash: hasher.finish(),
Expand Down
4 changes: 2 additions & 2 deletions libafl/src/inputs/bytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use core::{
#[cfg(feature = "std")]
use std::{fs::File, io::Read, path::Path};

use ahash::RandomState;
use foldhash::fast::FixedState;
#[cfg(feature = "std")]
use libafl_bolts::{fs::write_file_atomic, Error};
use libafl_bolts::{ownedref::OwnedSlice, HasLen};
Expand Down Expand Up @@ -51,7 +51,7 @@ impl Input for BytesInput {

/// Generate a name for this input
fn generate_name(&self, _id: Option<CorpusId>) -> String {
let mut hasher = RandomState::with_seeds(0, 0, 0, 0).build_hasher();
let mut hasher = FixedState::with_seed(1337).build_hasher();
hasher.write(self.bytes());
format!("{:016x}", hasher.finish())
}
Expand Down
4 changes: 2 additions & 2 deletions libafl/src/inputs/encoded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use core::{
hash::{BuildHasher, Hasher},
};

use ahash::RandomState;
use foldhash::fast::FixedState;
use hashbrown::HashMap;
use libafl_bolts::{Error, HasLen};
#[cfg(feature = "regex")]
Expand Down Expand Up @@ -204,7 +204,7 @@ impl Input for EncodedInput {
/// Generate a name for this input
#[must_use]
fn generate_name(&self, _id: Option<CorpusId>) -> String {
let mut hasher = RandomState::with_seeds(0, 0, 0, 0).build_hasher();
let mut hasher = FixedState::with_seed(1337).build_hasher();
for code in &self.codes {
hasher.write(&code.to_le_bytes());
}
Expand Down
4 changes: 2 additions & 2 deletions libafl/src/inputs/gramatron.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use core::{
hash::{BuildHasher, Hasher},
};

use ahash::RandomState;
use foldhash::fast::FixedState;
use libafl_bolts::{Error, HasLen};
use serde::{Deserialize, Serialize};

Expand Down Expand Up @@ -45,7 +45,7 @@ impl Input for GramatronInput {
/// Generate a name for this input
#[must_use]
fn generate_name(&self, _id: Option<CorpusId>) -> String {
let mut hasher = RandomState::with_seeds(0, 0, 0, 0).build_hasher();
let mut hasher = FixedState::with_seed(1337).build_hasher();
for term in &self.terms {
hasher.write(term.symbol.as_bytes());
}
Expand Down
6 changes: 3 additions & 3 deletions libafl/src/observers/map/const_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
use alloc::{borrow::Cow, vec::Vec};
use core::{
fmt::Debug,
hash::{Hash, Hasher},
hash::{BuildHasher, Hash, Hasher},
ops::{Deref, DerefMut},
ptr::NonNull,
};

use ahash::RandomState;
use foldhash::fast::FixedState;
use libafl_bolts::{ownedref::OwnedMutSizedSlice, HasLen, Named};
use serde::{de::DeserializeOwned, Deserialize, Serialize};

Expand Down Expand Up @@ -113,7 +113,7 @@ where

#[inline]
fn hash_simple(&self) -> u64 {
RandomState::with_seeds(0, 0, 0, 0).hash_one(self)
FixedState::with_seed(1337).hash_one(self)
}

/// Reset the map
Expand Down
6 changes: 3 additions & 3 deletions libafl/src/observers/map/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
use alloc::{borrow::Cow, vec::Vec};
use core::{
fmt::Debug,
hash::{Hash, Hasher},
hash::{BuildHasher, Hash, Hasher},
ops::{Deref, DerefMut},
};

use ahash::RandomState;
use foldhash::fast::FixedState;
use libafl_bolts::{ownedref::OwnedMutSlice, AsSlice, AsSliceMut, HasLen, Named, Truncate};
use serde::{de::DeserializeOwned, Deserialize, Serialize};

Expand Down Expand Up @@ -528,7 +528,7 @@ where

#[inline]
fn hash_simple(&self) -> u64 {
RandomState::with_seeds(0, 0, 0, 0).hash_one(self)
FixedState::with_seed(1337).hash_one(self)
}

#[inline]
Expand Down
6 changes: 3 additions & 3 deletions libafl/src/observers/map/multi_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
use alloc::{borrow::Cow, vec::Vec};
use core::{
fmt::Debug,
hash::{Hash, Hasher},
hash::{BuildHasher, Hash, Hasher},
iter::Flatten,
slice::{Iter, IterMut},
};

use ahash::RandomState;
use foldhash::fast::FixedState;
use libafl_bolts::{
ownedref::OwnedMutSlice, AsIter, AsIterMut, AsSlice, AsSliceMut, HasLen, Named,
};
Expand Down Expand Up @@ -127,7 +127,7 @@ where

#[inline]
fn hash_simple(&self) -> u64 {
RandomState::with_seeds(0, 0, 0, 0).hash_one(self)
FixedState::with_seed(1337).hash_one(self)
}

fn reset_map(&mut self) -> Result<(), Error> {
Expand Down
6 changes: 3 additions & 3 deletions libafl/src/observers/map/owned_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
use alloc::{borrow::Cow, vec::Vec};
use core::{
fmt::Debug,
hash::{Hash, Hasher},
hash::{BuildHasher, Hash, Hasher},
ops::{Deref, DerefMut},
};

use ahash::RandomState;
use foldhash::fast::FixedState;
use libafl_bolts::{AsSlice, AsSliceMut, HasLen, Named};
use serde::{de::DeserializeOwned, Deserialize, Serialize};

Expand Down Expand Up @@ -108,7 +108,7 @@ where

#[inline]
fn hash_simple(&self) -> u64 {
RandomState::with_seeds(0, 0, 0, 0).hash_one(self)
FixedState::with_seed(1337).hash_one(self)
}

#[inline]
Expand Down
6 changes: 3 additions & 3 deletions libafl/src/observers/map/variable_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
use alloc::{borrow::Cow, vec::Vec};
use core::{
fmt::Debug,
hash::{Hash, Hasher},
hash::{BuildHasher, Hash, Hasher},
ops::{Deref, DerefMut},
};

use ahash::RandomState;
use foldhash::fast::FixedState;
use libafl_bolts::{
ownedref::{OwnedMutPtr, OwnedMutSlice},
AsSlice, AsSliceMut, HasLen, Named,
Expand Down Expand Up @@ -115,7 +115,7 @@ where

#[inline]
fn hash_simple(&self) -> u64 {
RandomState::with_seeds(0, 0, 0, 0).hash_one(self)
FixedState::with_seed(1337).hash_one(self)
}

/// Reset the map
Expand Down
10 changes: 5 additions & 5 deletions libafl/src/observers/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ use alloc::{borrow::Cow, boxed::Box, vec::Vec};
use core::{
cell::{Ref, RefCell, RefMut},
fmt::Debug,
hash::{Hash, Hasher},
hash::{BuildHasher, Hash, Hasher},
ops::{Deref, DerefMut},
};

use ahash::RandomState;
use foldhash::fast::FixedState;
use libafl_bolts::{ownedref::OwnedRef, AsIter, AsIterMut, AsSlice, AsSliceMut, HasLen, Named};
use serde::{de::DeserializeOwned, Deserialize, Serialize};

Expand Down Expand Up @@ -77,7 +77,7 @@ impl<T> Named for ValueObserver<'_, T> {

impl<T: Hash> ObserverWithHashField for ValueObserver<'_, T> {
fn hash(&self) -> Option<u64> {
Some(RandomState::with_seeds(1, 2, 3, 4).hash_one(self.value.as_ref()))
Some(FixedState::with_seed(1337).hash_one(self.value.as_ref()))
}
}

Expand Down Expand Up @@ -156,7 +156,7 @@ where
T: Hash,
{
fn hash(&self) -> Option<u64> {
Some(RandomState::with_seeds(1, 2, 3, 4).hash_one(&*self.value.as_ref().borrow()))
Some(FixedState::with_seed(1337).hash_one(&*self.value.as_ref().borrow()))
}
}

Expand Down Expand Up @@ -311,7 +311,7 @@ where
/// Panics if the contained value is already mutably borrowed (calls
/// [`RefCell::borrow`]).
fn hash_simple(&self) -> u64 {
RandomState::with_seeds(0, 0, 0, 0).hash_one(self)
FixedState::with_seed(1337).hash_one(self)
}

/// Panics if the contained value is already mutably borrowed (calls
Expand Down
Loading
Loading