Skip to content

pin wasm-bindgen-cli to 0.2.100#101

Merged
findolor merged 1 commit intomainfrom
2025-01-22-pin-wasm-bindgen-0.2.100
Feb 5, 2026
Merged

pin wasm-bindgen-cli to 0.2.100#101
findolor merged 1 commit intomainfrom
2025-01-22-pin-wasm-bindgen-0.2.100

Conversation

@findolor
Copy link
Contributor

@findolor findolor commented Jan 22, 2026

Motivation

The recent nix flake update in rain.orderbook brought in nixpkgs with wasm-bindgen-cli 0.2.108, which is incompatible with the rain.wasm dependency that uses wasm-bindgen 0.2.100. The TryFromJsValue trait API changed between these versions, breaking wasm tests.

Solution

Pin wasm-bindgen-cli to version 0.2.100 using the versioned package pkgs.wasm-bindgen-cli_0_2_100 that already exists in nixpkgs.

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
    • Added a system overlay to pin the wasm-bindgen build tool to a specific version for more consistent builds.
    • Updated the build dependency mapping to the newer wasm-bindgen release for improved compatibility and stability.

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

@coderabbitai
Copy link

coderabbitai bot commented Jan 22, 2026

Walkthrough

Adds a new wasm-bindgen overlay in flake.nix and extends the system overlays to include it; the overlay maps wasm-bindgen-cli to wasm-bindgen-cli_0_2_100, changing the package used during nixpkgs derivation without altering other control flow.

Changes

Cohort / File(s) Summary
Flake overlay and overlay composition
flake.nix
Added a wasm-bindgen overlay and appended it to system.overlays; the overlay remaps pkgs.wasm-bindgen-cli to pkgs.wasm-bindgen-cli_0_2_100, pinning the wasm-bindgen-cli package used during derivation.

Sequence Diagram(s)

(omitted — change is configuration-only and does not introduce multi-component control flow)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'pin wasm-bindgen-cli to 0.2.100' accurately and concisely summarizes the main change in the changeset—pinning wasm-bindgen-cli to a specific version to resolve compatibility issues.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Use an overlay to make pkgs.wasm-bindgen-cli point to
pkgs.wasm-bindgen-cli_0_2_100. This ensures all consumers
of rainix.pkgs get the pinned version.

The latest nixpkgs has wasm-bindgen-cli 0.2.108 which is incompatible
with the rain.wasm dependency that requires 0.2.100.
@findolor findolor force-pushed the 2025-01-22-pin-wasm-bindgen-0.2.100 branch from 188c660 to b31ea48 Compare January 22, 2026 13:32
Copy link

@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

🤖 Fix all issues with AI agents
In `@flake.nix`:
- Around line 17-20: Add an explicit guard around the use of
wasm-bindgen-cli_0_2_100 inside the wasm-bindgen-overlay so nix evaluation fails
with a clear message if that attribute is missing; update the
wasm-bindgen-overlay (referencing the symbol wasm-bindgen-overlay and the
attribute wasm-bindgen-cli_0_2_100) to check for prev.wasm-bindgen-cli_0_2_100
and throw or call builtins.error with a descriptive message if it is
null/undefined, and adjust the overlays list (the overlays binding where
rust-overlay, foundry.overlay, solc.overlay, wasm-bindgen-overlay are combined)
accordingly; also verify the currently pinned nixpkgs revision in flake.lock to
confirm wasm-bindgen-cli_0_2_100 exists for all target systems and document that
check in the commit message.

Comment on lines +17 to +20
wasm-bindgen-overlay = final: prev: {
wasm-bindgen-cli = prev.wasm-bindgen-cli_0_2_100;
};
overlays = [ (import rust-overlay) foundry.overlay solc.overlay wasm-bindgen-overlay ];
Copy link

@coderabbitai coderabbitai bot Jan 22, 2026

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Add an explicit guard if wasm-bindgen-cli_0_2_100 disappears.

Because the nixpkgs input is floating, a future nix flake update could drop or rename the versioned attribute and fail with a confusing evaluation error. Consider a clear guard/throw so failures are explicit.

Please verify in the currently pinned nixpkgs revision (flake.lock) that wasm-bindgen-cli_0_2_100 exists for all target systems.

