install: Add switch to skip installation if packages exist in cache#1981
Open
autoantwort wants to merge 1 commit intomicrosoft:mainfrom
Open
install: Add switch to skip installation if packages exist in cache#1981autoantwort wants to merge 1 commit intomicrosoft:mainfrom
autoantwort wants to merge 1 commit intomicrosoft:mainfrom
Conversation
bffeb95 to
4fabd3a
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new --skip-install-if-cached switch to vcpkg install / vcpkg x-set-installed intended to avoid the (potentially expensive) “restore/extract into packages/installed” step when all required binaries are already present in configured binary cache providers.
Changes:
- Add
--skip-install-if-cachedswitch wiring toinstallandset-installed. - Implement an early-exit path in
command_set_installed_and_exit_ex()based onBinaryCache::precheck(...). - Add localized help text and a new status message for the “skipped because cached” outcome.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
src/vcpkg/commands.set-installed.cpp |
Implements the skip-if-cached early-exit behavior in the manifest/set-installed execution flow. |
src/vcpkg/commands.install.cpp |
Exposes the new switch on install and passes it into the manifest-mode implementation path. |
include/vcpkg/commands.set-installed.h |
Extends the command_set_installed_and_exit_ex signature to carry the new flag. |
include/vcpkg/base/contractual-constants.h |
Adds the skip-install-if-cached switch literal. |
include/vcpkg/base/message-data.inc.h |
Declares new localized messages for the switch help and the “skipped” output. |
locales/messages.json |
Adds English strings for the new help text and “packages cached” message. |
4fabd3a to
5099a76
Compare
5099a76 to
e98cf4a
Compare
At work we run `install` for every triplet we use and for every commit in the last two years that changed the vcpkg.json file/vcpkg submodule. We do this so that if we update our compiler/Visual Studio and a developer switches to an older support branch, they don't have to wait until all our vcpkg dependencies are build. The problem is now that this nightly job already needs 6 hours since it restores a for of packages from the cache, which is completely unnecessary if all packages are already in the cache.
e98cf4a to
4c28efb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
At work we run
installfor every triplet we use and for every commit in the last two years that changed the vcpkg.json file/vcpkg submodule. We do this so that if we update our compiler/Visual Studio and a developer switches to an older support branch, they don't have to wait until all our vcpkg dependencies are build. The problem is now that this nightly job already needs 6 hours since it restores a for of packages from the cache, which is completely unnecessary if all packages are already in the cache.