Skip to content

Phase 2c: Port archive download and toolchain installers to Rust - #32

Merged
zackees merged 1 commit into
mainfrom
rust/phase-2c-archive
Apr 12, 2026
Merged

zackees merged 1 commit into
mainfrom
rust/phase-2c-archive

Conversation

@zackees

@zackees zackees commented Apr 12, 2026

Copy link
Copy Markdown
Member

Summary

  • Add crates/fastled-cli/src/archive.rs with pure-Rust ports of the core archive utilities from emscripten_archive.py and frontend_esbuild.py
  • Expose archive_available() PyO3 stub in crates/fastled-py/src/lib.rs
  • Add workspace dependencies: reqwest, zip, tar, zstd, serde, serde_json, anyhow

What was ported

Rust function Python equivalent
download(url, dest) _download_file(client, url, destination)
sha256_file(path) _sha256_file(path)
verify_sha256(path, expected) checksum comparison in install_emscripten_from_archive
extract_tar_zst(archive, dest) _extract_archive (zstd+tar path)
extract_zip(archive, dest) tarfile.open(…, "r:gz") path in install_esbuild
write_emscripten_config(install_dir, node_path) _write_emscripten_config(install_dir)

Test plan

  • _cargo build --workspace — compiles clean
  • _cargo test --workspace — 18 Rust tests pass (10 new in archive module)
  • _cargo clippy --workspace --all-targets -- -D warnings — clean
  • _cargo fmt --all --check — clean
  • bash lint — passes
  • bash test — 121 Python tests pass

Closes #20

Add crates/fastled-cli/src/archive.rs with pure-Rust implementations of
download(), verify_sha256(), extract_tar_zst(), extract_zip(), and
write_emscripten_config() — porting the core logic from
emscripten_archive.py.  Expose archive_available() stub via PyO3.
Twelve unit tests cover SHA-256 verification, ZIP extraction, config
generation (no staging paths, forward-slash normalisation), and the
single-child promotion helper.

Resolves #20
@zackees
zackees merged commit a90604a into main Apr 12, 2026
1 of 9 checks passed
@zackees
zackees deleted the rust/phase-2c-archive branch November 5, 2026 05:51
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.

Phase 2c: Port archive download and toolchain installers to Rust

1 participant