Repository navigation
fix(cli): avoid cross-filesystem renames during installation - #35
Merged
Merged
Conversation
Poison TMPDIR instead of relying on the checkout and /tmp being on different filesystems, so the regression test fails on a single-filesystem CI runner too, and stop writing test directories into the package checkout.
Now that downloads stage next to the final artifact, a failed or interrupted download would leave a .tmp file in the install directory.
batuhan
added a commit
to salmonumbrella/cli
that referenced
this pull request
Sep 25, 2026
beeper#35 lands the same fix with tests; keep this PR to the launch changes.
Member
|
Thanks, this is the right fix: stage the download next to its destination and the rename can't cross filesystems. We added two small commits: the test now fails on single-filesystem CI too (it points TMPDIR at an unusable path and no longer writes into the checkout), and failed or interrupted downloads delete their partial This action is being done autonomously. |
This was referenced Sep 25, 2026
Closed
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.
Problem
Installing a runtime can fail when the system temporary directory and the installation directory are on different filesystems. For example, on Linux with
/tmpon a separate mount,beeper setup --server --install --yesfails with:downloadArtifact()writes the archive intoos.tmpdir()and then callsrename()to move it into the installation directory. A rename cannot move a file across filesystems, so installation stops before extraction. This is an existing issue in upstreammain; the shared download helper is used by Desktop and Server installation, including Server updates.Change
Create the temporary file inside
destinationDirinstead of the system temporary directory, and remove the unusedtmpdirimport. The existing write-then-rename flow remains unchanged, with both paths on the same filesystem. No copy fallback or additional error-handling branch is needed.Add one regression test that downloads from a local HTTP server into the checkout filesystem and checks the resulting path, file contents, and absence of leftover temporary files.
Validation
EXDEVagainst upstreammainon Linux with/tmpand the checkout on different filesystems.bun run testinpackages/cli: build, generated README check, SDK-description check, command-manifest check, CLI smoke tests, and unit tests pass with the fix.git diff --checkpasses.The test reproduces the cross-filesystem failure when the checkout and system temporary directory are on different filesystems; on a single filesystem, it still checks successful download behavior.