lukka / run-cmake

GitHub Action to build C++ applications with CMake (CMakePresets.json), Ninja and vcpkg on GitHub.
MIT License
173 stars 19 forks source link

Invalid cache gets saved and never overwritten if project generation fails #83

Closed quyykk closed 1 year ago

quyykk commented 1 year ago

If the project generation fails for any reason (error in CMakeLists, manually cancelling the workflows, etc.), then the run-vcpkg action saves its cache. However, that cache might be incomplete. Subsequent runs of the workflow use that incomplete cache and if they succeed never update it with actual correct and complete cache.

I'm not very knowledgeable when it comes to caches, but it seems like it would be possible save caches when run-cmake fails under a different (restore) cache key.

Thanks!

lukka commented 1 year ago

@quyykk that is indeed a limitation of how things are implemented in run-vcpkg action, contributions are welcome.

There is already the following issue that is suggesting a workaround and collecting ideas on how to potentially solve the "partial cache saved" problem: (https://github.com/lukka/run-vcpkg/issues/128)

Closing this issue as this problem pertains to run-vcpkg and not to run-cmake.