CI Cache being invalidated due symlinks timestamps in .zip archive

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

See the reproducer:

The cache uses cache:key:files:

node_modules:
  cache:
    key:
      prefix: "$CI_JOB_NAME-node-$NODE_VERSION"
      files:
        - yarn.lock
    paths:
      - node_modules

and now that cache should not be uploaded if it is not the same, but since symlink timestamps in zip archives are not preserved the cache is uploaded every job run:

their both output is:

Uploading cache.zip to https://storage.googleapis.com/gitlab-com-runners-cache/project/15322558/node_modules-node-16-aaa4449dc2ac02f4dd46e1f5f745cad5b5c8e186 

while the second job already downloaded cache for the same name:

Downloading cache.zip from https://storage.googleapis.com/gitlab-com-runners-cache/project/15322558/node_modules-node-16-aaa4449dc2ac02f4dd46e1f5f745cad5b5c8e186 

comparing two zip archives:

unzip -l node_modules-node-16-aaa4449dc2ac02f4dd46e1f5f745cad5b5c8e186-1.1 > list1
unzip -l node_modules-node-16-aaa4449dc2ac02f4dd46e1f5f745cad5b5c8e186-1.2 > list2
--- list2    2022-04-15 17:32:42.098469963 +0300
+++ list3    2022-04-15 17:33:27.886147510 +0300
@@ -1,9 +1,9 @@
-Archive:  node_modules-node-16-aaa4449dc2ac02f4dd46e1f5f745cad5b5c8e186-1.1
+Archive:  node_modules-node-16-aaa4449dc2ac02f4dd46e1f5f745cad5b5c8e186-1.2
   Length      Date    Time    Name
 ---------  ---------- -----   ----
         0  2022-04-15 17:32   node_modules/
         0  2022-04-15 17:32   node_modules/.bin/
-       23  2022-04-15 17:32   node_modules/.bin/semver
+       23  2022-04-15 17:33   node_modules/.bin/semver
       602  2022-04-15 17:32   node_modules/.yarn-integrity
         0  2022-04-15 17:32   node_modules/lru-cache/
       765  2022-04-11 15:44   node_modules/lru-cache/LICENSE
Edited by 🤖 GitLab Bot 🤖