Tarball space preflight under-asks when a cached download is being replaced
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 40
- Forks
- 9
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 59
Description
The SDK tarball preflight asks for archive + margin before downloading. It does not account for a copy of the archive that is already in the cache.
install_tarball_runtime has no cache-hit check, so a re-run always re-downloads, and write_file_atomically writes a sibling temp file and then renames. During that window both the existing cached copy and the new one are on disk, so the true peak is archive + existing cached copy + margin while the preflight asks for only one of them.
This under-asks, so the consequence is a late failure rather than a false refusal — strictly the safer direction, and the out-of-space message is now mapped either way. It is still a real gap in the estimate.
Two ways forward, probably both: check for a usable cached artifact and skip the download entirely (engines/lemonade/src/lib.rs already implements that pattern), and include the size of any existing destination file in the requirement.
Split out of the review of #171 to keep that change to one concern.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at install_tarball_runtime and write_file_atomically, then compare the cache-hit behavior in engines/lemonade/src/lib.rs. Confirm that a usable cached artifact skips the download and that preflight includes any existing destination file alongside the archive and margin. Done means the peak temporary disk usage is accurately estimated and reruns avoid unnecessary replacement downloads.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100