Cache createad on macos is unusable for next macos build on the same python version
Description: Pretty recently I've started using setup-python cache feature for my tests. I have a shared workflow with actions https://github.com/fizyk/actions-reuse/blob/main/.github/actions/pipenv/action.yml That I reuse in my other projects. Like here: https://github.com/ClearcodeHQ/pytest-mysql/pull/456/files
However, in this particular PR linked, I have two consecutive sets of builds running one after another on macos. And the second fails if the cache exists, if it doesn't (i.e., it gets removed manually) the 2nd build works fine.
See https://github.com/ClearcodeHQ/pytest-mysql/actions/runs/6233151257
Action version: v4
Platform:
- [ ] Ubuntu
- [x] macOS
- [ ] Windows
Runner type:
- [x] Hosted
- [ ] Self-hosted
Tools version: Python 3.9. 3.10, 3.11
Repro steps:
Create two builds python builds (one after another) on macos using same python version.
Expected behavior: Build succeded
Actual behavior: Build using existing cache fails.
Hello @fizyk. Thank you for your report. We'll take a look at this issue.
@dmitry-shibanov I think I know the exact cause, i'm installing libmysql package that's being built on installation. And I have two runs on given python version on macos each is exactly the same except for the one is run against installed MySQL (and libmysql is compiled against it) and the other against mariaDB (and compiled against) both databases are installed in different locations, and that's why cache built on one wouldn't work on the other.
I think, the solution would be to have a custom, manual postfix to cache key, because otherwise as far as setup-python is concerned, all conditions are exactly the same.