diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d42f1c4ec..9d8f7e4aa 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -248,6 +248,8 @@ Note that exploration uses the `chaos` mode so if you need to reproduce a run, u SEED=1234 ./whopper/bin/run --mode chaos ``` +Both `explore` and `run` accept `--enable-checksums` flag to enable per page checksums. + ## Python Bindings Turso provides Python bindings built on top of the [PyO3](https://pyo3.rs) project. diff --git a/whopper/Cargo.toml b/whopper/Cargo.toml index 0cd4abcd7..7ca99652d 100644 --- a/whopper/Cargo.toml +++ b/whopper/Cargo.toml @@ -25,3 +25,6 @@ tracing = { workspace = true } tracing-subscriber = { version = "0.3.19", features = ["env-filter"] } turso_core = { path = "../core", features = ["simulator"]} turso_parser = { workspace = true } + +[features] +checksum = ["turso_core/checksum"] \ No newline at end of file diff --git a/whopper/bin/explore b/whopper/bin/explore index 72d3b66de..c5480a3a7 100755 --- a/whopper/bin/explore +++ b/whopper/bin/explore @@ -2,9 +2,20 @@ set -e -cargo build -p turso_whopper +# Check for special build time flags (e.g. `--enable-checksums`) +FEATURES="" +ARGS=() +for arg in "$@"; do + if [[ "$arg" == "--enable-checksums" ]]; then + FEATURES="--features checksum" + else + ARGS+=("$arg") + fi +done + +cargo build $FEATURES -p turso_whopper echo "Running Whopper in an infinite loop in 'chaos' mode..." while true; do - time RUST_BACKTRACE=full ./target/debug/turso_whopper --mode chaos -done + time RUST_BACKTRACE=full ./target/debug/turso_whopper --mode chaos "${ARGS[@]}" +done \ No newline at end of file diff --git a/whopper/bin/run b/whopper/bin/run index 152ad7e36..8d6fc4b4e 100755 --- a/whopper/bin/run +++ b/whopper/bin/run @@ -2,6 +2,17 @@ set -e -cargo build -p turso_whopper +# Check for special build time flags (e.g. `--enable-checksums`) +FEATURES="" +ARGS=() +for arg in "$@"; do + if [[ "$arg" == "--enable-checksums" ]]; then + FEATURES="--features checksum" + else + ARGS+=("$arg") + fi +done -time RUST_BACKTRACE=full ./target/debug/turso_whopper $* +cargo build $FEATURES -p turso_whopper + +time RUST_BACKTRACE=full ./target/debug/turso_whopper "${ARGS[@]}" \ No newline at end of file