Skip to content

Cache for projects using microsoft/vcpkg broken by cache v2 API #2032

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ADKaster opened this issue Apr 22, 2025 · 2 comments
Open

Cache for projects using microsoft/vcpkg broken by cache v2 API #2032

ADKaster opened this issue Apr 22, 2025 · 2 comments

Comments

@ADKaster
Copy link

ADKaster commented Apr 22, 2025

As noted in microsoft/vcpkg#45073 (comment), The vcpkg tool was using the cache v1 endpoint manually to upload binary caches of built C and C++ packages.

In vcpkg-tool, this is managed by two classes, GHABinaryProvider and GHABinaryPushProvider. https://github.com/microsoft/vcpkg-tool/blob/113b38ab37819b673e2a773ac00f9c9c9d48407f/src/vcpkg/binarycaching.cpp#L817 and https://github.com/microsoft/vcpkg-tool/blob/113b38ab37819b673e2a773ac00f9c9c9d48407f/src/vcpkg/binarycaching.cpp#L902 , respectively.

I'm not sure how this dependency was missed for the deprecation of the old cache API. The Microsoft docs still mention the old, broken environment variables: https://learn.microsoft.com/en-us/vcpkg/consume/binary-caching-github-actions-cache#1---export-required-github-actions-environment-variables

Looking around in https://github.com/actions/toolkit/tree/main/packages/cache/src, it seems like the new API is based on protobufs, rather than a REST API? Either way.

Please provide guidance on how to update vcpkg-tool's binary cache API usage to the new v2. The 'migration guide' mentioned in the discussions was only about actual actions, not native binaries that were piggy-backing off the actions cache API directly. This feature not working has significant impact on C and C++ projects using GitHub Actions and vcpkg, going from comments in the vcpkg issue. The impact can be as severe as pushing individual PR CI times from 10 minutes to 3 hours.

@ADKaster
Copy link
Author

cc @Link-

I noticed that #1857 did not add the .proto files needed to generate the protobuf accessors to send messages to the backend. Is it safe to assume that the new RPC backend for uploading cache entries is intended to be "private"? Was vcpkg already breaking the "rules" when accessing the previous API endpoints directly from c++ code?

@Link-
Copy link
Member

Link- commented Apr 23, 2025

Thanks for reporting this @ADKaster - yes those APIs were not intended for public consumption. I'll investigate this with the team and maintainers of vcpkg.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants