You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datafusion.apache.org by gi...@apache.org on 2026/10/01 18:28:01 UTC
(datafusion-sqlparser-rs) 01/01: Gate fuzz oracle targets behind features (#2585)
This is an automated email from the ASF dual-hosted git repository.
github-merge-queue[bot] pushed a commit to branch gh-readonly-queue/main/pr-2585-811ef298c59088d5933bf7f266d5864013ffa720
in repository https://gitbox.apache.org/repos/asf/datafusion-sqlparser-rs.git
commit d405abeb77d78cb24d4e3bed8c740233926c0362
Author: Luca Cappelletti <ca...@gmail.com>
AuthorDate: Thu Oct 1 18:27:35 2026 +0000
Gate fuzz oracle targets behind features (#2585)
---
.clusterfuzzlite/build.sh | 2 +-
docs/fuzzing.md | 2 ++
fuzz/Cargo.toml | 17 +++++++++++++----
3 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/.clusterfuzzlite/build.sh b/.clusterfuzzlite/build.sh
index e5df5a361..4cb6b62bb 100755
--- a/.clusterfuzzlite/build.sh
+++ b/.clusterfuzzlite/build.sh
@@ -22,7 +22,7 @@ cd "$SRC/datafusion-sqlparser-rs"
# the base image's RUSTUP_TOOLCHAIN (nightly) overrides the rust-toolchain pin, so we name none
# CXXFLAGS in the image carries -stdlib=libc++ while the cc crate defaults to stdc++, so override.
export CXXSTDLIB=c++
-cargo fuzz build -O --fuzz-dir fuzz
+cargo fuzz build -O --all-features --fuzz-dir fuzz
targets=$(cargo fuzz list --fuzz-dir fuzz)
if [ -z "$targets" ]; then
diff --git a/docs/fuzzing.md b/docs/fuzzing.md
index f8f2aa456..8f7ea90bb 100644
--- a/docs/fuzzing.md
+++ b/docs/fuzzing.md
@@ -37,6 +37,8 @@ rendered statement no longer parses.
`fuzz_duckdb_accepts` parses the input with DuckDB's own parser and fails when DuckDB accepts a `SELECT` that `DuckDbDialect` rejects.
+The three oracle targets compile their engine from source, so each builds only with its feature, `sqlite`, `postgres` or `duckdb`, as in `cargo +nightly fuzz run --features sqlite fuzz_sqlite_accepts fuzz_seeds`. `cargo +nightly fuzz build --all-features` builds every target.
+
ClusterFuzzLite runs continuous fuzzing. Every pull request fuzzes for 10 minutes in
`code-change` mode, a daily batch job grows the shared corpus stored on the
`clusterfuzzlite` branch, and a daily prune compacts it.
diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml
index 21e766295..53446b5cd 100644
--- a/fuzz/Cargo.toml
+++ b/fuzz/Cargo.toml
@@ -26,12 +26,18 @@ cargo-fuzz = true
[dependencies]
libfuzzer-sys = "0.4"
-libsqlite3-sys = { version = "0.38", features = ["bundled"] }
-pg_query = "6.2"
-libduckdb-sys = { version = "1.10505.0", features = ["bundled", "json"] }
-serde_json = "1"
+libsqlite3-sys = { version = "0.38", features = ["bundled"], optional = true }
+pg_query = { version = "6.2", optional = true }
+libduckdb-sys = { version = "1.10505.0", features = ["bundled", "json"], optional = true }
+serde_json = { version = "1", optional = true }
sqlparser = { path = ".." }
+# The oracle targets build their engines from source, so each compiles only when its feature is on.
+[features]
+sqlite = ["dep:libsqlite3-sys"]
+postgres = ["dep:pg_query"]
+duckdb = ["dep:libduckdb-sys", "dep:serde_json"]
+
# Prevent this from interfering with workspaces
[workspace]
members = ["."]
@@ -53,6 +59,7 @@ bench = false
[[bin]]
name = "fuzz_sqlite_accepts"
path = "fuzz_targets/fuzz_sqlite_accepts.rs"
+required-features = ["sqlite"]
test = false
doc = false
bench = false
@@ -60,6 +67,7 @@ bench = false
[[bin]]
name = "fuzz_postgres_accepts"
path = "fuzz_targets/fuzz_postgres_accepts.rs"
+required-features = ["postgres"]
test = false
doc = false
bench = false
@@ -67,6 +75,7 @@ bench = false
[[bin]]
name = "fuzz_duckdb_accepts"
path = "fuzz_targets/fuzz_duckdb_accepts.rs"
+required-features = ["duckdb"]
test = false
doc = false
bench = false
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datafusion.apache.org
For additional commands, e-mail: commits-help@datafusion.apache.org