Repository navigation
Closed
Description
Context
Even on a checkout that contains the viewer fix 0332caf (#157), pip install . still installs a binary with the old broken viewer, so the Tauri window shows "Not Found" forever (#151 symptom). Reproduced and root-caused on Windows, 2026-06-11, main@c69997e.
Forensic evidence (the pre-fix viewer contains the literal string fastled://localhost; current source has zero fastled:// references):
- Fresh
pip install .frommain@c69997e→ installedsite-packages\fastled\bin\fastled.execontainsfastled://localhost→ stale pre-fix binary. - Even
pip install . --no-cache-dir --force-reinstall→ still contains the marker. - After deleting the stale tree artifacts and purging the pip cache,
pip install .→ marker gone (binary size changed 15043584 → 15137280). Viewer code is current.
Three stacked staleness layers, any one of which ships a broken binary:
setup.py:74-76—ensure_bundled_fastled_binary()early-returns ifsrc/fastled/bin/fastled.exealready exists, with zero freshness/version check. A stale exe dated 2026-06-07 (pre-fix) was sitting in the working tree (it's a known untracked build artifact per CLAUDE.md) and got bundled into every wheel build. A stale copy also persists inbuild/lib.win-amd64-*/fastled/bin/.setup.py:43-70—_copy_first_available_binary()harvests any pre-existing exe fromtarget/*/release/or~/.cargo/bin/instead of rebuilding, again with no check that it matches the current source.- pip wheel cache —
pip cache list fastledshowed two cachedfastled-2.0.10-py3-none-win_amd64.whlbuilt from pre-fix source. BecauseCargo.toml workspace.package.versionis still2.0.10(unchanged since the broken v2.0.10 release), pip's name+version-keyed cache happily reuses the broken wheel on plainpip install ..
Net effect: the fix for #156/#151 is on main but effectively unshippable via pip install . on any machine that ever built/installed the pre-fix version.
Proposal
- Make
setup.pynever trust pre-existing binaries. WhenCargo.tomlis present (source build), always runsoldr cargo build --release --bin fastledand copy the fresh artifact; delete/ignore any pre-existingsrc/fastled/bin/fastled[.exe]and stalebuild/lib*/fastled/bin/copies first. Keep the harvest path only for environments that genuinely cannot build (and fail loud per repo conventions, don't silently grab~/.cargo/bin). Alternatively/additionally: embed the git commit hash into the binary (build script +--versionoutput) and havesetup.pyreject a candidate binary whose hash doesn't matchgit rev-parse HEAD. - Bump
workspace.package.versionto 2.0.11 so pip's wheel cache key changes (this also unblocks the release tracked in release: cut v2.0.11 with viewer fix #157 + add viewer-wiring regression gate #160). Going forward, any user-visible fix must bump the version, otherwise layer 3 re-bites. - Add a viewer console log hook so future viewer bugs are diagnosable: a
FASTLED_VIEWER_LOGS=1env var (or--viewer-logs <file>) that injects a Tauriinitialization_scriptincrates/fastled-cli/src/tauri_viewer.rsforwardingconsole.*,window.onerror, and failed fetches to stderr/a log file. Today the viewer has no console/devtools capture at all.
Step-by-step reproduction (pre-fix state)
On a machine that previously built/installed fastled before 0332caf:
cd ~/dev/fastled-wasm
pip install .
python -c "from fastled._rust_cli import find_rust_fastled_cli as f; print(f())"
# scan the printed exe for the pre-fix marker:
# [System.Text.Encoding]::ASCII.GetString([IO.File]::ReadAllBytes($exe)).Contains('fastled://localhost') -> True = stale
cd ~/dev/fastled
Remove-Item -Recurse -Force examples\wasm\fastled_js # clear browser artifacts
fastled examples\wasm
# Tauri window shows bare "Not Found" forever, even though the compile succeeds
# and http://127.0.0.1:<port> serves the sketch fine in a regular browser.Thorough test plan (acceptance verification)
- Staleness layer 1: plant a dummy/old
src/fastled/bin/fastled.exe, runpip install ., assert the installed exe is freshly built (nofastled://localhostmarker; or matching embedded git hash). - Staleness layer 2: with
src/fastled/binempty but a stale exe intarget/release/and~/.cargo/bin/, runpip install ., assert fresh build wins. - Staleness layer 3:
pip cache list fastledafter version bump must not resolve to a2.0.10wheel; plainpip install .(no flags) on a machine with the old cached wheel must install the fixed binary. - End-to-end (the original complaint):
pip install .→cd ~/dev/fastled→ deleteexamples/wasm/fastled_js→fastled examples/wasm→ Tauri viewer must show the loading/build page and then the running sketch, never a bare "Not Found". Use the new viewer log hook to capture console output and attach it if anything fails. bash testandsoldr cargo test --workspacepass; add a unit test assertingensure_bundled_fastled_binary()does not reuse a stale binary (e.g. hash-mismatch path).
Acceptance criteria
-
pip install .from a fixed checkout on a machine with stale artifacts (tree exe, build/lib exe, target exe, cargo-bin exe, pip-cached wheel) installs a binary built from the current source. - Version bumped to 2.0.11 in
Cargo.toml(coordinates with release: cut v2.0.11 with viewer fix #157 + add viewer-wiring regression gate #160). - Viewer console/error log hook exists and is documented (env var or flag).
- E2E repro above shows loading page → sketch in the Tauri viewer.
- Regression tests cover the setup.py staleness paths.
Decisions
- Priority: P1 — same blast radius as release: cut v2.0.11 with viewer fix #157 + add viewer-wiring regression gate #160: every
pip install .on a previously-used dev machine silently ships the broken viewer; users cannot self-fix without knowing about three hidden caches. - Scope: packaging (
setup.py) + version bump + viewer log hook. The viewer code fix itself is already merged (fix: Tauri viewer loads the HTTP server URL instead of serving files from disk #157) and verified correct when freshly built. - Fix location guess:
setup.py(ensure_bundled_fastled_binary,_copy_first_available_binary),Cargo.tomlversion,crates/fastled-cli/src/tauri_viewer.rsfor the log hook. - Workaround documented for users hitting this today: delete
src/fastled/bin/fastled.exe+build/, runpip cache remove fastled, thenpip install . --force-reinstall --no-deps. Verified working. - Implementing agent: fable-5 with xhigh reasoning effort (per maintainer request).
Related issues
- release: cut v2.0.11 with viewer fix #157 + add viewer-wiring regression gate #160 (open) — release v2.0.11 + viewer-wiring regression gate; the version bump here is the same bump. This issue adds the local-build staleness layers release: cut v2.0.11 with viewer fix #157 + add viewer-wiring regression gate #160 doesn't cover (its repro assumed a checkout behind the fix; this reproduces on a checkout containing the fix).
- fix: instant launch broken — Tauri viewer loads fastled:// directory protocol, never the HTTP server, shows 'Not Found' forever #151 (open) — user-facing "Not Found" symptom.
- fix: Tauri viewer shows "Not Found" instead of compile loading page (bypasses HTTP server) #156 (closed) / fix: Tauri viewer loads the HTTP server URL instead of serving files from disk #157 (merged
0332caf) — the viewer code fix, which is correct but wasn't reaching installs.
Metadata
Metadata
Assignees
Labels
No labels
Activity