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_DEFAULT_BINARY_CACHE not working when looking for cached archives #18127

Closed
cryptomilk opened this issue May 26, 2021 · 2 comments
Closed
Assignees
Labels
category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`)

Comments

@cryptomilk
Copy link
Contributor

cryptomilk commented May 26, 2021

Describe the bug
I'm trying to use binary caching for gitlab windows runners.

vcpkg looks for 023dd0049c752931548a69400b380edc1da48022.zip in C:\Users\gitlab_runner\AppData\Local\vcpkg\archives instead of C:\GitLab-Runner\builds\cryptomilk\libssh-mirror\.vcpkg\archives defined by VCPKG_DEFAULT_BINARY_CACHE environment variable!

Log snippet:

$ If (!(test-path .vcpkg\archives)) { mkdir -p .vcpkg\archives }
    Directory: C:\GitLab-Runner\builds\cryptomilk\libssh-mirror\.vcpkg
Mode                LastWriteTime         Length Name                                                                  
----                -------------         ------ ----                                                                  
d-----        5/26/2021   2:23 PM                archives                                                              
$ ls .vcpkg
    Directory: C:\GitLab-Runner\builds\cryptomilk\libssh-mirror\.vcpkg
Mode                LastWriteTime         Length Name                                                                  
----                -------------         ------ ----                                                                  
d-----        5/26/2021   2:23 PM                archives                                                              
$ ls .vcpkg\archives
$ $env:VCPKG_DEFAULT_BINARY_CACHE="$PWD\.vcpkg\archives"
$ echo $env:VCPKG_DEFAULT_BINARY_CACHE
C:\GitLab-Runner\builds\cryptomilk\libssh-mirror\.vcpkg\archives
$ $env:VCPKG_DEFAULT_TRIPLET="x64-windows"
$ vcpkg install cmocka
Computing installation plan...
The following packages will be built and installed:
    cmocka[core]:x64-windows
Detecting compiler hash for triplet x64-windows...
A suitable version of git was not found (required v2.26.2). Downloading portable git v2.26.2...
Downloading git...
  https://github.com/git-for-windows/git/releases/download/v2.26.2.windows.1/PortableGit-2.26.2-32-bit.7z.exe -> C:\vcpkg\downloads\PortableGit-2.26.2-32-bit.7z.exe
Extracting git...
A suitable version of 7zip was not found (required v18.1.0). Downloading portable 7zip v18.1.0...
Downloading 7zip...
  https://www.nuget.org/api/v2/package/7-Zip.CommandLine/18.1.0 -> C:\vcpkg\downloads\7-zip.commandline.18.1.0.nupkg
Extracting 7zip...
A suitable version of nuget was not found (required v5.5.1). Downloading portable nuget v5.5.1...
Downloading nuget...
  https://dist.nuget.org/win-x86-commandline/v5.5.1/nuget.exe -> C:\vcpkg\downloads\22ea847d-nuget.exe
A suitable version of powershell-core was not found (required v6.2.1). Downloading portable powershell-core v6.2.1...
Downloading powershell-core...
  https://github.com/PowerShell/PowerShell/releases/download/v6.2.1/PowerShell-6.2.1-win-x86.zip -> C:\vcpkg\downloads\PowerShell-6.2.1-win-x86.zip
Extracting powershell-core...
Starting package 1/1: cmocka:x64-windows
Building package cmocka[core]:x64-windows...
Could not locate cached archive: C:\Users\gitlab_runner\AppData\Local\vcpkg\archives\02\023dd0049c752931548a69400b380edc1da48022.zip

Full log:
https://gitlab.com/cryptomilk/libssh-mirror/-/jobs/1295357514

Environment

  • OS: Windows 1809
  • Compiler: MSVC 19.26.28806.0

To Reproduce
Steps to reproduce the behavior:

  1. mkdir -p .vcpkg\archives
  2. $env:VCPKG_DEFAULT_BINARY_CACHE="$PWD.vcpkg\archives"
  3. ./vcpkg install cmocka
  4. Could not locate cached archive: C:\Users\gitlab_runner\AppData\Local\vcpkg\archives...

Expected behavior
If VCPKG_DEFAULT_BINARY_CACHE env variable it set, it should search this location for cached archives.

Failure logs
https://gitlab.com/cryptomilk/libssh-mirror/-/jobs/1295357514

Sidenote
It correctly stores it in the cache set via VCPKG_DEFAULT_BINARY_CACHE, it just doesn't load it from there ... :-)

Stored binary cache: C:\Users\gitlab_runner\AppData\Local\vcpkg\archives\02\023dd0049c752931548a69400b380edc1da48022.zip
@JackBoosY JackBoosY added the category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`) label May 27, 2021
@JackBoosY
Copy link
Contributor

cc @ras0219 @ras0219-msft

@JonLiu1993
Copy link
Member

@cryptomilk ,This issue has been solved, I have tested it locally, please update vcpkg and use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`)
Projects
None yet
Development

No branches or pull requests

4 participants