Skip to content

Fix eldritch-wasm build by supporting fake bindings in eldritch-libchain#2176

Merged
KCarretto merged 3 commits intomainfrom
fix-eldritch-wasm-build-libchain-807419892841067013
Apr 9, 2026
Merged

Fix eldritch-wasm build by supporting fake bindings in eldritch-libchain#2176
KCarretto merged 3 commits intomainfrom
fix-eldritch-wasm-build-libchain-807419892841067013

Conversation

@KCarretto
Copy link
Copy Markdown
Collaborator

Fixes the wasm32-unknown-unknown compilation failure in eldritch-wasm caused by eldritch-libchain pulling in native-only network dependencies (tokio, hyper, tonic).


PR created automatically by Jules for task 807419892841067013 started by @KCarretto

The `eldritch-wasm` build was failing because it depends on `eldritch-libchain` when the `stdlib` feature is enabled. `eldritch-libchain` depends on WASM-incompatible libraries like `tokio`, `hyper`, and `tonic`.

This patch introduces a `fake_bindings` feature to `eldritch-libchain` that stubs out the `tcp` method (returning an error indicating it's unsupported in the browser). The actual implementations are gated behind the `stdlib` feature, making the native dependencies optional.

The `eldritch` core crate has also been updated to register the `FakeChainLibrary` when `with_fake_agent` is called, ensuring the browser REPL can compile and link correctly against the stubbed version.

Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 9, 2026

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
208 208 0 0 0 0 1ms

Previous Results

Build 🏗️ Result 🧪 Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
#1951 208 208 0 0 0 0 not captured

Insights

Average Tests per Run Total Flaky Tests Total Failed Slowest Test (p95)
208 0 0 728ms

Test Changes

0 test added, 0 removed

Slowest Tests

Test 📝 Results 📊 Duration (avg) ⏱️ Duration (p95) ⏱️
src/context/FilterContext/tests/FilterControls.test.tsx: FilterControls > Filter lock/unlock toggle > should toggle isLocked when lock button is clicked 1 728ms 728ms
src/context/FilterContext/tests/FilterControls.test.tsx: FilterControls > Filter component interactions > should preserve filter values when toggling lock state 1 686ms 686ms
src/context/FilterContext/tests/FilterControls.test.tsx: FilterControls > Filter lock/unlock toggle > should disable filter components when isLocked is true 1 600ms 600ms
src/components/create-shell-button/CreateShellButtonWindowOpen.test.tsx: CreateShellButton opens new tab on click 1 442ms 442ms
src/context/FilterContext/tests/FilterControls.test.tsx: FilterControls > Filter label calculation > should count text search filters correctly 1 377ms 377ms
src/context/SortContext/tests/SortingControls.test.tsx: SortingControls > Updating sort settings > should update sort field when field dropdown changes 1 343ms 343ms
src/context/FilterContext/tests/FilterControls.test.tsx: FilterControls > Filter label calculation > should count multiple active filters correctly 1 318ms 318ms
src/context/FilterContext/tests/FilterControls.test.tsx: FilterControls > Filter component interactions > should update filter state when inputs change 1 305ms 305ms
src/components/tavern-base-ui/table/tests/Table.test.tsx: Table > Column sorting > should set column width from getSize() 1 231ms 231ms
src/components/tavern-base-ui/table/tests/TablePagination.test.tsx: TablePagination > Navigation callbacks > should call refetchTable with startCursor on Previous click 1 207ms 207ms

🎉 No failed tests in this run. | 🍂 No flaky tests in this run.

Github Test Reporter by CTRF 💚

🔄 This comment has been updated


impl ChainLibrary for FakeChainLibrary {
fn tcp(&self, _addr: String) -> Result<i64, String> {
Err("chain is not supported in the browser repl".into())
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

jules, change this to say that it's just not supported in this environment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Done!

Per PR feedback, the wording was changed to specify that chain is not supported in this environment (instead of the browser REPL specifically).

Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>
@KCarretto KCarretto marked this pull request as ready for review April 9, 2026 01:35
@KCarretto KCarretto merged commit 871a020 into main Apr 9, 2026
4 of 8 checks passed
@KCarretto KCarretto deleted the fix-eldritch-wasm-build-libchain-807419892841067013 branch April 9, 2026 01:38
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