Feature request: a command vcpkg check-binary-cache to check binary cache setup
- Dominant language
- CMake
- Stars
- 27.5k
- Forks
- 7.7k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 321
Description
### Is your feature request related to a problem? Please describe.
Testing that you have set the binary cache up correctly, including secrets and all that is notoriously difficult. Especially when there is a lot of tooling in between for example GitHub Actions and it's secrets, and using the NuGet packet cache, and if your `vcpkg` calls are usually deeply buried inside `cmake` tooling.
### Proposed solution
`vcpkg check-binary-cache` would upload a modestly-sized binary file to the cache, and probably remove it afterwards. If that fails it should probably retry it with `--debug` enabled, and fail with an exit status.
This will allow me to put this command into my runner scripts somewhere early and have it normally be quiet but output the relevant debug output if there is a problem with the cache.
### Describe alternatives you've considered
Right now I first have to detect there is a problem with the cache (which isn't obvious because caching errors are non-fatal). Then I have to add the `--debug` flag to my vcpkg invocations. Then I have to search through an incredible lot of output to try and find the needle in the haystack that tells me what the problem is.
### Additional context
_No response_
Contributor guide
Research direction
Start by tracing the existing vcpkg binary-cache upload path and how vcpkg handles debug output and failures. Define the command's behavior for uploading and removing a modest test file, retrying with --debug, and returning a failure status when setup is broken; verify it works with the cache setups described in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp
- Domain
- build-system, cli, devops
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100