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 divergence-engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ wasm-bindgen = { version = "0.2", optional = true }
js-sys = { version = "0.3", optional = true }
web-sys = { version = "0.3", optional = true, features = ["console"] }
console_error_panic_hook = { version = "0.1", optional = true }
getrandom = { version = "0.2", optional = true }
getrandom = { version = "0.3", optional = true }
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: Upgrading getrandom to 0.3 without updating the wasm feature to use getrandom/wasm_js will cause compilation failures.
Severity: CRITICAL | Confidence: High

🔍 Detailed Analysis

The pull request updates getrandom to version 0.3, which removes the js feature and replaces it with wasm_js. However, the wasm feature in Cargo.toml at line 36 still attempts to enable getrandom/js. This incompatibility will cause a compilation failure when building the divergence-engine with the wasm feature enabled, as Cargo will be unable to resolve the non-existent getrandom/js feature.

💡 Suggested Fix

Update the wasm feature in Cargo.toml to use getrandom/wasm_js instead of getrandom/js. Additionally, configure the backend via .cargo/config.toml with rustflags = ['--cfg', 'getrandom_backend="wasm_js"'] to properly enable the WASM backend.

🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: divergence-engine/Cargo.toml#L36

Potential issue: The pull request updates `getrandom` to version 0.3, which removes the
`js` feature and replaces it with `wasm_js`. However, the `wasm` feature in `Cargo.toml`
at line 36 still attempts to enable `getrandom/js`. This incompatibility will cause a
compilation failure when building the `divergence-engine` with the `wasm` feature
enabled, as Cargo will be unable to resolve the non-existent `getrandom/js` feature.

Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 4439212


# Streaming (optional)
tokio = { version = "1.0", features = ["sync", "rt", "rt-multi-thread", "macros"], optional = true }
Expand Down
Loading