Skip to content

Dependency downloads, clones and unpacking: complete, or not there at all - #25

Merged
dmjio merged 1 commit into
mainfrom
atomic-dependency-caches
Oct 22, 2026
Merged

dmjio merged 1 commit into
mainfrom
atomic-dependency-caches

Conversation

@dmjio

@dmjio dmjio commented Oct 22, 2026

Copy link
Copy Markdown
Member

The caches in $MISO_HOME/src were filled in place, and any folder already there was treated as complete:

  • Git dependencies were cloned and then checked out in their folder. A clone cut short (Ctrl-C) or a checkout that failed left a folder at a different commit, and later builds used it without any warning.
  • Hackage tarballs were downloaded straight to their final name. A download cut short was treated as the whole tarball, and for a package not yet locked, the sha256 of the partial file went into miso.lock.
  • Unpacking went straight into src/hackage, so an unpack cut short left half a package.
  • The clone that resolves short commits had the same problem.

Now each one is written next to its final name and renamed when complete, as miso vendor and the package store already do. That's two helpers in Miso.CLI.Lock (cloneAt, unpackHackage), plus a .part file for downloads. A git checkout that already exists is also checked to be at its commit, and is cloned again if it isn't.

Checked with a small test program against a local repository and local tarballs:

  • a checkout at a commit lands at that commit
  • a checkout moved to another commit is cloned again, with a warning
  • a checkout of a rev that doesn't exist leaves no folder
  • a broken tarball leaves no folder

Generated by Claude Code

The caches in $MISO_HOME/src were filled in place, and a folder that was
there was taken as complete:
- a git dependency was cloned and then checked out in its folder; a
  clone cut short, or a checkout that failed, left a folder at another
  commit, which later builds used without a word
- a Hackage tarball was downloaded to its final name; one cut short was
  taken as the whole tarball (and a package not locked yet got the sha256
  of the partial file in miso.lock)
- a tarball was unpacked into src/hackage; an unpacking cut short left
  half a package
- the clone that resolves short commits had the same problem

Each is now written next to its final name and renamed when complete
(as miso vendor and the package store already do): cloneAt and
unpackHackage in Miso.CLI.Lock, and a .part file for downloads.  A git
checkout that is there is also checked to be at its commit, and cloned
again when it is not.

Checked with a test program against a local repository and tarballs: a
checkout at a commit; one moved to another commit is cloned again; a
checkout of a rev that does not exist, and a broken tarball, leave no
folder.
@dmjio
dmjio merged commit 8a928a6 into main Oct 22, 2026
6 checks passed
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.

1 participant