Skip to content

grep: make the literal-only matcher a cargo feature instead of a WASI gate - #99

Closed
sylvestre wants to merge 1 commit into
mainfrom
wasi-feature
Closed

grep: make the literal-only matcher a cargo feature instead of a WASI gate#99
sylvestre wants to merge 1 commit into
mainfrom
wasi-feature

Conversation

@sylvestre

Copy link
Copy Markdown
Contributor

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.

… gate

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.
@codspeed-hq

codspeed-hq Bot commented Aug 8, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 10 untouched benchmarks
⏩ 17 skipped benchmarks1


Comparing wasi-feature (106c7e7) with main (dc3cddf)

Open in CodSpeed

Footnotes

  1. 17 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@sylvestre

Copy link
Copy Markdown
Contributor Author

i dont like this impl actually

@sylvestre sylvestre closed this Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants