Repository navigation
ci: key opam cache on resolved pins, skip setup-ocaml on warm switch - #26
Merged
Merged
Conversation
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
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
Fixes the opam switch cache never actually helping:
Install OCaml dependenciestook ~2m on every run even with a cache hit.Root cause: the
~/.opamcache key only coveredhashFiles('*.opam'), but allpin-dependsfloat on#main. Once a cache entry exists it's immutable and the save step is skipped on hits, so after any pinned repo (melange-edn, melange-transit, persistent-sorted-set-ocaml, lg) moved, every run restored a stale switch,opam installrebuilt the moved pins, and the rebuild was never re-cached — permanently.Changes:
Resolve pinned dependency commitsstepgit ls-remotes everygit+...#refin*.opamand folds the resulting sha into the opam cache key (...-opam-${hashFiles('*.opam')}-${pins-sha}). A pin bump now produces a new key: partial restore via restore-keys →opam installrebuilds only the moved pins → saved under the new key.ocaml/setup-ocamlentirely and just downloads the opam binary (same pattern as logseq/chat CI) — removes the unconditionalopam updatethat cost ~1m40s inSet up OCamlon hits.Install OCaml dependenciesretries withopam updateon failure so a stale repo snapshot in a restored root can't permanently break resolution of newly released versions.dune-cache: truemoved offsetup-ocaml(which no longer runs on hits) to an explicit~/.cache/dunerestore/save with branch-scoped keys plus~/.config/dune(cache enabled), as in logseq/lg and logseq/chat.Link to Devin session: https://app.devin.ai/sessions/ae36c1d0df314d38abdca045e69e3708
Open in Devin Desktop: https://app.devin.ai/desktop/session/ae36c1d0df314d38abdca045e69e3708?variant=devin
Requested by: @tiensonqin