yonaskolb / Mint

A package manager that installs and runs executable Swift packages
MIT License
2.26k stars 122 forks source link

How to deal with inconsistent cache issue on CI machine? #202

Open mollyIV opened 3 years ago

mollyIV commented 3 years ago

In order to speed up the pipelines execution time, we cache mint packages on CI machine. The location of cached packages:

/usr/local/lib/mint/packages

Recently, when we added a new package to Mintfile and called bootstrap command, we faced the error:

$ mint bootstrap -m /Project/Mintfile
🌱 Finding latest version of metrics
🌱  Inconsistent cache, clear it up.
Error: Inconsistent metadata: git repository not found for package at path '/usr/local/lib/mint/packages/github.com_realm_SwiftLint'
The 'mint' command exited with error code 1

SwiftLint package has been pulled from cache successfully before calling the command.

We couldn't find any recommendations how to deal with such scenario in the documentation.

💡 Ideas

I'd be happy to help with the implementation 🙋‍♂️

welshm commented 1 year ago

Experiencing the same issue - also happy to contribute

yonaskolb commented 1 year ago

Is it perhaps a case insensitivity issue? Is the CI machine Linux?

welshm commented 1 year ago

Is it perhaps a case insensitivity issue? Is the CI machine Linux?

My issue was on a mac machine, but I cleared it up by cleaning my cache and then re-linking after downloading from the cache.