actions / cache

Cache dependencies and build outputs in GitHub Actions
MIT License
4.39k stars 1.17k forks source link

Cache Size: ~0 MB (534 B), only for macOS and Python 3.11+ #1176

Closed adamjstewart closed 3 months ago

adamjstewart commented 1 year ago

We recently added Python 3.11 tests to our repo and since then have noticed issues with caching Python dependencies.

We have observed multiple instances where the macOS Python 3.11 tests have failed to upload cached dependencies with a message like so:

Post job cleanup.
/usr/local/bin/gtar --posix -cf cache.tzst --exclude cache.tzst -P -C /Users/runner/work/torchgeo/torchgeo --files-from manifest.txt --delay-directory-restore --use-compress-program zstdmt
Cache Size: ~0 MB (534 B)
Cache saved successfully
Cache saved with key: /Users/runner/hostedtoolcache/Python/3.11.3/x64-d0cf5c3ce1277103a52afe2355927bbca129c99c29e9d329cb7f6af9a3532f79-b406ebc86aea02106410eaf43c05bc03fb06837147c6201c5a04ce9bd7e842c4-9b22ba548569a5ffae81bd74c971b8b9da153559a29b7fa6e91a8b55bc6b06c6

Examples of this include:

The result is that the saved cache does not actually contain anything. We then see errors like pytest: command not found. Examples include:

I can't imagine why this problem is specific to macOS and Python 3.11 but that's the only case where we've seen it so far, and it's reproducible 100% of the time. See our test config file for details on how we performance caching.

Has anyone else seen this? Could it be an issue with another action like setup-python?

github-actions[bot] commented 7 months ago

This issue is stale because it has been open for 200 days with no activity. Leave a comment to avoid closing this issue in 5 days.

adamjstewart commented 7 months ago

Checking to see if this bug is still present...

adamjstewart commented 7 months ago

I can confirm that this issue is still present in cache 3.3.2.

adamjstewart commented 5 months ago

This bug also seems to occur with Python 3.12, maybe the installation directory layout changed?

adamjstewart commented 5 months ago

Also reported this here: https://github.com/actions/setup-python/issues/813

adamjstewart commented 3 months ago

This is definitely a bug in setup-python, I think we can close this.