grep: make the literal-only matcher a cargo feature instead of a WASI gate - #99
Closed
sylvestre wants to merge 1 commit into
Closed
grep: make the literal-only matcher a cargo feature instead of a WASI gate#99sylvestre wants to merge 1 commit into
sylvestre wants to merge 1 commit into
Conversation
… 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.
Merging this PR will not alter performance
Comparing Footnotes
|
Contributor
Author
|
i dont like this impl actually |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
onig_sys builds oniguruma from C sources, so
cargo check --target wasm32-wasip1fails unless the caller supplies a C WASI sysroot. Add a default-ononigurumafeature;--no-default-featuresdrops 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.