I’ve tried to Google this seemingly simple matter, but to no great avail, so:
How do I cache cabal dependencies in a GitLab CI pipeline, so that they are not rebuilt on every new pipeline run?
I’ve tried to Google this seemingly simple matter, but to no great avail, so:
How do I cache cabal dependencies in a GitLab CI pipeline, so that they are not rebuilt on every new pipeline run?
You can sync the cache to/from a directory or an S3 bucket.
I’ve tried cabal new-install cabal-cache, but this fails due to version constraints:
$ cabal new-install cabal-cache
Resolving dependencies...
Error: [Cabal-7107]
Could not resolve dependencies:
[__0] trying: cabal-cache-1.2.0.0 (user goal)
[__1] trying: base-4.19.2.0/installed-9f38 (dependency of cabal-cache)
[__2] next goal: amazonka-s3 (dependency of cabal-cache)
[__2] rejecting: amazonka-s3-2.0 (conflict: base==4.19.2.0/installed-9f38, amazonka-s3 => base>=4.12 && <4.19)
[__2] skipping: amazonka-s3; 1.6.1, 1.6.0, 1.5.0, 1.4.5, 1.4.4, 1.4.3, 1.4.2, 1.4.1, 1.4.0, 1.3.7, 1.3.6, 1.3.5, 1.3.4, 1.3.3.1, 1.3.3, 1.3.2, 1.3.1, 1.3.0, 1.2.0.2, 1.2.0.1, 1.2.0, 1.1.0, 1.0.1, 1.0.0, 0.3.6, 0.3.5, 0.3.4, 0.3.3, 0.3.2, 0.3.1, 0.3.0, 0.2.3, 0.2.2, 0.2.1, 0.2.0, 0.1.4, 0.1.3, 0.1.2, 0.1.1, 0.1.0, 0.0.8, 0.0.7, 0.0.6, 0.0.5, 0.0.4, 0.0.3, 0.0.2, 0.0.1, 0.0.0 (has the same characteristics that caused the previous version to fail: excludes 'base' version 4.19.2.0)
[__2] fail (backjumping, conflict set: amazonka-s3, base, cabal-cache)
After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: base, cabal-cache, amazonka-s3
I don’t even want to sync to an S3 bucket. A directory is fine for me.
Try building with ghc-9.6.7.
But that’s not my chosen ghc version.
@JohnKy was working on providing prebuilt binaries afair. I’m not sure what happened to those efforts.