Skip to content

Commit

Permalink
put fuzz in same workspace!
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmicexplorer committed Aug 13, 2024
1 parent 2c32f8a commit d73117c
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 16 deletions.
15 changes: 12 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,17 @@ rustdoc-args = ["--cfg", "docsrs"]
members = [
".",
"cli",
"fuzz",
]
default-members = [
".",
]
resolver = "2"

[workspace.dependencies]
arbitrary = { version = "1.3.2", features = ["derive"] }
time = { version = "0.3.36", default-features = false }
zip = { path = "." }
zip = { path = ".", default-features = false }

[dependencies]
aes = { version = "0.8.4", optional = true }
Expand Down Expand Up @@ -65,7 +67,7 @@ lzma-rs = { version = "0.3.0", default-features = false, optional = true }
crossbeam-utils = "0.8.20"

[target.'cfg(fuzzing)'.dependencies]
arbitrary = { version = "1.3.2", features = ["derive"] }
arbitrary.workspace = true

[dev-dependencies]
bencher = "0.1.5"
Expand Down Expand Up @@ -117,5 +119,12 @@ harness = false
# Reduce the size of the zip-cli binary.
[profile.release]
strip = true
lto = true
# This is necessary for fuzzing, which can only use dev or release profiles, and breaks if LTO
# is specified.
lto = false
opt-level = "z"

[profile.release-lto]
inherits = "release"
# This slightly reduces the size of the output binary.
lto = true
18 changes: 14 additions & 4 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
[package]
name = "zip-cli"
version = "0.0.0"
version = "0.0.1"
authors = [
"Danny McClanahan <dmcC2@hypnicjerk.ai>",
]
license = "MIT"
repository = "https://github.com/zip-rs/zip2.git"
keywords = ["zip", "archive", "compression", "cli"]
categories = ["command-line-utilities", "compression", "filesystem", "development-tools::build-utils"]
rust-version = "1.73.0"
# Keep this up to date with clap!
rust-version = "1.74.0"
description = """
Binary for creation and manipulation of zip files.
"""
Expand All @@ -18,7 +19,16 @@ edition = "2021"
name = "zip-cli"

[dependencies]
zip.workspace = true

clap = { version = "4.5.15", features = ["derive"] }
eyre = "0.6"

[dependencies.zip]
workspace = true
features = [
"bzip2",
"deflate64",
"deflate",
"lzma",
"zstd",
"xz",
]
12 changes: 3 additions & 9 deletions fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,17 @@ edition = "2018"
cargo-fuzz = true

[dependencies]
zip.workspace = true

libfuzzer-sys = "0.4"
arbitrary = { version = "1.3.2", features = ["derive"] }
arbitrary.workspace = true
replace_with = "0.1.7"
tikv-jemallocator = "0.6.0"

[dependencies.zip]
path = ".."
default-features = false

[features]
zip_defaults = ["zip/default"]
default = ["zip_defaults"]

# Prevent this from interfering with workspaces
[workspace]
members = ["."]

[[bin]]
name = "fuzz_read"
path = "fuzz_targets/fuzz_read.rs"
Expand Down

0 comments on commit d73117c

Please sign in to comment.