Repository navigation
feat: restore DWARF source resolution + unblock end-to-end Windows compile - #118
Merged
Merged
Conversation
…mpile Ports the legacy `debug_symbols.py` DWARF resolver to Rust and wires it into the embedded HTTP server, then fixes every blocker found while running `fastled --just-compile` against the master FastLED on Windows. End-to-end status after this change: `--init`, `--just-compile --quick`, `--just-compile --release`, `--just-compile --debug`, and `--serve-dir` all succeed on Windows (verified 538 KB quick / 2.3 MB debug `.wasm`). Features - crates/fastled-cli/src/debug_symbols.rs — new module: DwarfPrefixConfig (loaded from `build_flags.toml` `[dwarf]`), DebugSymbolConfig with named source roots (sketch/fastled/emsdk + `headers` alias), and DebugSymbolResolver with lexical traversal guard + `dwarfsource/...` unwrapping. 6 unit tests covering prefix stripping, traversal rejection, file-not-found, and prefix overrides. Refs #85. - crates/fastled-cli/src/server.rs — new `POST /dwarfsource` and `GET /debug/source-roots` axum handlers behind a shared `Arc<RwLock<Option<DebugSymbolResolver>>>`. 4 new integration tests. - crates/fastled-cli/src/lib.rs — populates the resolver from `BuildResult.{fastled_dir, emsdk_root}` after each successful build in the watch loop. - crates/fastled-cli/src/path.rs — new NormalizedPath wrapper that strips Windows `\?\` long-path prefix on construction, lexically resolves `.`/`..`, and case-folds for stable comparison on Windows/macOS. `wasm_build::normalize_path` now delegates to it. - dylints/ban_std_pathbuf/ — new sub-crate (nightly-2026-03-26, dylint port from zackees/zccache) that denies `std::path::PathBuf` outside an explicit per-file allowlist, with the current 14 PathBuf-using files pre-allowlisted. Refs #117. Windows compile-flow fixes - install.rs (#111): accept the published emscripten manifest schema where version entries live as siblings of `latest` (the current win/x86_64/manifest.json shape), not just the historical nested `{ "versions": { ... } }` form. Adds parse_platform_manifest with 3 unit tests for both shapes plus the failure paths. - wasm_build.rs (#113): write meson cross-files with single-quoted string literals (`'path'`) instead of `{:?}` debug-quoted form (`"path"`). Meson's INI parser rejects double quotes on Windows. - wasm_build.rs (#114): NormalizedPath strips the `\?\` UNC prefix that `fs::canonicalize` returns on Windows. Python's `open()` and meson's `DirectoryLock` can't handle that prefix; the open fails with OSError errno 22, meson's win32 lock handler silently swallows it, and crashes in `msvcrt.locking(self.lockfile.fileno(), …)` with `AttributeError: 'NoneType' object has no attribute 'fileno'`. - lib.rs + wasm_build.rs (#115): `--init` now defaults to `master` (not the latest tagged release — pre-meson tags have no `meson.build`) and always writes the resolved ref into `<sketch>/fastled.json`. `resolve_fastled_dir` reads that ref back so the build path uses the same FastLED checkout the sketch was scaffolded against. - wasm_build.rs (#116): EMCC_CORES is now `available_parallelism().min(32)` instead of a hard-coded 128. Adds `run_em_link_with_retries`: on Windows, em++ link retries up to 6× because each completed sysroot library is cached to disk, so the retries converge through the flaky emcc subprocess crashes that appear under high contention. Tests/lint - 119/119 cargo lib tests pass (was 108; added 10 DWARF + 3 manifest + 2 meson-quote + 6 NormalizedPath, removed 3 in-place tests). - `bash lint` clean. Refs #85 #111 #113 #114 #115 #116 #117 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This was referenced Jun 1, 2026
Closed
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.
Summary
debug_symbols.pyDWARF resolver to Rust (issue feat: restore browser stack tracing without Playwright or CRX downloads #85) with newPOST /dwarfsourceandGET /debug/source-rootsendpoints on the embedded HTTP server. The resolver is auto-populated fromBuildResult.{fastled_dir, emsdk_root}after each successful build, and reads its prefix overrides from FastLED's[dwarf]table inbuild_flags.toml.NormalizedPathwrapper (crates/fastled-cli/src/path.rs) that strips Windows\?\long-path prefixes on construction, lexically resolves./.., and case-folds for stable comparison on case-insensitive filesystems.wasm_build::normalize_pathnow delegates to it.ban_std_pathbufdylint underdylints/(ported fromzackees/zccache, nightly-2026-03-26) that deniesstd::path::PathBufoutside an explicit per-file allowlist so the path-normalization invariant cannot regress. Refs feat: enforce NormalizedPath wrapper + ban raw PathBuf via dylint #117.{ \"latest\": \"4.0.19\", \"4.0.19\": { ... } }) in addition to the historical{ \"versions\": { ... } }form.{:?}debug-quoted form on Windows.NormalizedPathstrips the\?\prefixfs::canonicalizereturns; previously meson'sDirectoryLockcrashed withAttributeError: 'NoneType' object has no attribute 'fileno'because Python'sopen()raises errno 22 on UNC paths and meson's win32 lock handler silently swallows it.--initnow defaults tomaster(pre-meson tagged releases have nomeson.build) and always pins the resolved ref into<sketch>/fastled.json;resolve_fastled_dirreads that ref back so build and init agree.EMCC_CORESis nowavailable_parallelism().min(32)instead of a hard-coded 128; added a 6-attempt em++ link retry loop because each completed sysroot library is cached to disk, so retries converge through the flaky emcc subprocess crashes that appear under high contention on Windows.End-to-end status:
--init,--just-compile --quick,--just-compile --release,--just-compile --debug(538 KB → 2.3 MB.wasmwith embedded DWARF), and--serve-dirall succeed on Windows.Test plan
soldr cargo test --workspace --lib— 119/119 pass (was 108; +10 DWARF, +3 manifest, +2 meson-quote, +6 NormalizedPath, −3 in-place tests removed)bash lint— cleanfastled --init wasm --no-interactive— produces sketch +fastled.jsonpinned to masterfastled --just-compile --quick --no-interactive ./fastled/wasm— 538 KBfastled.wasminfastled_js/fastled --just-compile --release --no-interactive ./fastled/wasm— succeedsfastled --just-compile --debug --no-interactive ./fastled/wasm— 2.3 MBfastled.wasm(4.3× larger, embedded DWARF)fastled --serve-dir ./fastled/wasm/fastled_js --no-interactive— binds to ephemeral port and serves the outputRefs #85 #111 #113 #114 #115 #116 #117
🤖 Generated with Claude Code