mirror of
https://github.com/uutils/grep.git
synced 2026-10-16 02:48:22 -07:00
onig_sys builds oniguruma from C sources, so `cargo check --target wasm32-wasip1` fails unless the caller supplies a C WASI sysroot. Add a default-on `oniguruma` feature; `--no-default-features` drops the C dependency and falls back to a literal-only matcher that reports an explicit error for patterns needing a regex engine. Gating on the feature rather than on `target_os = "wasi"` keeps the real engine for WASI builds that do have a sysroot: oniguruma compiles and passes the full BRE/ERE/-P suite on wasm32-wasip2 when CC_wasm32_wasip2 and CFLAGS_wasm32_wasip2 point at a wasi-sdk. CI checks wasm32-wasip1 with --no-default-features and builds and tests the fallback natively.