♻️ Proposed guard for clearer failure
-        wasm-bindgen-overlay = final: prev: {
-          wasm-bindgen-cli = prev.wasm-bindgen-cli_0_2_100;
-        };
+        wasm-bindgen-overlay = final: prev: {
+          wasm-bindgen-cli =
+            if prev ? wasm-bindgen-cli_0_2_100
+            then prev.wasm-bindgen-cli_0_2_100
+            else throw "nixpkgs missing wasm-bindgen-cli_0_2_100; pin nixpkgs or update rain.wasm";
+        };
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
wasm-bindgen-overlay = final: prev: {
wasm-bindgen-cli = prev.wasm-bindgen-cli_0_2_100;
};
overlays = [ (import rust-overlay) foundry.overlay solc.overlay wasm-bindgen-overlay ];
wasm-bindgen-overlay = final: prev: {
wasm-bindgen-cli =
if prev ? wasm-bindgen-cli_0_2_100
then prev.wasm-bindgen-cli_0_2_100
else throw "nixpkgs missing wasm-bindgen-cli_0_2_100; pin nixpkgs or update rain.wasm";
};
overlays = [ (import rust-overlay) foundry.overlay solc.overlay wasm-bindgen-overlay ];
🤖 Prompt for AI Agents
In `@flake.nix` around lines 17 - 20, Add an explicit guard around the use of
wasm-bindgen-cli_0_2_100 inside the wasm-bindgen-overlay so nix evaluation fails
with a clear message if that attribute is missing; update the
wasm-bindgen-overlay (referencing the symbol wasm-bindgen-overlay and the
attribute wasm-bindgen-cli_0_2_100) to check for prev.wasm-bindgen-cli_0_2_100
and throw or call builtins.error with a descriptive message if it is
null/undefined, and adjust the overlays list (the overlays binding where
rust-overlay, foundry.overlay, solc.overlay, wasm-bindgen-overlay are combined)
accordingly; also verify the currently pinned nixpkgs revision in flake.lock to
confirm wasm-bindgen-cli_0_2_100 exists for all target systems and document that
check in the commit message.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

0.2.100 works and we have no need to track latest. If a future nixpkgs removes this attribute, we'll deal with it then

Copy link

Choose a reason for hiding this comment

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

@findolor, understood! I'll note your preference for handling nixpkgs attribute changes reactively. The pinned version meets your current needs, and you're comfortable addressing any future nixpkgs changes if they arise.


✏️ Learnings added
Learnt from: findolor
Repo: rainlanguage/rainix PR: 101
File: flake.nix:17-20
Timestamp: 2026-01-22T13:45:52.516Z
Learning: In the rainix project, the team prefers to handle nixpkgs versioned attribute removals reactively rather than adding defensive guards. They don't need to track latest versions if a pinned version works for their use case.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

@findolor findolor self-assigned this Jan 22, 2026
@findolor findolor requested review from 0xgleb and hardyjosh January 22, 2026 13:43
@findolor findolor merged commit 51c1c74 into main Feb 5, 2026
12 of 13 checks passed
@github-actions
Copy link

github-actions bot commented Feb 5, 2026

@coderabbitai assess this PR size classification for the totality of the PR with the following criterias and report it in your comment:

S/M/L PR Classification Guidelines:

This guide helps classify merged pull requests by effort and complexity rather than just line count. The goal is to assess the difficulty and scope of changes after they have been completed.

Small (S)

Characteristics:

  • Simple bug fixes, typos, or minor refactoring
  • Single-purpose changes affecting 1-2 files
  • Documentation updates
  • Configuration tweaks
  • Changes that require minimal context to review

Review Effort: Would have taken 5-10 minutes

Examples:

  • Fix typo in variable name
  • Update README with new instructions
  • Adjust configuration values
  • Simple one-line bug fixes
  • Import statement cleanup

Medium (M)

Characteristics:

  • Feature additions or enhancements
  • Refactoring that touches multiple files but maintains existing behavior
  • Breaking changes with backward compatibility
  • Changes requiring some domain knowledge to review

Review Effort: Would have taken 15-30 minutes

Examples:

  • Add new feature or component
  • Refactor common utility functions
  • Update dependencies with minor breaking changes
  • Add new component with tests
  • Performance optimizations
  • More complex bug fixes

Large (L)

Characteristics:

  • Major feature implementations
  • Breaking changes or API redesigns
  • Complex refactoring across multiple modules
  • New architectural patterns or significant design changes
  • Changes requiring deep context and multiple review rounds

Review Effort: Would have taken 45+ minutes

Examples:

  • Complete new feature with frontend/backend changes
  • Protocol upgrades or breaking changes
  • Major architectural refactoring
  • Framework or technology upgrades

Additional Factors to Consider

When deciding between sizes, also consider:

  • Test coverage impact: More comprehensive test changes lean toward larger classification
  • Risk level: Changes to critical systems bump up a size category
  • Team familiarity: Novel patterns or technologies increase complexity

Notes:

  • the assessment must be for the totality of the PR, that means comparing the base branch to the last commit of the PR
  • the assessment output must be exactly one of: S, M or L (single-line comment) in format of: SIZE={S/M/L}
  • do not include any additional text, only the size classification
  • your assessment comment must not include tips or additional sections
  • do NOT tag me or anyone else on your comment

@coderabbitai
Copy link

coderabbitai bot commented Feb 5, 2026

Tip

For best results, initiate chat on the files or code changes.

SIZE=S


🧠 Learnings used
Learnt from: findolor
Repo: rainlanguage/rainix PR: 101
File: flake.nix:17-20
Timestamp: 2026-01-22T13:46:05.211Z
Learning: In the rainix project, the team prefers to handle nixpkgs versioned attribute removals reactively rather than adding defensive guards. They don't need to track latest versions if a pinned version works for their use case.

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.

3 participants