grep: allow wasm32-wasip1 cargo check#53
Open
wondr-wclabs wants to merge 1 commit into
Open
Conversation
Merging this PR will not alter performance
Comparing Footnotes
|
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.
Fixes #20.
onig_sysbuilds bundled C sources, socargo check --target wasm32-wasip1currently fails unless the caller also provides a C WASI sysroot. That makes the Rust target check depend on external C toolchain setup before theuu_grepcrate itself is checked.This PR target-gates the Oniguruma dependencies away from WASI builds and adds a small WASI matcher fallback for ASCII literal patterns. I kept the fallback intentionally narrow: non-WASI builds keep the existing Oniguruma behavior, while WASI builds return an explicit error for regex features that would require Oniguruma. Pulling in a different pure-Rust regex engine for WASI would make the command compile, but it would also create a second regex semantics path for BRE/ERE/PCRE behavior, which seems worse than failing clearly for unsupported cases.
I also added a CI job that runs the issue reproducer command directly:
cargo check --target wasm32-wasip1.Checked locally:
cargo fmt --all -- --check,cargo check,cargo test,cargo clippy --all-targets --workspace -puu_grep -- -D warnings,cargo check --target wasm32-wasip1, andcargo clippy --target wasm32-wasip1 --workspace -puu_grep -- -D warnings. I also triedcargo test --target wasm32-wasip1 --no-run; that currently stops in the dev-dependency stack becausesocket2does not support the target, so I left this PR scoped to the reportedcargo checkfailure.