Fix WASM cfg proxy and remove stale wasm-qmd-parser crate#116
Open
Fix WASM cfg proxy and remove stale wasm-qmd-parser crate#116
Conversation
The wasm-qmd-parser crate was superseded by wasm-quarto-hub-client but never cleaned up. Remove it along with its dedicated build-wasm.yml workflow and wasm-pack install steps in hub-client-e2e.yml. Update READMEs and CLAUDE.md to remove stale references.
The cfg pattern #[cfg(any(target_arch = "wasm32", test))] forced native tests through the WASM-restricted Lua stdlib (no io/os, synthetic modules only). This caused 8 Windows test failures because the restricted stdlib doesn't work without a real wasm32 target. Change to #[cfg(target_arch = "wasm32")] so native tests use Lua::new() with the full C stdlib on all platforms. WASM-specific code paths will be tested by dedicated WASM smoke tests on the real wasm32 target in CI.
The test_dofile_script_dir_stack test validates WASM-specific dofile behavior (script directory tracking via the VFS dofile override). The native C dofile does not track the script directory stack, so this test only passes on wasm32. Mark it ignored on native targets. See #112 for the behavioral difference discussion.
rust-toolchain.toml already specifies the full toolchain configuration (nightly channel, components, targets). The dtolnay/rust-toolchain action was a redundant wrapper — rustup reads rust-toolchain.toml natively. Replace with `rustup show active-toolchain` which triggers auto-install from rust-toolchain.toml and displays the resolved toolchain. One fewer third-party action dependency across all CI workflows.
- Add .claude/rules/wasm.md: prevent cfg test proxy regression - Update xtask.md: wasm-pack → wasm-bindgen-cli, add version pinning - Update testing.md: native tests use Lua::new(), remove stale cfg proxy docs - Rewrite dev-docs/wasm.md: replace stale wasm-qmd-parser content with current wasm-quarto-hub-client architecture
Removing wasm-pack (commit 1) left the E2E workflow without wasm-bindgen-cli, which build-wasm.js requires. Extract the version from Cargo.lock to stay in sync automatically. Also fix xtask.md: dev_setup.rs hardcodes the version rather than reading it from Cargo.lock as the doc previously claimed.
Use head -1 for safety in case of multiple entries. Also fix ts-test-suite.yml which still hardcoded version 0.2.108.
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.
The
#[cfg(any(target_arch = "wasm32", test))]pattern in filter.rs and shortcode.rsforced native tests through the WASM-restricted Lua stdlib, breaking Windows test runs.
Native tests now use
Lua::new()unconditionally; WASM-specific paths only compile forwasm32.
Also removes the abandoned
wasm-qmd-parsercrate (superseded bywasm-quarto-hub-client),its CI workflow (
build-wasm.yml), allwasm-packreferences, and replacesdtolnay/rust-toolchainwith directrustupin CI workflows.Changes
testarm from#[cfg(any(target_arch = "wasm32", test))]guards in filter.rs, shortcode.rstest_dofile_script_dir_stackon native targets (WASM-only test)crates/wasm-qmd-parser/and.github/workflows/build-wasm.ymldtolnay/rust-toolchainwithrustupin all workflowsSplit from #109 — this ships the cfg fix and cleanup; #109 will rebase on this
and focus on adding WASM CI test infrastructure.