Training
Learning path
AZ-400: Design and implement a dependency management strategy - Training
AZ-400: Design and implement a dependency management strategy
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
This guide is intended for users experiencing issues with binary caching.
It is highly recommended that you enable debug output when following this guide.
--debug
to your command invocation.-DVCPKG_INSTALL_OPTIONS="--debug"
in your CMake
configure call or in your CMakePresets.json
file.VcpkgAdditionalInstallOptions
to --debug
.VCPKG_INSTALL_OPTIONS
environment variable to --debug
.Important
Update your vcpkg tool to the latest release. Additionally, enable debug output for comprehensive error logs.
When using a NuGet binary source the following error appears:
Pushing NuGet to {url} failed. Use --debug for more information.
When using a NuGet config file binary source the following error appears:
Pushing NuGet config to {url} failed. Use --debug for more information.
This error arises when vcpkg attempts and fails to use the NuGet command line to upload packages to a NuGet feed.
You encounter the following error message:
System.Net.Http.HttpRequestException: Response status code does not indicate success: 403 (Forbidden - User <user> lacks permission to complete this action. You need to have 'AddPackage'.
Push was rejected by remote source because the user does not have sufficient write permissions.
You might see the error:
System.Net.Http.HttpRequestException: Response status code does not indicate success: 405 (Method Not Allowed).
The server rejected NuGet's push request because it did not recognize the request method.
<feed base url>/nuget/v3/index.json
.Consult the NuGet documentation for guidelines on connecting to and publishing on a NuGet feed.
Important
Update your vcpkg tool to the latest release. Additionally, enable debug output for comprehensive error logs.
You encounter errors uploading a binary package to your cache.
Uploads can fail for a variety of reasons, and error messages are usually provider specific.
Important
Update your vcpkg tool to the latest release. Additionally, enable debug output for comprehensive error logs.
Although you encountered no errors and vcpkg installation was successful, the binary cache remains empty. If you observed errors, consult push troubleshooting for NuGet and upload troubleshooting for other providers.
The following message is missing in your output.
Uploading binaries for 'rapidjson:x64-windows' to <binary source> source <url>.
Stored binaries in 1 destinations in 1.5 s.
vcpkg skipped uploading the binary package to your binary cache.
write
or readwrite
Important
Update your vcpkg tool to the latest release. Additionally, enable debug output for comprehensive error logs.
Your system rebuilds libraries locally, even when the required binary package is available in the remote binary cache.
The following message is missing in your output.
Restored 1 package(s) from <remote binary cache> in 1.1 s. Use --debug to see more details.
vcpkg choose to read your default binary cache over the remote one.
read
or readwrite
The remote cache should contain a list of binary packages you've pushed.
Each package in binary cache is labeled with an ABI hash which contains compiler versions, sources, and other information to distinguish between binary packages. If the locally computed ABI hash doesn't match the one stored remotely, the package isn't retrieved.
Important
Update your vcpkg tool to the latest release. Additionally, enable debug output for comprehensive error logs.
In an unchanged environment and without updating vcpkg, you still find yourself rebuilding libraries occassionally.
Each package in binary cache is labeled with an ABI hash which contains compiler versions, sources, and other information to distinguish between binary packages. If the locally computed ABI hash doesn't match the one stored remotely, the package isn't retrieved.
Important
Update your vcpkg tool to the latest release. Additionally, enable debug output for comprehensive error logs.
This guide is intended for users to diagnose why they have different ABI hashes for two identically named binary packages.
Determining the difference between two identically named packages requires comparing various data: sources, tool versions, compilers, and target platforms. The ABI hash provides a concise representation of this data. When calculating an ABI hash, vcpkg considers all relevant data, including file content, tool versions, and system details. It creates a hash for each data point and then combines these hashes into a single value for the binary package.
The ABI hash of the library zlib is bb1c96759ac96102b4b18215db138daedd3eb16c2cd3302ae7bffab2b643eb87
:
[DEBUG] Trying to hash <path>\buildtrees\zlib\x86-windows.vcpkg_abi_info.txt
[DEBUG] <path>\buildtrees\zlib\x86-windows.vcpkg_abi_info.txt has hash bb1c96759ac96102b4b18215db138daedd3eb16c2cd3302ae7bffab2b643eb87
If the hash changes between runs for the same library, this indicates that the two packages are distinct.
Verify if the version of your compiler changed between runs.
[DEBUG] -- The C compiler identification is MSVC 19.36.32538.0
[DEBUG] -- The CXX compiler identification is MSVC 19.36.32538.0
[DEBUG] #COMPILER_HASH#f5d02a6542664cfbd4a38db478133cbb1a18f315
The compiler hash is f5d02a6542664cfbd4a38db478133cbb1a18f315
.
Compare ABI entries for each package. A entry represents a piece of information that contributes to the final hash.
[DEBUG] <abientries for zlib:x86-windows>
[DEBUG] 0001-Prevent-invalid-inclusions-when-HAVE_-is-set-to-0.patch|750b9542cb55e6328cca01d3ca997f1373b9530afa95e04213168676936e7bfa
[DEBUG] 0002-skip-building-examples.patch|835ddecfed752e0f49be9b0f8ff7ba76541cb0a150044327316e22ca84f8d0c2
[DEBUG] 0003-build-static-or-shared-not-both.patch|d6026271dcb3d8fc74b41e235620ae31576a798e77aa411c3af8cd9e948c02b1
[DEBUG] 0004-android-and-mingw-fixes.patch|37a43eddbcb1b7dde49e7659ae895dfd0ff1df66666c1371ba7d5bfc49d8b438
[DEBUG] cmake|3.26.2
[DEBUG] features|core
[DEBUG] portfile.cmake|ac63047b644fa758860dd7ba48ff9a13b058c6f240b8e8d675b8fbba035976be
[DEBUG] ports.cmake|5a8e00cedff0c898b1f90f7d129329d0288801bc9056562b039698caf31ff3f3
[DEBUG] post_build_checks|2
[DEBUG] powershell|7.3.6
[DEBUG] triplet|x86-windows
[DEBUG] triplet_abi|3e71dd1d4afa622894ae367adbbb1ecbd42c57c51428a86b675fa1c8cad3a581-36b818778ba6f2c16962495caedb9a7b221d5be4c60de1cd3060f549319a9931-f5d02a6542664cfbd4a38db478133cbb1a18f315
[DEBUG] usage|be22662327df993eebc437495add75acb365ab18d37c7e5de735d4ea4f5d3083
[DEBUG] vcpkg-cmake|1b3dac4b9b0bcbef227c954b495174863feebe3900b2a6bdef0cd1cf04ca1213
[DEBUG] vcpkg-cmake-wrapper.cmake|5d49ef2ee6448479c2aad0e5f732e2676eaba0411860f9bebabe6002d66f57d1
[DEBUG] vcpkg.json|bc94e2540efabe36130a806381a001c57194e7de67454ab7ff1e30aa15e6ce23
[DEBUG] vcpkg_copy_pdbs|d57e4f196c82dc562a9968c6155073094513c31e2de475694143d3aa47954b1c
[DEBUG] vcpkg_fixup_pkgconfig|588d833ff057d3ca99c14616c7ecfb5948b5e2a9e4fc02517dceb8b803473457
[DEBUG] vcpkg_from_git|8f27bff0d01c6d15a3e691758df52bfbb0b1b929da45c4ebba02ef76b54b1881
[DEBUG] vcpkg_from_github|b743742296a114ea1b18ae99672e02f142c4eb2bef7f57d36c038bedbfb0502f
[DEBUG] vcpkg_replace_string|d43c8699ce27e25d47367c970d1c546f6bc36b6df8fb0be0c3986eb5830bd4f1
[DEBUG] </abientries>
Note
The triplet_abi
entry contains three hashes: the hash of the file content of the x86-windows
triplet, the windows.cmake
toolchain, and the compiler hash. These hashes would change if you decided to target a different platform.
Port files include port scripts (portfile.cmake
, vcpkg.json
), patch files (*.patch
), or any other file in the ports directory: ports/<library>/*
.
Before vcpkg ran in your CI, it cloned the latest vcpkg repository.
git clone https://github.com/microsoft/vcpkg
followed by the bootstrap
script, ensure you checkout to a specific commit.You are using the system copy of vcpkg provided by GitHub Actions, which was updated.
CMake helper functions reside in the scripts directory: scripts/*
, and typically start with vcpkg_
.
Before vcpkg ran in your CI, it cloned the latest vcpkg repository.
git clone https://github.com/microsoft/vcpkg
followed by the bootstrap
script, ensure you checkout to a specific commit.You are using the system copy of vcpkg provided by GitHub Actions, which was updated.
vcpkg rebuilt your dependencies with a different version of the compiler.
Visual Studio automatically updated the C++ workload, including the compiler, between runs. Even minor version updates will result in vcpkg rebuilding the set of libraries.
One machine created and published the binary package to a remote cache. Another machine typically used for development consumed the cached library.
The underlying image you used to build vcpkg dependencies changed, which updated the compiler version.
Hosted GitHub runners update compilers and tools weekly.
The version of tools used to build your libraries, CMake or PowerShell, changed between runs.
Visual Studio automatically updated, including any tools, between runs. Even minor version updates will result in vcpkg rebuilding the set of libraries.
--x-abi-tools-use-exact-versions
to your vcpkg invocation. This fixes the ABI of your tools based on the version in vcpkgTools.xml
; vcpkg fetches its own copy if necessary.One machine created and published the binary package to a remote cache. Another machine typically used for development consumed the cached library.
--x-abi-tools-use-exact-versions
to your vcpkg invocation. This fixes the ABI of your tools based on the version in vcpkgTools.xml
; vcpkg fetches its own copy if necessary.The underlying image you used to build vcpkg dependencies changed, which the versions of any tools used.
--x-abi-tools-use-exact-versions
to your vcpkg invocation. This fixes the ABI of your tools based on the version in vcpkgTools.xml
; vcpkg fetches its own copy if necessary.Hosted GitHub runners update compilers and tools weekly.
--x-abi-tools-use-exact-versions
to your vcpkg invocation. This fixes the ABI of your tools based on the version in vcpkgTools.xml
; vcpkg fetches its own copy if necessary.If the above options do not work, consider the following workarounds:
vcpkg export
to produce a standalone archive of your dependencies instead of restoring them from a manifest.If your issue isn't listed here, visit our repository to create a new issue.
vcpkg feedback
vcpkg is an open source project. Select a link to provide feedback:
Training
Learning path
AZ-400: Design and implement a dependency management strategy - Training
AZ-400: Design and implement a dependency management strategy