Skip to content

make ahash optional - #17

Open
Qix- wants to merge 2 commits into
RegexSolver:mainfrom
Qix-:opt-ahash
Open

make ahash optional#17
Qix- wants to merge 2 commits into
RegexSolver:mainfrom
Qix-:opt-ahash

Conversation

@Qix-

@Qix- Qix- commented Sep 10, 2026

Copy link
Copy Markdown

What this changes

This PR makes the ahash dependency optional.

ahash uses getrandom under the hood, which has a long-standing history of annoyances when building under WASM. If there are multiple crates that use varying versions of getrandom as transitive dependencies, it makes things impossible to build under WASM.

In our case regexsolver doesn't need to be particularly fast or hardened under WASM, so disabling it (and by proxy, getrandom) and using std::collections::HashMap is 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 --check and cargo clippy --all-targets -- -D warnings pass
  • cargo test and cargo test --no-default-features pass
  • New public items are documented (N/A)
  • A test covers the change (N/A)
  • CHANGELOG.md is updated under ## [Unreleased]
  • The change builds on Rust 1.88, or the MSRV bump is intentional and noted

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.

1 participant