Skip to content

no_std and WASM blocked by rand/regex deps #24

@loadingalias

Description

@loadingalias

Problem

The crate cannot be used in no_std environments or build for WASM targets because rand and regex are listed as runtime dpes, but are only used in benches and tests.

Impact

  • Cannot build for wasm32-unknown-unknown (fails with getrandom error)
  • Cannot build for embedded targets (thumbv6m-none-eabi, etc.)
  • Unnecessary dependencies for library users

Root Cause

From Cargo.toml:

[dependencies]
rand = "0.9"       # Only used in benches/tests
regex = "1.12"     # Only used in tests

Actual usage:

  • rand: Only in benches/benchmark.rs and test code in src/lib.rs
  • regex: Only in test test_ffi_header() in src/lib.rs

Suggested Fix

Move to dev-dependencies:

[dev-dependencies]
criterion = "0.7"
cbindgen = "0.29"
rand = "0.9"
regex = "1.12"

This immediately enables:

  • WASM & no_std/embedded builds
  • Cleaner dependency tree for users

NOTES:
There are no actual code changes needed here. I think it's just moving the rand and regex to [dev-dependencies]! Please, and thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions