refactor(install): stage archive extraction before moving into place - #369
Open
mario-eth wants to merge 1 commit into
Open
refactor(install): stage archive extraction before moving into place#369mario-eth wants to merge 1 commit into
mario-eth wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors HTTP dependency installation to extract archives into a staging directory first, then move the fully prepared tree into the final install location. This prevents partially-extracted installs from being left behind on extraction/subdependency/integrity failures.
Changes:
- Install HTTP dependencies by unzipping into a temporary staging directory and renaming into place only after all steps succeed.
- Add cleanup logic to remove the staging directory (and the downloaded archive) on failure paths.
- Add a regression test ensuring partial trees and downloaded zips are cleaned up on extract errors.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+688
to
+694
| // short deterministic name derived from the zip's checksum when available, so a leftover | ||
| // staging directory from an interrupted install can be identified and replaced | ||
| let staging_suffix = match &dep.checksum { | ||
| Some(checksum) => checksum.chars().take(8).collect::<String>(), | ||
| None => Uuid::new_v4().simple().to_string().chars().take(8).collect::<String>(), | ||
| }; | ||
| let staging_path = parent.join(format!(".soldeer-temp-{staging_suffix}")); |
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.
No description provided.