Skip to content

CI: Cache Hackage package index in integration tests#1667

Draft
zlav wants to merge 2 commits intozach/parallel-integration-testsfrom
zach/cache-hackage-index
Draft

CI: Cache Hackage package index in integration tests#1667
zlav wants to merge 2 commits intozach/parallel-integration-testsfrom
zach/cache-hackage-index

Conversation

@zlav
Copy link
Member

@zlav zlav commented Mar 12, 2026

Overview

Cache the Hackage package index (~/.cache/cabal/packages) in integration test workflows. cabal update currently downloads the full index (~500 MB) from scratch on every run, taking ~3.5 minutes. With the cache, subsequent runs do an incremental update in seconds.

Acceptance criteria

cabal update in integration test jobs completes in seconds instead of ~3.5 minutes when the cache is warm.

Testing plan

  1. First run populates the cache (still ~3.5 min).
  2. Subsequent runs restore the cached index — cabal update does an incremental update (~seconds).
  3. Verify all 3 test matrix jobs still pass.

Risks

  • The cache path (~/.cache/cabal/packages) assumes XDG layout, which is what the Alpine container uses (/github/home/.cache/cabal/packages). If cabal's config changes the index location, the cache would miss.
  • Cache key rotates with the release tag. Between releases, the same cache entry is reused and incrementally updated by cabal update.

Metrics

~3.5 min saved per integration test job (4 jobs total: build + 3 test shards = ~14 min saved per push on warm cache).

Checklist

  • I added tests for this PR's change (or explained in the PR description why tests don't make sense).
  • If this PR introduced a user-visible change, I added documentation into docs/.
  • If this PR added docs, I added links as appropriate to the user manual's ToC in docs/README.ms and gave consideration to how discoverable or not my documentation is.
  • If this change is externally visible, I updated Changelog.md. If this PR did not mark a release, I added my changes into an ## Unreleased section at the top.
  • If I made changes to .fossa.yml or fossa-deps.{json.yml}, I updated docs/references/files/*.schema.json AND I have updated example files used by fossa init command. You may also need to update these if you have added/removed new dependency type (e.g. pip) or analysis target type (e.g. poetry).
  • If I made changes to a subcommand's options, I updated docs/references/subcommands/<subcommand>.md.

zlav and others added 2 commits March 12, 2026 00:46
cabal update downloads the full Hackage index (~500 MB) on every run,
taking ~3.5 min. Cache ~/.cache/cabal/packages so subsequent runs do
an incremental update (seconds). Key rotates with the release tag;
restore-key fallback ensures stale caches still provide fast incremental
updates.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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