Open devnev opened 1 year ago
@devnev I added the ability to bust the pod install
caches in #142 (a long time ago).
You can bump the CACHE_VERSION
environment variable to bust the cache in such cases. I'm not sure removing the fallback is a good idea but if you have a strong opinion feel free to open a PR for it.
@fotos what are your reservations regarding removing the fallback? It mainly seems like a hurdle as noted in this issue - it's normal for caches to get invalidated when doing upgrades, but having upgrades break due to caching seems undesirable.
@devnev I took a closer look – this looks like a bug in react-native
? Check out issue facebook/react-native#36945 and https://github.com/facebook/react-native/issues/36945#issuecomment-1527512089. In other words falling back to the previous cache should work.
As I said before I don't have a strong opinion so feel free to open a PR to remove the fallback cache.
Orb version
7.1.1
What happened
After doing upgrades including pod updates, iOS build worked fine locally, but the orb's pod_install command failed in CI
Output from "Restoring cache" step:
Output from "Install CocoaPods" step:
This continued until we bumped the CACHE_KEY.
Speculation
AFAICT, the issue is that there's a bunch of outdated podspecs. I noticed that In the cache restore step, it shows that there's no cache for the exact Podfile.lock hash, but it can fall back to prefix-based matching to some previous build with a completely different Podfile.lock. Relevant CircleCI docs on restore_cache:
But I don't fully understand the pod system, and the podspecs seem to be in node_modules, so there might be more to it.
Expected behavior
Doesn't fail the build by when using an old cache.