Repository navigation
fix(install): stage runtime downloads under the dtvem root - #281
Closed
CalvinAllen wants to merge 1 commit into
Closed
CalvinAllen wants to merge 1 commit into
CalvinAllen wants to merge 1 commit into
Conversation
Installs downloaded and extracted into os.TempDir() and then used os.Rename to move the result into the versions directory. When the dtvem root lives on a different drive than the OS temp directory (e.g. DTVEM_ROOT on H: with Windows on C:), the rename fails with "The system cannot move the file to a different disk drive". The same happens on Unix when /tmp is a separate filesystem such as tmpfs. Stage installs in <root>/tmp/<runtime>-<version> instead, so the final move is always a same-volume rename. Leftovers from an interrupted install are cleared before reuse since the OS no longer cleans them.
Contributor
Author
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
Installing any runtime failed when the dtvem root is on a different drive than the OS temp directory (e.g.
DTVEM_ROOT=H:\SDKs\dtvemwith Windows onC:):All three providers downloaded and extracted into
os.TempDir()and thenos.Renamed the result intoversions/.os.Renamecan't move a directory across volumes on Windows, or across filesystems on Unix (so a tmpfs-backed/tmphas the same failure).Changes
config.PathsgainsTemp(<root>/tmp), plusStagingPath(runtime, version)andCreateStagingDir(runtime, version).<root>/tmp/<runtime>-<version>, so the final move is always a same-volume rename (still atomic, no copying).CreateStagingDirclears leftovers from an interrupted install before reuse, since the OS temp cleaner no longer covers this location. The existing deferred cleanup still removes the staging dir after each install.Testing
internal/config/paths_test.go: staging path layout, same volume asversions/, not insideversions/, directory creation, and stale-leftover removal../rnr checkpasses;go vetandgo test ./...also pass in a clean worktree of this commit alone.DTVEM_ROOT:dtvem install node 24.22.0staged under<root>\tmp, installed,node --versionreports v24.22.0, andtmp\was left empty.Resolves #278