Skip to content

Remove a redundant caching step#262

Merged
lukel97 merged 1 commit into
haskell:masterfrom
Ailrun:fix-ci
Jul 31, 2020
Merged

Remove a redundant caching step#262
lukel97 merged 1 commit into
haskell:masterfrom
Ailrun:fix-ci

Conversation

@Ailrun

@Ailrun Ailrun commented Jul 31, 2020

Copy link
Copy Markdown
Member

AFAIK, CircleCI's cache system treats a restore key as a prefix of a real cache key, not the exact cache key.
If the prefix(restore key) matches with many cache keys, the recent most cache will be restored.
In our setting, we have two different key schemes for saving cache

  1. stack-cache-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "stack-build.txt" }}
  2. stack-cache-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "stack-build.txt" }}-{{ checksum "all-cabal.txt" }}

However, 1. is a prefix of 2., so every prefix (restore key) that matches with 1. also matches with 2., and 2. is created later in the CI script so it's the one that will always be restored.

Ref: https://circleci.com/docs/2.0/configuration-reference/#restore_cache
(see the Note: part)

@Ailrun
Ailrun requested review from alanz, jneira and lukel97 July 31, 2020 21:28

@jneira jneira left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@lukel97
lukel97 merged commit 75d4c62 into haskell:master Jul 31, 2020
@Ailrun
Ailrun deleted the fix-ci branch December 17, 2020 18:01
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.

3 participants