Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/test_fixtures/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ serde_json = { workspace = true }
alloy = { workspace = true, features = ["node-bindings", "sol-types", "rpc-types", "provider-http", "network", "contract", "signer-local"] }

[target.'cfg(target_family = "wasm")'.dependencies]
getrandom = { version = "0", features = ["js", "js-sys"] }
getrandom = { version = "0.2", features = ["js", "js-sys"] }
Comment on lines 14 to +15
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

getrandom 0.2 breaking changes vs 0.1

💡 Result:

Summary of breaking changes when moving getrandom 0.1 → 0.2

  • New optional Cargo features added: "rdrand", "js" (replaces stdweb/wasm-bindgen), and "custom". [1]
  • Unsupported targets now fail to compile (previously panicked at runtime); you must opt into a fallback via the "custom" feature if needed. [1]
  • Error API changes: some Error constants changed. [1]
  • std trait impls are now conditional: impls for std-only traits are provided only when the "std" feature is enabled. [1]
  • Several platform supports removed/changed: Hermit, L4Re and UEFI are no longer officially supported; Windows XP and stdweb support dropped in later 0.2.x; minimum Linux kernel bumped to 2.6.32. [1][2]
  • MSRV (minimum supported Rust version) bumped (0.2.0 → Rust 1.34; later 0.2.x bumped further in subsequent 0.2 releases). [1][2]

Sources:
[1] getrandom CHANGELOG (0.2.0). [2] Rust rand book notes on updating to getrandom 0.2 / related 0.2.x remarks.


🏁 Script executed:

# Check if tests exist for test_fixtures crate
fd -t f "\.rs$" crates/test_fixtures --exec grep -l "getrandom\|wasm" {} \;

Repository: rainlanguage/rain.interpreter

Length of output: 55


🏁 Script executed:

# Verify Rust version constraint semantics
# According to Cargo semver, "0.2" should match >=0.2.0, <0.3.0
# Let's check if there's a Cargo.lock or documentation about the resolved version
cd crates/test_fixtures && find . -name "Cargo.lock" -o -name "*.md" | head -20

Repository: rainlanguage/rain.interpreter

Length of output: 55


Confirm getrandom 0.2 migration and version strategy for WASM target.

The version constraint change from "0" to "0.2" represents a significant migration: the "js" feature used by this crate is new in getrandom 0.2 and replaces the older stdweb/wasm-bindgen approach. Getrandom 0.1 to 0.2 includes breaking changes (new feature structure, compile-time vs runtime error handling, std trait conditionals, platform support changes, and MSRV bumps).

For clarity and maintainability:

  • Consider specifying the minimum required version more explicitly. If 0.2.0 is the oldest compatible 0.2.x release, document this rationale. If a specific 0.2.z patch is required, consider pinning to that version.
  • Confirm this change has been tested to ensure compatibility with the new "js" and "js-sys" features in getrandom 0.2.
  • Add a brief comment in Cargo.toml explaining why 0.2 is required (e.g., "0.2 required for new 'js' feature for WASM support").

Loading