Skip to content

install: Add switch to skip installation if packages exist in cache#1981

Open
autoantwort wants to merge 1 commit intomicrosoft:mainfrom
autoantwort:feature/switch-skip-install-if-cached
Open

install: Add switch to skip installation if packages exist in cache#1981
autoantwort wants to merge 1 commit intomicrosoft:mainfrom
autoantwort:feature/switch-skip-install-if-cached

Conversation

@autoantwort
Copy link
Copy Markdown
Contributor

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.

Copilot AI review requested due to automatic review settings April 8, 2026 11:14
@autoantwort autoantwort force-pushed the feature/switch-skip-install-if-cached branch from bffeb95 to 4fabd3a Compare April 8, 2026 11:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-cached switch wiring to install and set-installed.
  • Implement an early-exit path in command_set_installed_and_exit_ex() based on BinaryCache::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.

@autoantwort autoantwort force-pushed the feature/switch-skip-install-if-cached branch from 4fabd3a to 5099a76 Compare April 8, 2026 11:42
Copilot AI review requested due to automatic review settings April 8, 2026 11:46
@autoantwort autoantwort force-pushed the feature/switch-skip-install-if-cached branch from 5099a76 to e98cf4a Compare April 8, 2026 11:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

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.
@autoantwort autoantwort force-pushed the feature/switch-skip-install-if-cached branch from e98cf4a to 4c28efb Compare April 8, 2026 12:09
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

Successfully merging this pull request may close these issues.

2 participants