Minimal XetRuntime for WASM#873
Open
seanses wants to merge 5 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
XetRuntimeonly needs to be a extremely simple wrapper aroundtokio_with_wasmfor WASM target. This PRruntime.rstoruntime_native.rsand removing all cfg-gated code for WASM target,XetRuntimefor WASM, andruntime.rsto expose either the nativeXetRuntimeor the WASMXetRuntimethrough cfg-gate.Note
Medium Risk
Touches core async execution and session bootstrap on both native and WASM; behavior should be equivalent on native after a large file move, but WASM/runtime wiring errors could break browser builds or bridging.
Overview
Splits
XetRuntimeinto target-specific modules:runtime/native.rsholds the full Tokio-backed implementation (moved out of the monolithicruntime.rs),runtime/wasm.rsexposes a minimal stub (no Tokio handle, no-op SIGINT/shutdown,spawn_blockingviatokio_with_wasm), andruntime.rsonly definesRuntimeModeand re-exports the rightXetRuntimepercfg.XetContextandXetSessionBuilder::buildnow use#[cfg]so WASM always constructs the stub viaXetContext::with_configand never tries external-handle detection orfrom_external. Native-only APIs (handle_meets_requirements,from_external) and related session tests are gated off on WASM.Also ignores
.superpowers/and switchesxet_data’s optionalpyo3dep to the workspace definition.Reviewed by Cursor Bugbot for commit 56de726. Bugbot is set up for automated code reviews on this repo. Configure here.