Skip to content

Conversation

@AbiSo
Copy link

@AbiSo AbiSo commented Jul 17, 2025

Setting

  • win11 64bit/32bit
  • cmake 4.0.2
  • vcpkg with cmake integration

Description

When I start cmake for my project it first starts to check the vcpkg-configuration, download and build whats needed. For each dependent package it creates a nuget package, which is uploaded to cache in azure devops. Recently that upload didn't work anymore. After some deep dive it turned out that the azure devops returns a different string in bad request response.
Previously it contained the string for example "-ApiKey AzureDevOps". It has changed to for example "-ApiKey api-key-removed".

Checking the source of vcpkg.exe revealed a place in binarycaching.cpp that has a workaround to play nicely with azure devops. The PR extends the corresponding part in binarycaching.cpp.

Notes

  • I am not an expert for vcpkg or azure devops. There are possible other options to fix that.

The vcpkg did set a new api-key, because the azure devops response contains a different string. The change adapts the condition when to re-issue nuget command.
@BillyONeal
Copy link
Member

Hmm... Azure DevOps shouldn't be messing with inter-process communication like this; it will replace API keys and similar but only does so in console output that gets posted back, not in between processes.

How did you test that this actually fixes the problem?

@AbiSo
Copy link
Author

AbiSo commented Jul 18, 2025 via email

@AbiSo
Copy link
Author

AbiSo commented Jul 21, 2025

Hi, we replaced the vcpgk.exe, with the patched one, and the build went back to normal. As I mentioned, I am no expert when it comes to Azure Devops and vcpkg. Not sure if the content of the response is configurable. We just observed that the content in the response had changed - why - dont know. but the patch solved our situation, and the binaries are cached again.

This works for local builds (developer-machines) as well as for azure devops pipeline builds. (We ensured that the pipeline use the patched vcpkg.exe)

@BillyONeal
Copy link
Member

The problem with 'well I think this fixes the problem sometimes' without a concrete understanding of what's going on is that:

  1. We might be making changes for no actual reason and what really happened is that something else changed. A common example might be accidentally getting an ancient or otherwise different copy of vcpkg containing bugs that we already fixed, and when steps are taken to try to insert a test copy, that forces everything to be current.
  2. Without an understanding of what happened, we are extremely likely to break it again.

After some deep dive it turned out that the azure devops returns a different string in bad request response.

I guess I'm looking for an explanation of how we got here.

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