Skip to content

Conversation

@findolor
Copy link
Contributor

@findolor findolor commented Dec 9, 2025

Motivation

There was an issue with updating some of the dependencies in orderbook repository that required us to use a different version of get random in this repository. This PR is created to update getrandom dependency.

Solution

Checks

By submitting this for review, I'm confirming I've done the following:

  • made this PR as small as possible
  • unit-tested any new functionality
  • linked any relevant issues or PRs
  • included screenshots (if this involves a front-end change)

Summary by CodeRabbit

  • Chores
    • Updated WebAssembly support dependencies in test fixtures for improved compatibility and stability.

✏️ Tip: You can customize this high-level summary in your review settings.

@findolor findolor requested review from 0xgleb and hardyjosh December 9, 2025 11:32
@findolor findolor self-assigned this Dec 9, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 9, 2025

Walkthrough

Updated the getrandom dependency version from "0" to "0.2" in the WebAssembly target configuration of the test fixtures Cargo manifest, while maintaining the existing JavaScript-related features.

Changes

Cohort / File(s) Change Summary
Dependency version update
crates/test_fixtures/Cargo.toml
Updated getrandom version from "0" to "0.2" in [target.'cfg(target_family = "wasm")'.dependencies]; features ["js", "js-sys"] unchanged

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

  • Single-line version bump in dependency specification
  • No logic, API, or behavioral changes
  • Configuration-only modification in test fixtures

Suggested reviewers

  • hardyjosh
  • 0xgleb

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'Update getrandom version in text_fixtures crate' directly and clearly describes the main change: updating the getrandom dependency version from 0 to 0.2 in the test_fixtures crate.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch update-getrandom

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 018871e and 41ac1b9.

📒 Files selected for processing (1)
  • crates/test_fixtures/Cargo.toml (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-06-09T07:46:10.639Z
Learnt from: 0xgleb
Repo: rainlanguage/rain.interpreter PR: 333
File: Cargo.toml:11-11
Timestamp: 2025-06-09T07:46:10.639Z
Learning: When analyzing dependency upgrades in Rust projects, always search for the specific programming language and context (e.g., "Rust alloy crate" vs "Alloy framework") to avoid confusion between different libraries with the same name. The alloy crate in Rust is for Ethereum development, not mobile app development.

Applied to files:

  • crates/test_fixtures/Cargo.toml
📚 Learning: 2025-06-09T07:46:10.639Z
Learnt from: 0xgleb
Repo: rainlanguage/rain.interpreter PR: 333
File: Cargo.toml:11-11
Timestamp: 2025-06-09T07:46:10.639Z
Learning: When analyzing dependency upgrades, always search for the specific programming language and context (e.g., "Rust alloy crate" vs "Alloy framework") to avoid confusion between different libraries with the same name. The alloy crate in Rust is for Ethereum development, not mobile app development.

Applied to files:

  • crates/test_fixtures/Cargo.toml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
  • GitHub Check: rainix (ubuntu-latest, test-wasm-build)
  • GitHub Check: rainix (ubuntu-latest, rainix-sol-artifacts)
  • GitHub Check: rainix (ubuntu-latest, rainix-rs-static)
  • GitHub Check: rainix (ubuntu-latest, rainix-sol-test)
  • GitHub Check: rainix (macos-latest, rainix-rs-test)
  • GitHub Check: rainix (ubuntu-latest, rainix-rs-test)
  • GitHub Check: rainix (macos-latest, rainix-rs-artifacts)
  • GitHub Check: rainix (ubuntu-latest, rainix-sol-static)
  • GitHub Check: rainix (ubuntu-latest, rainix-rs-artifacts)
  • GitHub Check: git-clean

Comment on lines 14 to +15
[target.'cfg(target_family = "wasm")'.dependencies]
getrandom = { version = "0", features = ["js", "js-sys"] }
getrandom = { version = "0.2", features = ["js", "js-sys"] }
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").

@findolor
Copy link
Contributor Author

findolor commented Dec 9, 2025

Closing this as we have #424

@findolor findolor closed this Dec 9, 2025
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.

2 participants