-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
How to change the default registry cache location #38329
Comments
This is not local binary cache. This is registry cache. |
Thank you for your help, @Osyotr. As I suspected, it was a misunderstanding on my part. Is there a way to change the default registry cache location? |
Which directory does exist?
The later one seems very unusual to me and I highly doubt that vcpkg was able to put something in a subdirectory of |
Surprisingly, the latter path does exist. The Gitlab CI pipeline runs under the system profile, and so %LOCALAPPDATA% expands to C:\Windows\System32\config\systemprofile\AppData\Local. Somehow, vcpkg is able to create that registry cache, but then it cannot access that cache when building the port. The first path you list comes from my local tests outside of the CI pipeline (replace %USERNAME% with actual username) where I was trying to figure out a way to point vcpkg away from %LOCALAPPDATA%. |
I consider this broken, but you will find more tickets. |
Yeah, it's really not great how Gitlab runs pipelines under the system profile. I found several similar issues, but they all point to binary caching issues, which is what led me down that path. As Osyotr pointed out, though, this seems to be a registry cache issue. Ideally, vcpkg would provide some way for me to change the registry cache location, but I can't find any documentation to support that route. |
As a workaround, I temporarily point Inspired by #12285 |
Registries cache location can be changed through You might also want to set |
Thank you, @ypogribnyi, that worked! |
EDIT:
As was pointed out in the comments below, I misunderstood what was happening. A more accurate question would be: How do I change the location of the default registry cache when using manifest mode?
Describe the bug
I am trying to use vcpkg in manifest mode (with CMake) in a Gitlab CI pipeline. In that situation, vcpkg fails, because it looks for packages in
%LOCALAPPDATA%
, which resolves toC:\Windows\system32\config\systemprofile\AppData\Local
, which has restricted permissions. I found two relevant issues:In both issues, it was recommended to set
VCPKG_DEFAULT_BINARY_CACHE
andVCPKG_BINARY_SOURCES
, but that did not solve my problem.As I was investigating this issue, I noticed very different behavior in how classic mode and manifest mode build packages. In classic mode, vcpkg behaves as expected. I can point it to a binary cache directory with
VCPKG_DEFAULT_BINARY_CACHE
orVCPKG_BINARY_SOURCES
, and it uses that directory. When it builds a package, it never touches%LOCALAPPDATA%
. When I try the same thing in manifest mode, it always puts ports in%LOCALAPPDATA%
, regardless of how I setVCPKG_DEFAULT_BINARY_CACHE
andVCPKG_BINARY_SOURCES
. Like I said, that won't work for me due to directory permissions.In my case, I suspect two possibilities:
VCPKG_DEFAULT_BINARY_CACHE
andVCPKG_BINARY_SOURCES
when building ports.Environment
Expected behavior
I would expect
VCPKG_DEFAULT_BINARY_CACHE
andVCPKG_BINARY_SOURCES
to affect manifest mode in the same way as classic mode. There should be some way for me to tell vcpkg not to do anything in%LOCALAPPDATA%
.Additional context
I have tried this on multiple computers under different user accounts with the same outcome. I have completely wiped everything related to vcpkg and reinstalled it. In the steps to reproduce below, I call vcpkg directly, but I see the same behavior when using vcpkg with CMake.
To Reproduce
Note that I set
VCPKG_DEFAULT_BINARY_CACHE
to$PWD\.cache\vcpkg\archives
in all of the following cases, though I don't know that it matters, given the way that I set the binary sources.--- Classic mode ---
Classic mode works as expected. At no point does it go looking for things in
%LOCALAPPDATA%
or%APPDATA%
.vcpkg install --binarysource="clear;files,$PWD\.cache\vcpkg\archives,readwrite" zlib
--- Manifest mode with existing cache ---
Now let's say I leave in place the cache created by the classic mode install, and I try to install in manifest mode:
It goes looking for packages in
%LOCALAPPDATA%
:It installs vcpkg-cmake from
%LOCALAPPDATA%
:and it finds zlib in the specified cache:
If I repeat this process:
then it finds both vcpkg-cmake and zlib in the cache:
I don't know why it goes looking for packages in
%LOCALAPPDATA%
, but at least it does seem to end up pulling from the previously created cache.--- Manifest mode without existing cache ---
Now let's get rid of that cache and try manifest mode again:
The problem happens here:
If vcpkg is running in a Gitlab CI pipeline, then it fails with the following error:
The directory does exist, but vcpkg cannot build the port due to permission restrictions.
How can I tell manifest mode not to do anything in
%LOCALAPPDATA%
?The text was updated successfully, but these errors were encountered: