Skip to content

refactor(install): stage archive extraction before moving into place - #369

Open
mario-eth wants to merge 1 commit into
mainfrom
refactor/install-staging
Open

refactor(install): stage archive extraction before moving into place#369
mario-eth wants to merge 1 commit into
mainfrom
refactor/install-staging

Conversation

@mario-eth

Copy link
Copy Markdown
Owner

No description provided.

@mario-eth
mario-eth requested review from beeb and a lite review from Copilot August 18, 2026 03:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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}"));
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.

2 participants