Skip to content

fix(packaging): always rebuild the bundled fastled binary; never harvest stale copies - #166

Merged
zackees merged 1 commit into
mainfrom
fix/stale-bundled-binary
Jun 12, 2026
Merged

zackees merged 1 commit into
mainfrom
fix/stale-bundled-binary

Conversation

@zackees

@zackees zackees commented Jun 12, 2026

Copy link
Copy Markdown
Member

Closes #165
Refs #160 (this PR includes the 2.0.11 version bump)

Summary

pip install . from a checkout containing viewer fix #157 still installed a pre-fix binary showing "Not Found" in the Tauri viewer. Three staleness layers caused this (forensics in #165):

  1. ensure_bundled_fastled_binary() early-returned on any pre-existing src/fastled/bin/fastled[.exe] with no freshness check.
  2. _copy_first_available_binary() harvested stale exes from ~/.cargo/bin.
  3. pip's wheel cache reused old fastled-2.0.10 wheels because the version never bumped.

Changes:

  • setup.py: when Cargo.toml is present, purge stale bundled binaries (incl. build/lib*/fastled/bin copies) and always run soldr cargo build --release; drop the CARGO_HOME harvest entirely; refresh the copied binary's mtime so setuptools' mtime-based "newer" checks can't resurrect stale build/lib copies. Fails loud when neither Cargo.toml nor a bundled binary exists.
  • Version bump 2.0.10 → 2.0.11 (Cargo.toml + Cargo.lock) so pip's name+version cache key changes; also the bump release: cut v2.0.11 with viewer fix #157 + add viewer-wiring regression gate #160 needs for the release cut.
  • Viewer log hook: FASTLED_VIEWER_LOGS=1 injects an initialization script into the Tauri webview forwarding console.*, uncaught errors, unhandled rejections, and failed fetches to a new POST /viewer-log endpoint on the HTTP server, which echoes [viewer] ... lines to stderr. Documented in README.
  • Regression tests: tests/unit/test_setup_packaging.py (staleness paths, no-CARGO_HOME-harvest, fail-loud, mtime refresh) and Rust tests for the endpoint, env-flag parsing, and the injected script.

Test plan

  • uv run pytest tests/unit/ — 8 passed (5 new packaging tests + 3 existing smoke tests, incl. the Python/Cargo version-match test at 2.0.11)
  • soldr cargo test --workspace — 144 passed (incl. new /viewer-log endpoint test and tauri_viewer tests)
  • cargo fmt --check, clippy -D warnings, ruff/black/isort/pyright — clean
  • uv run pytest wheel build in the worktree exercised the new always-rebuild path end-to-end (zccache makes the forced rebuild near-instant)
  • Note: the ban_std_pathbuf dylint stage of bash lint fails to compile dylint_driver 5.0.0 against nightly-2026-03-26 on this machine — pre-existing on main, unrelated to this diff

🤖 Generated with Claude Code

…est stale copies

pip install . could ship a binary that predates the current source:
ensure_bundled_fastled_binary() early-returned on any pre-existing
src/fastled/bin/fastled[.exe], harvested old exes from ~/.cargo/bin,
and pip's wheel cache reused stale 2.0.10 wheels because the version
never changed. The viewer fix from #157 was effectively uninstallable.

- setup.py: when Cargo.toml is present, purge stale bundled binaries
  (including build/lib copies) and always run soldr cargo build; drop
  the CARGO_HOME harvest; refresh the copied binary's mtime so
  setuptools' newer-checks can't keep stale build/lib copies.
- Bump workspace version to 2.0.11 so the pip wheel cache key changes.
- Add FASTLED_VIEWER_LOGS: the Tauri viewer injects a console/error
  forwarding script that POSTs to the server's new /viewer-log
  endpoint, which echoes lines to stderr for diagnosability.
- Regression tests for the staleness paths and the new endpoint.

Closes #165
Refs #160

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@zackees
zackees merged commit 5b13331 into main Jun 12, 2026
24 of 25 checks passed
@zackees
zackees deleted the fix/stale-bundled-binary branch June 12, 2026 02:08
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.

fix(packaging): pip install . bundles a stale pre-fix fastled.exe — setup.py reuses old binaries and pip wheel cache serves stale 2.0.10 wheels

1 participant