You should install Typst and Rust for running the build script.
If you want to build the WASM plugin, you should also setup the wasm target by rustup:
rustup target add wasm32-unknown-unknown
For Linux:
git clone https://github.com/mitex-rs/mitex.git
scripts/build.sh
For Windows:
git clone https://github.com/mitex-rs/mitex.git
.\scripts\build.ps1
The afl.rs only supports Linux.
Installing afl.rs on Linux:
cargo install cargo-afl
Building and fuzzing:
cargo afl build --bin fuzz-target-mitex
cargo afl fuzz -i local/seed -o local/fuzz-res ./target/debug/fuzz-target-mitex
To minimize test cases, using afl-tmin
cargo afl tmin -i crash.tex -o minimized.tex ./target/debug/fuzz-target-mitex
TODO.