Repository navigation
Phase 2c: Port archive download and toolchain installers to Rust - #32
Merged
Merged
Conversation
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
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
crates/fastled-cli/src/archive.rswith pure-Rust ports of the core archive utilities fromemscripten_archive.pyandfrontend_esbuild.pyarchive_available()PyO3 stub incrates/fastled-py/src/lib.rsreqwest,zip,tar,zstd,serde,serde_json,anyhowWhat was ported
download(url, dest)_download_file(client, url, destination)sha256_file(path)_sha256_file(path)verify_sha256(path, expected)install_emscripten_from_archiveextract_tar_zst(archive, dest)_extract_archive(zstd+tar path)extract_zip(archive, dest)tarfile.open(…, "r:gz")path ininstall_esbuildwrite_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 inarchivemodule)_cargo clippy --workspace --all-targets -- -D warnings— clean_cargo fmt --all --check— cleanbash lint— passesbash test— 121 Python tests passCloses #20