Replies: 2 comments 1 reply
-
Thinking about it, it's not that weird. The cache key in many situations reflects the data that is stored in the cache. There should be a one-to-one mapping between the key and the data, not one to many ... |
Beta Was this translation helpful? Give feedback.
1 reply
-
Here it says caches are immutable: https://circleci.com/blog/config-best-practices-dependency-caching/ |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It seems that, on the CircleCI platform, if you create a cached dir with a key, say, "key-A" in the first run, then no matter what you do with that directory, including overwriting its contents, removing sub-directories, the cached content won't change actually. That means the next time when you extract the cache with "key-A", you'll always get the content that you wrote the first time.
Here is an simple example:
demo repo
examples_built
with a random matrix: https://app.circleci.com/pipelines/github/chenghuzi/test_ci_cache_flush/3/workflows/1ab9e6d7-b00e-42fb-9032-cb0cc1c7628a/jobs/3rm -rf
command and write something new into the dir: https://app.circleci.com/pipelines/github/chenghuzi/test_ci_cache_flush/4/workflows/5e5b5334-33e9-4b38-a725-53f46dc6548a/jobs/4/parallel-runs/0/steps/0-107We can see that the matrix written in the first step starts with
0.87151745
, and the recreated matrix in step 2 starts with0.85983841
. However, in step 3 we still get0.87151745
. This shows that CircleCI does not allow any modifications to an existing cache, it looks weird to me though.Beta Was this translation helpful? Give feedback.
All reactions