Skip to content
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

[VCPKG] vcpkg manifest adds a long delay to builds even when nothing changes #14025

Open
Cheney-W opened this issue Oct 14, 2020 · 8 comments
Open
Assignees
Labels
info:manifests This PR or Issue pertains to the Manifests feature

Comments

@Cheney-W
Copy link
Contributor

This issue is first reported on Developer Community.

After enable Use Vcpkg Manifest and adding a vcpkg.json file into a c++ project in Visual Studio, the following steps will be added into the build steps:
Target VcpkgTripletSelection
Target VcpkgInstallManifestDependencies

The Target VcpkgInstallManifestDependencies step often takes more than 3 seconds to detect package changes when building, regardless of any changes to the project.
For example, just add a space in the cpp file, under normal circumstances the build step will be finished immediately, but now the VcpkgInstallManifestDependencies step will be executed first, and after a few seconds, the compilation and linking steps will be finished immediately.

Customer hopes that the VcpkgInstallManifestDependencies step will be executed only after there are vcpkg-related modifications, and it will be skipped when building general source modifications.

@Cheney-W Cheney-W added the info:manifests This PR or Issue pertains to the Manifests feature label Oct 14, 2020
@pfaco
Copy link

pfaco commented Jun 1, 2021

This is happening to me with the following setup:
CMake with presets, where CMAKE_TOOLCHAIN_FILE is set to the vcpkg toolchain.
Whenever cmake runs again - either by calling "cmake --preset=x" or by modifying the CMakeLists file -- vcpkg also runs, even if none of the vcpkg files (vcpkg.json and vcpkg_configuration.json) are modified. I noticed that 90% of vcpkg run time is detecting compiler hash.

Is there any way to avoid this to happen? Are there plans to add some kind of cache to avoid detecting compiler hash again, or to avoid vpkg running again if its files are not modified?

@autoantwort
Copy link
Contributor

#16920 and #17429 are related

@Jure-BB
Copy link

Jure-BB commented May 4, 2022

Is there any workaround for this issue?

@autoantwort
Copy link
Contributor

autoantwort commented May 4, 2022

Should not happen anymore if you don't change your vcpkg.json file (and use msbuild).

@Jure-BB
Copy link

Jure-BB commented May 4, 2022

@autoantwort For me, vcpkg install runs every time I run CMake configure in VS 2022 (17.2 preview 6). No changes are made to vcpkg.json file.

@autoantwort
Copy link
Contributor

Yes the issue is only fixed for msbuild (the original issue message is about msbuild). For cmake is will be fixed after microsoft/vcpkg-tool#362 gets merged

@DanRStevens
Copy link

I'm noticing a very long startup delay on GitHub Actions based CI builds when using manifests. The startup time can be up to about 1 minute 30 seconds before I start seeing msbuild compiling files from my project.

After restoring the package cache, the build is started with:

vcpkg integrate install
msbuild /maxCpuCount /warnAsError /property:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}}

It takes about 10 seconds before the MSBuild version banner appears, then there's a bit of output until about 40 seconds when it pauses at:

Detecting compiler hash for triplet x64-windows...

After about 1 minute and 10 seconds to about 1 minute and 30 seconds, I finally start to see build output showing my files are being compiled.

This is a case where all packages were cached. There was no building of any vcpkg packages.

All requested packages are currently installed.
Total install time: 9.2 us

Total build time for the step is usually about 4 minutes to 4 minutes and 30 seconds, so the vcpkg package check is taking a rather significant proportion of the build time.

@Cheney-W Cheney-W assigned BillyONeal and unassigned strega-nil May 25, 2023
@PatrickKa
Copy link

PatrickKa commented Aug 2, 2024

Any update/news on this? Recently I had to deal mostly with CMake at work and those extra few seconds on a reconfigure even though nothing vcpkg-related has changed are quite annoying.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info:manifests This PR or Issue pertains to the Manifests feature
Projects
None yet
Development

No branches or pull requests

8 participants