cirrus-ci-docs icon indicating copy to clipboard operation
cirrus-ci-docs copied to clipboard

Problem with cache hit permissions (macOS, Linux?)

Open AlexWayfer opened this issue 3 years ago • 6 comments

Expected Behavior

Restored from CI cache executable has correct permissions.

After cache reset: https://cirrus-ci.com/build/5438662258196480

Real Behavior

codecov/uploader
/var/folders/xx/vl5f934s6k927z1vyyl9cxth0000gn/T/scripts5fb90badb37c5821b6d95526a41a9504.sh: line 5: codecov/uploader: cannot execute binary file
Exit status: 126

https://cirrus-ci.com/task/6095845136269312?logs=codecov#L0

Related Info

This is a (tick one of the following):

  • [ ] Website issue
    • Link to page:
  • [x] Task issue
    • OS: macOS
    • Task name: Test on darwin
    • Script/cache name (if applies): codecov_cache

Configuration

env:
  CODECOV_OS: macos

codecov_uploader_cache:
  folder: codecov
  fingerprint_script:
    - curl -Os https://uploader.codecov.io/latest/${CODECOV_OS}/codecov.SHA256SUM
  populate_script:
    - mkdir -p codecov
    - curl -s https://uploader.codecov.io/latest/${CODECOV_OS}/codecov -o codecov/uploader
    - chmod +x codecov/uploader

codecov_script: codecov/uploader

AlexWayfer avatar Oct 21 '22 19:10 AlexWayfer

Probably it's not only about macOS:

  • https://cirrus-ci.com/task/4925892018307072
  • https://cirrus-ci.com/task/5488841971728384

AlexWayfer avatar Oct 21 '22 20:10 AlexWayfer

Unfortunately, I wasn't able to reproduce your example: https://cirrus-ci.com/task/5442098164924416.

Here's a full .cirrus.yml:

env:
  CODECOV_OS: macos

task:
  macos_instance:
    image: monterey-base

  codecov_uploader_cache:
    folder: codecov
    fingerprint_script:
      - curl -Os https://uploader.codecov.io/latest/${CODECOV_OS}/codecov.SHA256SUM
    populate_script:
      - mkdir -p codecov
      - curl -s https://uploader.codecov.io/latest/${CODECOV_OS}/codecov -o codecov/uploader
      - chmod +x codecov/uploader

  codecov_script: codecov/uploader

Or I am missing something here?

edigaryev avatar Oct 24 '22 14:10 edigaryev

Or I am missing something here?

I don't see any valuable difference.

The project is open, you can see current complete configuration here: https://github.com/filewatcher/filewatcher/blob/0ad47c5/.cirrus.yaml

I've cleared cache today and PR had successful runs: https://cirrus-ci.com/task/6080908112429056

After merge there is the same problem: https://cirrus-ci.com/task/4662261959622656

AlexWayfer avatar Oct 24 '22 14:10 AlexWayfer

Have you tried clearing caches on master/main? It seems that you're using a custom cache fingerprint, which may result in re-using of an older cache entry (if any) without chmod +x instruction.

edigaryev avatar Oct 24 '22 15:10 edigaryev

Have you tried clearing caches on master/main? It seems that you're using a custom cache fingerprint, which may result in re-using of an older cache entry (if any) without chmod +x instruction.

  1. The checkbox is "Clean all repository caches", not "branch caches".
  2. From the issue description: https://cirrus-ci.com/build/5438662258196480 It's in main branch, as you can see. Successful after cleaning. And failing again.

AlexWayfer avatar Oct 24 '22 15:10 AlexWayfer

I don't think this is related, but I saw that Cirrus CI is moving from Intel to M1 instances, and Codecov (the problematic executable) doesn't support it yet: https://github.com/codecov/uploader/issues/523#issuecomment-1318842102

So, theoretically this issue will be non-relevant sometimes.

AlexWayfer avatar Nov 17 '22 16:11 AlexWayfer