Defer completely to vcpkg to determine whether a cache is outdated
See original GitHub issueCurrently, run-vcpkg tries to detect when the cache needs to be recompiled. It does so by doing a couple of approximations: OS runner version, vcpkg.json hash and vcpkg/ version hash. This isn’t perfect of course, and causes a lot of redundant cache misses that require building every dependency again. There’s also the problem using overlay ports that aren’t part of the hash and don’t trigger rebuilds (when they’re modified) at all.
It seems like we could defer to vcpkg completely instead (this assumes manifest mode):
- Restore binary cache, always (using a cache key without any restore keys of a simplified runner version:
win22
,ubuntu22
,macos12
, etc.). - Ask vcpkg if any ports need to be rebuilt with the triplet specified as input to the action => if yes, at the end of the job we will upload the cache
- At the end ask vcpkg for a list of installed ports and check if it differs from the one in cache => if yes, a port was removed and we need to reupload the cache.
- When uploading the cache we ask vcpkg which ports were installed, and we only cache those (so that ports that have been removed aren’t uploaded)
This basically guarantees a working build (through vcpkg’s ABI detection) with as few rebuilds as possible I believe.
Thoughts? I would be willing to help out as much as I can (given my limited TS experience probably not a lot but 🤷). Thanks!
Issue Analytics
- State:
- Created 10 months ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
@lukka the vcpkg team seem fairly responsive to GitHub issues, maybe open a discussion there and ask for a recommended approach or decide on the best changes to vcpkg to support this use-case?
@quyykk i am taking my time to follow up on this, I won’t forget!