Conversation
|
Hello, Thank you very much for your contribution and your kind words! I hadn't checked WASM compilation for RegexSolver before, so I am very grateful you identified this gap. I will take some time to add a new GitHub Action to test this going forward. Regarding the implementation, putting Since I'll be implementing this alternative approach directly alongside the CI changes, I am going to close this PR. Thank you again for pointing me in the right direction and helping improve the project! Just out of curiosity, which specific WASM target are you trying to build for? |
|
Hi there, whatever works is alright - just as long as it doesn't require The target is typically |
|
v1.0.2 has just been released on crates.io. Thanks again for your contribution. Do not hesitate in the future if you have any feedback or any improvement idea. |
What this changes
This PR makes the
ahashdependency optional.ahashusesgetrandomunder the hood, which has a long-standing history of annoyances when building under WASM. If there are multiple crates that use varying versions ofgetrandomas transitive dependencies, it makes things impossible to build under WASM.In our case
regexsolverdoesn't need to be particularly fast or hardened under WASM, so disabling it (and by proxy,getrandom) and usingstd::collections::HashMapis the solution here.Totally understandable if you don't want to accept these changes; I figured it'd probably be helpful to someone else out there, and I was hoping not to have to maintain a fork of
regexsolver.Thank you for the amazing crate by the way.
Checklist
cargo fmt --all --checkandcargo clippy --all-targets -- -D warningspasscargo testandcargo test --no-default-featurespassCHANGELOG.mdis updated under## [Unreleased]