-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Add Arbitrary
to Glob
#2720
base: master
Are you sure you want to change the base?
Add Arbitrary
to Glob
#2720
Changes from 5 commits
579ef12
d53aef2
6b782ef
a1fd7c0
5fde1fe
492b05f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -215,3 +215,22 @@ jobs: | |
env: | ||
RUSTDOCFLAGS: -D warnings | ||
run: cargo doc --no-deps --document-private-items --workspace | ||
|
||
fuzz_testing: | ||
name: Run Fuzz Tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install packages (Ubuntu) | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install g++ --yes | ||
- uses: dtolnay/rust-toolchain@nightly | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is nightly needed here? If not, please use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we are not concerned with running the fuzz tests in CI then we don't need the nightly build. I'll change this to match the others. |
||
|
||
- run: cargo fuzz_install | ||
working-directory: fuzz | ||
|
||
- run: ./scripts/run-all.sh | ||
working-directory: fuzz | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For CI, I don't think we need to actually run fuzzing. Let's just make sure all of the fuzz targets build. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds good. I'll update this to simply run a |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ bench = false | |
|
||
[dependencies] | ||
aho-corasick = "1.1.1" | ||
arbitrary = { version = "1.3.2", optional = true, features = ["derive"] } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't like implicitly depending on crate names for features. Could you explicitly add an There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please also add docs for this feature in the crate docs, e.g., https://docs.rs/regex-syntax/latest/regex_syntax/#crate-features There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would you be ok with me adding a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably fine. But it needs to be tested in CI. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks @BurntSushi. I've setup a |
||
bstr = { version = "1.6.2", default-features = false, features = ["std"] } | ||
log = { version = "0.4.20", optional = true } | ||
serde = { version = "1.0.188", optional = true } | ||
|
@@ -41,6 +42,7 @@ serde_json = "1.0.107" | |
|
||
[features] | ||
default = ["log"] | ||
arbitrary = ["dep:arbitrary"] | ||
# DEPRECATED. It is a no-op. SIMD is done automatically through runtime | ||
# dispatch. | ||
simd-accel = [] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[alias] | ||
johnsonw marked this conversation as resolved.
Show resolved
Hide resolved
|
||
fuzz_install = "install cargo-fuzz" | ||
fuzz_list = "fuzz list" | ||
fuzz_run = "fuzz run" | ||
johnsonw marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
target | ||
corpus | ||
artifacts | ||
coverage |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
[package] | ||
name = "fuzz" | ||
version = "0.0.1" | ||
publish = false | ||
edition = "2021" | ||
|
||
[package.metadata] | ||
cargo-fuzz = true | ||
|
||
[dependencies] | ||
libfuzzer-sys = "0.4" | ||
globset = { path = "../crates/globset", features = ["arbitrary"] } | ||
|
||
# Prevent this from interfering with workspaces | ||
[workspace] | ||
members = ["."] | ||
|
||
[profile.release] | ||
debug = 1 | ||
|
||
[[bin]] | ||
name = "fuzz_glob" | ||
path = "fuzz_targets/fuzz_glob.rs" | ||
test = false | ||
doc = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
libFuzzer
requires LLVM sanitizer support and a C++ compiler with C++ 11 support. It is required to install the fuzzer and to compile the targets. Please see https://rust-fuzz.github.io/book/cargo-fuzz/setup.html for more information.