Skip to content

assets: Avoid duplicate WASM symbols with Iroh - #3252

Draft
domenkozar wants to merge 1 commit into
longbridge:mainfrom
domenkozar:fix/wasm-assets-with-iroh
Draft

domenkozar wants to merge 1 commit into
longbridge:mainfrom
domenkozar:fix/wasm-assets-with-iroh

Conversation

@domenkozar

Copy link
Copy Markdown

Description

Use standard reqwest 0.13 for WASM icon downloads, with default features disabled. The assets crate currently uses the workspace's gpui-pre-reqwest 0.12 dependency. When an application also uses Iroh 1.2 in its WASM bundle, Iroh brings in reqwest 0.13. Linking the two versions of wasm-streams then fails with duplicate IntoUnderlyingByteSource and related symbols.

This keeps the workspace dependency used by other crates and changes only the assets crate's WASM dependency. Its reqwest::get, response status, and bytes calls remain the same.

AI assistance: Codex helped reproduce the failure, prepare the manifest change, and write this description. Human review is still pending.

Screenshot

Not applicable; this changes a WASM dependency and has no intended visual change.

How to Test

To reproduce against current main, temporarily add this dependency to crates/story-web/Cargo.toml:

iroh = { version = "1.1", default-features = false, features = ["tls-ring"] }

At the start of run in crates/story-web/src/lib.rs, temporarily add:

let _iroh = iroh::Endpoint::builder(iroh::endpoint::presets::Minimal);

Then build the release WASM target:

RUSTC_BOOTSTRAP=1 cargo rustc -p gpui-component-story-web --release --target wasm32-unknown-unknown -- -C link-arg=-zstack-size=8388608

RUSTC_BOOTSTRAP=1 was needed for the local stable toolchain; the repository's nightly toolchain is another option. Before this change, rust-lld reported duplicate symbols from two wasm-streams versions. With this change, the same release build completed. The temporary Iroh edits are not included in this PR.

The committed assets crate also passed cargo check -p gpui-kit-assets --target wasm32-unknown-unknown --lib with the updated lockfile. git diff --check passed.

Checklist

  • I have read the CONTRIBUTING document and followed the guidelines.
  • Reviewed the changes in this PR and confirmed AI generated code (If any) is accurate. Human review pending.
  • Passed cargo run for story tests related to the changes. This is a WASM dependency change; the release web story build passed with the reproduction dependency.
  • Tested macOS, Windows and Linux platforms performance (if the change is platform-specific). This change is WASM-only.

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