Skip to content

fix: move cdylib to separate float-wasm crate#173

Open
JuaniRios wants to merge 1 commit intoaudit/basefrom
fix/remove-cdylib
Open

fix: move cdylib to separate float-wasm crate#173
JuaniRios wants to merge 1 commit intoaudit/basefrom
fix/remove-cdylib

Conversation

@JuaniRios
Copy link

Summary

  • Remove cdylib from crate-type in crates/float/Cargo.toml, keeping only rlib
  • Add a separate float-wasm crate (crates/float-wasm/) as the WASM build target

Based on audited commit fd7640f.

See: rust-lang/cargo#6313

The `cdylib` crate-type on `rain-math-float` causes Cargo to produce
output artifacts with colliding filenames (rlib and cdylib both generate
`librain_math_float.*`). On Linux, this results in `alloy_primitives`
being compiled as two separate crate instances, causing type mismatches
for any downstream crate that imports both `alloy_primitives` and
`rain_math_float`:

    expected `FixedBytes<32>`, found a different `FixedBytes<32>`
    note: two different versions of crate `alloy_primitives` are being used

See: rust-lang/cargo#6313

The fix moves `cdylib` to a dedicated `rain-math-float-wasm` wrapper
crate (`crates/float-wasm`), keeping the core library as `rlib`-only.
WASM consumers should depend on `rain-math-float-wasm` instead. Native
consumers are unaffected.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 17, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 38f47dc5-e31b-49b0-b7ad-fc666a9bbf58

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/remove-cdylib
📝 Coding Plan
  • Generate coding plan for human review comments

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.

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