Coder Social home page Coder Social logo

lukka / run-vcpkg Goto Github PK

View Code? Open in Web Editor NEW
173.0 5.0 25.0 3.48 MB

The GitHub Action to setup vcpkg for your C++ based projects. Stores built ports using Binary Caching backed onto GH Cache.

License: MIT License

TypeScript 96.14% JavaScript 3.86%
vcpkg cmake cpp ninja git cplusplus github-action devops

run-vcpkg's People

Contributors

copyrat90 avatar dependabot[bot] avatar justusranvier avatar jwillemsen avatar lukka avatar mrexox avatar orudge avatar vadi2 avatar zpostfacto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

run-vcpkg's Issues

integrate install

Hi,
does this action do vcpkg integrate install?
Can we add that as an option?

file COPY cannot read symlink

I’m not really sure if this is an issue with CMake, vcpkg, or run-vcpkg but it isn’t happening locally, so I’m guessing the latter. When trying to install libusb, I get the error:

CMake Error at scripts/cmake/vcpkg_install_msbuild.cmake:160 (file):
    file COPY cannot read symlink
    "D:/a/AutoML/AutoML/vcpkg/buildtrees/libusb/src/3ae1ed06fa-f8218372d8.clean/README"
    to duplicate at
    "D:/a/AutoML/AutoML/vcpkg/buildtrees/libusb/x64-windows-rel/3ae1ed06fa-f8218372d8.clean/README":
    No such file or directory.
  Call Stack (most recent call first):
    ports/libusb/portfile.cmake:42 (vcpkg_install_msbuild)
    scripts/ports.cmake:79 (include)

  Error: Building package libusb:x64-windows failed with: BUILD_FAILED

My vcpkg.txt is:

--triplet
x64-windows
libwebsockets
libusb

My GitHub action is using windows-latest and the step for vcpkg is:

    - name: Install vcpkg
      uses: lukka/run-vcpkg@v7
      env:
        ACTIONS_ALLOW_UNSECURE_COMMANDS: true
      with:
        vcpkgDirectory: '${{ github.workspace }}/vcpkg'
        vcpkgArguments: '@${{ github.workspace }}/vcpkg.txt'
        appendedCacheKey: ${{ hashFiles(env.vcpkgResponseFile) }}

The vcpkg submodule is on 2020.07. Some people were saying they were having this issue with OneDrive (microsoft/vcpkg#2488) but seeing as this library is doubtful to use OneDrive, I’m not sure. I can’t reproduce locally so I’m not sure what’s going on

"You must provide a value expression following the '/' operator."

When trying to install gtk on windows using the following step, I got the error mentioned above

  windows_build:
    runs-on: windows-latest
    steps:
      # Restore from cache the previously built ports. If cache-miss, download, build vcpkg.
      - name: Restore from cache and install vcpkg
        # Download and build vcpkg, without installing any port. If content is cached already, it is a no-op.
        uses: lukka/run-vcpkg@v3
        with:
          setupOnly: true
          vcpkgGitCommitId: c7ab9d3110813979a873b2dbac630a9ab79850dc
      - run: |
          $VCPKG_ROOT/vcpkg install gtk:x64-windows

This ^ is how it's written in the docs

Workaround was to change the run part like this

  windows_build:
    runs-on: windows-latest
    steps:
      # Restore from cache the previously built ports. If cache-miss, download, build vcpkg.
      - name: Restore from cache and install vcpkg
        # Download and build vcpkg, without installing any port. If content is cached already, it is a no-op.
        uses: lukka/run-vcpkg@v3
        with:
          setupOnly: true
          vcpkgGitCommitId: c7ab9d3110813979a873b2dbac630a9ab79850dc
      - run: |
          ${{ env.VCPKG_ROOT }}\vcpkg install gtk:x64-windows

Is a GitHub action really necessary to build a C++ based project?

Same ticket as run-cmake/issues/41, its content reported in here below:

Introduction

In an ideal world, a mature ecosystem around the 30 years old C++ language would have standard and multi platform tools handling the dependency management, the building, the testing and so forth. Such as:

cpp install && cpp build && cpp test

Ideally those exact commands would be run locally on the developer machine, or remotely on the build/test machines, in order to obtain a perfectly reproducible software development process that can be run anywhere without any difference and no surprises.

Reality is that (I can speak for Azure DevOps or GitHub workflows) server side workflows require Tasks or Actions, which are essentially something the developer cannot run locally on the development machine.

In short, the problem is the lack of 100% reproducible software development processes: the build/test process run by the developer on the local machine is not exactly identical to the one run on the server side workflow.

Let's create a reproducible workflow, not polluted with code the developer cannot run!

In this pure workflow, it is presented how to create a workflow that is as close as possible to what the developer would run locally on the development machine.
The final intention is to give the developer the power to:

  • having a reproducible workflow based on well known tools (i.e. CMake, Ninja, vcpkg).
  • provide to the developer the knowledge to create a workflow without relying on any magic GitHub action.

The pure workflow is based on:

  • absence of unneeded GitHub actions.
  • the fact that vcpkg can be bootstrapped (i.e .building the vcpkg executable) when the vcpkg's toolchain file is passed in at CMake's project file generation time.
  • the vcpkg.json manifest file that specifies declaratively the dependencies to be installed.

Developers must own the knowledge and the choices

This information must be provided to the users in the readme.md files of run-vcpkg and run-cmake: users must own the knowledge and take a conscious decision about whether any GitHub action is necessary.

Cache key doesn't seem to include triplet

I haven't done extensive testing to verify this is the case, but it seems to me that the cache key doesn't take the value of vcpkgTriplet into account. Given the following:

    - name: run-vcpkg
      uses: lukka/[email protected]
      with:
        vcpkgGitCommitId: 7192d3affa4b1d8f88e3e730eb561612c24f7d78
        vcpkgArguments: 'SDL2 openSSL glbinding cpp-httplib libzippp cppcoro'
        vcpkgTriplet: ${{ matrix.triplet }}

If I have x86-windows and x64-windows in my matrix, it seems like they both try to save under the same cache key. This means that every time the workflow is triggered, one of them gets rebuilt, since they are stepping on each other. I added appendedCacheKey: "42-pazer-${{ matrix.triplet }}" and it seemed to resolve the issue.

Unable to use run-vcpkg properly

Hello i got the following error:

##[error]run-vcpkg action execution failed: Error: Unable to locate executable file: git. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable

For the following actions snippet:

- name: vcpkg deps (Linux)
        env: # Or as an environment variable
          QT_INSTALL_CMAKE_PATH: ${{ github.workspace }}/Qt/5.15.0/gcc_64/lib/cmake
          QT_ROOT: ${{ github.workspace }}/Qt/5.15.0
          PATH: $HOME/.nimble/bin:${{ github.workspace }}/Qt/5.15.0/gcc_64/bin:$PATH
          CXXFLAGS: -stdlib=libc++
          LDFLAGS: -stdlib=libc++
          CXX: clang++-9
          CC: clang-9
        uses: lukka/run-vcpkg@v3
        with:
          vcpkgArguments: '@${{ github.workspace }}/.github/workflows/linux_response_file.txt'
          vcpkgDirectory: '${{ github.workspace }}/ci_tools_atomic_dex/vcpkg-repo'
          vcpkgGitURL: 'https://github.com/KomodoPlatform/vcpkg'
          appendedCacheKey: ${{ hashFiles('.github/workflows/linux_response_file.txt') }}

My gitmodules:

➜  atomicDEX-Pro git:(transition_unit_tests_and_modernize) cat .gitmodules 
[submodule "ci_tools_atomic_dex/vcpkg-repo"]
        path = ci_tools_atomic_dex/vcpkg-repo
        url = https://github.com/KomodoPlatform/vcpkg

Full log:

2020-06-21T22:53:15.2255377Z ##[group]Run lukka/run-vcpkg@v3
2020-06-21T22:53:15.2255512Z with:
2020-06-21T22:53:15.2255650Z   vcpkgArguments: @/home/runner/work/atomicDEX-Pro/atomicDEX-Pro/.github/workflows/linux_response_file.txt
2020-06-21T22:53:15.2255802Z   vcpkgDirectory: /home/runner/work/atomicDEX-Pro/atomicDEX-Pro/ci_tools_atomic_dex/vcpkg-repo
2020-06-21T22:53:15.2256059Z   vcpkgGitURL: https://github.com/KomodoPlatform/vcpkg
2020-06-21T22:53:15.2256213Z   appendedCacheKey: 1c4bebac6930fd2f5d16721fc2617b5ffc4c6ecd9c786eeaf8de41c2ea68061a
2020-06-21T22:53:15.2256348Z   setupOnly: false
2020-06-21T22:53:15.2256485Z   vcpkgArtifactIgnoreEntries: !.git
**/*
!installed
!/vcpkg
!vcpkg.exe
!vcpkgArtifactIgnoreEntries

2020-06-21T22:53:15.2256619Z   cleanAfterBuild: true
2020-06-21T22:53:15.2256735Z   doNotUpdateVcpkg: false
2020-06-21T22:53:15.2256848Z   useShell: true
2020-06-21T22:53:15.2256938Z env:
2020-06-21T22:53:15.2257060Z   Qt5_Dir: /home/runner/work/atomicDEX-Pro/atomicDEX-Pro/Qt/5.15.0/gcc_64
2020-06-21T22:53:15.2257226Z   Qt5_DIR: /home/runner/work/atomicDEX-Pro/atomicDEX-Pro/Qt/5.15.0/gcc_64
2020-06-21T22:53:15.2257372Z   PATH: $HOME/.nimble/bin:/home/runner/work/atomicDEX-Pro/atomicDEX-Pro/Qt/5.15.0/gcc_64/bin:$PATH
2020-06-21T22:53:15.2257522Z   QT_INSTALL_CMAKE_PATH: /home/runner/work/atomicDEX-Pro/atomicDEX-Pro/Qt/5.15.0/gcc_64/lib/cmake
2020-06-21T22:53:15.2257666Z   QT_ROOT: /home/runner/work/atomicDEX-Pro/atomicDEX-Pro/Qt/5.15.0
2020-06-21T22:53:15.2257789Z   CXXFLAGS: -stdlib=libc++
2020-06-21T22:53:15.2257902Z   LDFLAGS: -stdlib=libc++
2020-06-21T22:53:15.2258015Z   CXX: clang++-9
2020-06-21T22:53:15.2258126Z   CC: clang-9
2020-06-21T22:53:15.2258237Z ##[endgroup]
2020-06-21T22:53:15.2691239Z ##[group]Restore vcpkg and its artifacts from cache
2020-06-21T22:53:15.2716438Z vcpkg identified at commitId=a92b724ca802ed27cfe2b7078e8484589fbae23a, adding it to the cache's key.
2020-06-21T22:53:15.2720047Z Cache's key = 'submodGitId=a92b724ca802ed27cfe2b7078e8484589fbae23a-args=-1372165590-os=1524360844-appendedKey=-535328906'.
2020-06-21T22:53:15.2722244Z Running restore-cache
2020-06-21T22:53:15.3733723Z Cache miss.
2020-06-21T22:53:15.3734512Z ##[endgroup]
2020-06-21T22:53:15.3744896Z ##[group]Set output env vars
2020-06-21T22:53:15.3752520Z Set task output variable 'RUNVCPKG_VCPKG_ROOT_OUT' to value: /home/runner/work/atomicDEX-Pro/atomicDEX-Pro/ci_tools_atomic_dex/vcpkg-repo
2020-06-21T22:53:15.3755741Z ##[endgroup]
2020-06-21T22:53:15.3804722Z ##[error]run-vcpkg action execution failed: Error: Unable to locate executable file: git. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable

run-vcpkg cache

Hi Lukka,
I've been using your github action successfully to build packages via vcpkg and cache them.
Today I tried building a different package via vcpkg and for some reason it's crashing.

The package itself builds successfully but there seems to be a crash in run-vcpkg:

Please advise.

I'm using the following command:

  • name: Restore from cache and install vcpkg
    uses: lukka/run-vcpkg@v6
    with:
    vcpkgGitCommitId: 595777db2332a3442b73f9af9f656355f207aec9
    vcpkgTriplet: x64-windows
    vcpkgArguments: shaderc
    cleanAfterBuild: false

Here's the log output

-- Building x64-windows-rel
-- Installing: ...
-- Performing post-build validation
-- Performing post-build validation done
Stored binary cache: C:\Users\runneradmin\AppData\Local\vcpkg\archives\7f\7f0726ce6b0955530160c72a91edc69418d014b7.zip
Building package spirv-tools[core]:x64-windows... done
Installing package spirv-tools[core]:x64-windows...
Installing package spirv-tools[core]:x64-windows... done
Elapsed time for package spirv-tools:x64-windows: 18.47 min
Starting package 4/4: shaderc:x64-windows
Building package shaderc[core]:x64-windows...
Error: Last command execution failed with error code '3221225477'.
⏱️ elapsed: 1458.747 seconds
Error: Last command execution failed with error code '3221225477'.
at BaseUtilLib.throwIfErrorCode (D:\a_actions\lukka\run-vcpkg\v6\dist\index.js:4930:19)
at VcpkgRunner. (D:\a_actions\lukka\run-vcpkg\v6\dist\index.js:5625:28)
at Generator.next ()
at fulfilled (D:\a_actions\lukka\run-vcpkg\v6\dist\index.js:5440:58)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
Error: run-vcpkg action execution failed: Error: Last command execution failed with error code '3221225477'.

Add support for latest vcpkg release

We are using vcpkg for some github actions for our CI builds. We currently build vcpkg from github, latest sources but that is tricky. We don't want to have the burder to manually update our github actions to a new release, would it be possible to have a latest release option, when that is set run-vcpkg could see what is the latest release from github (currently https://github.com/microsoft/vcpkg/releases/tag/2020.06) and build that? At the moment there is a new release it would be automatically used.

run-vcpkg post-action doesn't run after failed step

I have a very long running vcpkg install phase and had a CMake error in a step after. This seemed to cause the post-action step of run-vcpkg to not get executed and hence not cache the installed packages. This meant that attempts to fix the CMake error resulted in long test cycles since the same packages still had to get built each time and were never cached. Since the git checkout post-action still seems to run, I guess it is possible to perform these post-actions even on failure. Looking through the run-vcpkg code, I couldn't figure out what was stopping it (but I'm not experienced with github actions).

Do you agree that it would be sensible to cache the installed packages provided the cache install step succeeded? Am I using run-vcpkg incorrectly (https://github.com/stevenlovegrove/Pangolin/actions/runs/406547331/workflow#L40 in case seeing the workflow helps)?

Thanks in advance!

Screen Shot 2020-12-07 at 10 08 56 PM

Hard Crash (SigSegv?) After Warning

I have a job that last time it finished successfully it had a warning:

build (3.8, windows-latest)
restoreCache() failed once: 'Error [ERR_STREAM_PREMATURE_CLOSE]: Premature close' 

Since then all runs have failed because vcpkg seems to SIGSEGV:

scons: Reading SConscript files ...
Getting Dependencies: 
D:\a\sidecar\sidecar\vcpkg/vcpkg install --x-install-root=./vcpkg_installed --triplet=x64-windows --overlay-triplets=./triplet-overlays/
CompletedProcess(args=['D:\\a\\sidecar\\sidecar\\vcpkg/vcpkg', 'install', '--x-install-root=./vcpkg_installed', '--triplet=x64-windows', '--overlay-triplets=./triplet-overlays/'], returncode=3221225477, stdout=b'', stderr=b'')

A python (Scons) script runs the command and as you can see there's no stdout or stderr, it just spits out 3221225477 as return code. Which seems to be SEGFAULT from cursory search.
The build then fails because it can't find the dependencies.

Jobs from other branches seem to be successful, but any branches created from this one get the same behavior.
I tried changing vcpkg.json to see if I could trigger a cache invalidation, but didn't seem to work.

Unfortunately this is happening in a private repository so I cannot share the job directly.
But we appreciate any potential help or pointers on how to further triage.

Additional information

Output of failing job - Setup Step:

Run lukka/run-vcpkg@v7
tool: C:\Program Files\Git\bin\git.exe
Fetching the Git commit id at 'D:\a\sidecar\sidecar\vcpkg' ...
bd2d86198978ee35fe9aadde3b0f7487f536fbe7
vcpkg identified at commitId='bd2d86198978ee35fe9aadde3b0f7487f536fbe7', adding it to the cache's key.
Cache's key = 'localGitId=-574880384-args=42-os=1553167250-imageVer=-2107304870-appendedKey=2045662659-triplet=1258145250'.
Restore vcpkg and its artifacts from cache
  Cache's key = 'localGitId=-574880384-args=42-os=1553167250-imageVer=-2107304870-appendedKey=2045662659-triplet=1258145250', paths = 'D:\a\sidecar\sidecar\vcpkg,!D:\a\sidecar\sidecar\vcpkg\packages,!D:\a\sidecar\sidecar\vcpkg\buildtrees,!D:\a\sidecar\sidecar\vcpkg\downloads,D:\a\sidecar\sidecar/clients/cpp/vcpkg_installed'
  Running restore-cache...
  Cache miss.
⏱ elapsed: 0.364 seconds
Set output env vars
  Set the output variable 'RUNVCPKG_VCPKG_ROOT_OUT' to value: D:\a\sidecar\sidecar\vcpkg
  Set the environment variable 'RUNVCPKG_VCPKG_TRIPLET' to value: x64-windows
  Set the output variable 'RUNVCPKG_VCPKG_TRIPLET_OUT' to value: x64-windows
⏱ elapsed: 0.002 seconds
tool: C:\Program Files\Git\bin\git.exe
Fetching the Git commit id at 'D:\a\sidecar\sidecar\vcpkg' ...
bd2d86198978ee35fe9aadde3b0f7487f536fbe7
Check whether vcpkg repository is up to date
⏱ elapsed: 0.571 seconds
Download vcpkg source code repository
⏱ elapsed: 6.703 seconds
Build vcpkg
⏱ elapsed: 0.987 seconds
Prepare vcpkg generated file for caching
⏱ elapsed: 0.000 seconds
run-vcpkg action execution succeeded

Output of last succeeding job - Setup Step - Here is where we see the Warning:

Run lukka/run-vcpkg@v7
tool: C:\Program Files\Git\bin\git.exe
Fetching the Git commit id at 'D:\a\sidecar\sidecar\vcpkg' ...
90b0a50e3b7c0ce7bfce14325a2c9d0759f2bbe7
vcpkg identified at commitId='90b0a50e3b7c0ce7bfce14325a2c9d0759f2bbe7', adding it to the cache's key.
Cache's key = 'localGitId=-574880384-args=42-os=1553167250-imageVer=-2107296685-appendedKey=-1364181334-triplet=1258145250'.
Restore vcpkg and its artifacts from cache
  Cache's key = 'localGitId=-574880384-args=42-os=1553167250-imageVer=-2107296685-appendedKey=-1364181334-triplet=1258145250', paths = 'D:\a\sidecar\sidecar\vcpkg,!D:\a\sidecar\sidecar\vcpkg\packages,!D:\a\sidecar\sidecar\vcpkg\buildtrees,!D:\a\sidecar\sidecar\vcpkg\downloads,D:\a\sidecar\sidecar/clients/cpp/vcpkg_installed'
  Running restore-cache...
  Warning: restoreCache() failed once: 'Error [ERR_STREAM_PREMATURE_CLOSE]: Premature close' , retrying...
  Cache Size: ~558 MB (584804107 B)
  C:\Windows\System32\tar.exe -z -xf D:/a/_temp/a09745f1-bc57-4396-a9a0-3fc857b349ae/cache.tgz -P -C D:/a/sidecar/sidecar
  Cache hit, id=localGitId=-574880384-args=42-os=1553167250-imageVer=-2107296685-appendedKey=-1364181334-triplet=1258145250.
⏱ elapsed: 52.227 seconds
Set output env vars
⏱ elapsed: 0.543 seconds
tool: C:\Program Files\Git\bin\git.exe
Fetching the Git commit id at 'D:\a\sidecar\sidecar\vcpkg' ...
9172179c513aa84308e48b8dd0e3df90acec7204
Check whether vcpkg repository is up to date
⏱ elapsed: 0.407 seconds
Check whether last vcpkg's build is up to date with sources
⏱ elapsed: 0.000 seconds
Check vcpkg executable exists
⏱ elapsed: 1.500 seconds
Prepare vcpkg generated file for caching
⏱ elapsed: 0.001 seconds
run-vcpkg action execution succeeded

Build Step:

scons: Reading SConscript files ...
Getting Dependencies: 
D:\a\sidecar\sidecar\vcpkg/vcpkg install --x-install-root=./vcpkg_installed --triplet=x64-windows --overlay-triplets=./triplet-overlays/
Detecting compiler hash for triplet x64-windows...
All requested packages are currently installed.

Total elapsed time: 13.5 us

Post Build Step:

Post job cleanup.
Save vcpkg and its artifacts to cache
  Cache hit occurred on the cache key 'localGitId=-574880384-args=42-os=1553167250-imageVer=-2107296685-appendedKey=-1364181334-triplet=1258145250', saving cache is skipped.
⏱ elapsed: 0.131 seconds
run-vcpkg post action execution succeeded

manifest not supported ?

Capture d’écran 2020-11-07 à 10 20 09

- name: vcpkg deps (Linux)
        if: runner.os == 'Linux'
        env: # Or as an environment variable
          CXXFLAGS: -stdlib=libc++
          LDFLAGS: -stdlib=libc++
          CXX: clang++-10
          CC: clang-10
        uses: KomodoPlatform/run-vcpkg@v5
        with:
          vcpkgArguments: '--feature-flags=binarycaching,manifests --x-manifest-root=${{ github.workspace }} --overlay-ports=${{ github.workspace }}/ci_tools_atomic_dex/vcpkg-custom-ports/ports --x-install-root=${{ github.workspace }}/ci_tools_atomic_dex/vcpkg-repo/installed'
          vcpkgDirectory: '${{ github.workspace }}/ci_tools_atomic_dex/vcpkg-repo'
          appendedCacheKey: ${{ hashFiles('vcpkg.json') }}

      - name: vcpkg deps (MacOS)
        if: runner.os == 'macOS'
        env: # Or as an environment variable
          CXX: /usr/local/opt/llvm@9/bin/clang++
          CC: /usr/local/opt/llvm@9/bin/clang
        uses: KomodoPlatform/run-vcpkg@v5
        with:
          vcpkgArguments: '--feature-flags=binarycaching,manifests --x-manifest-root=${{ github.workspace }} --overlay-ports=${{ github.workspace }}/ci_tools_atomic_dex/vcpkg-custom-ports/ports --x-install-root=${{ github.workspace }}/ci_tools_atomic_dex/vcpkg-repo/installed'
          vcpkgDirectory: '${{ github.workspace }}/ci_tools_atomic_dex/vcpkg-repo'
          appendedCacheKey: ${{ hashFiles('vcpkg.json') }}

      - name: vcpkg deps (Windows)
        if: runner.os == 'Windows'
        uses: KomodoPlatform/run-vcpkg@v5
        with:
          vcpkgArguments: '--feature-flags=binarycaching,manifests --x-manifest-root=${{ github.workspace }} --overlay-ports=${{ github.workspace }}/ci_tools_atomic_dex/vcpkg-custom-ports/ports --x-install-root=${{ github.workspace }}/ci_tools_atomic_dex/vcpkg-repo/installed --triplet=x64-Windows'
          vcpkgDirectory: '${{ github.workspace }}/ci_tools_atomic_dex/vcpkg-repo'
          appendedCacheKey: ${{ hashFiles('vcpkg.json') }}

It's seems that manifest are not handle properly, and vcpkg remove arguments are bypassed but correctly forwarded for install:

Running 'vcpkg install --recurse --feature-flags=binarycaching,manifests --x-manifest-root=D:\a\atomicDEX-Desktop\atomicDEX-Desktop --overlay-ports=D:\a\atomicDEX-Desktop\atomicDEX-Desktop/ci_tools_atomic_dex/vcpkg-custom-ports/ports --x-install-root=D:\a\atomicDEX-Desktop\atomicDEX-Desktop/ci_tools_atomic_dex/vcpkg-repo/installed --triplet=x64-Windows --clean-after-build' in directory 'D:\a\atomicDEX-Desktop\atomicDEX-Desktop\ci_tools_atomic_dex\vcpkg-repo' ...

vcpkg.json:

{
  "name": "atomicdex-desktop",
  "version-string": "0.3.0",
  "dependencies": [
    "entt",
    "folly",
    "boost-multiprecision",
    "boost-random",
    "boost-lockfree",
    "boost-stacktrace",
    "doctest",
    "fmt",
    "nlohmann-json",
    "range-v3",
    "libsodium",
    "spdlog",
    "date",
    "cpprestsdk",
    "cpp-taskflow"
  ]
}

https://vcpkg.readthedocs.io/en/stable/specifications/manifests/#manifests-vcpkgjson

What is a 'response file'?

This action heavily uses the term 'response file' yet vcpkg's official documentation and --help mentions nothing about it, so there's a disconnect for a new user here.

Wrong cache directory

according to:

const vcpkgDir = path.normalize(core.getInput(runvcpkglib.vcpkgDirectory));

it's save a wrong cache (from vcpkg docs):

Currently, our file-based backend is enabled by passing the undocumented --binarycaching flag to any 
Vcpkg command or setting the undocumented environment variable VCPKG_FEATURE_FLAGS to binarycaching. 

We will replace this feature flag with an on-by-default user-wide behavior, plus command line and environment-based configurability.

The on-by-default configuration will specify the file-based archive protocol on either 
%LOCALAPPDATA%/vcpkg/archives (Windows) or $XDG_CACHE_HOME/vcpkg/archives (Unix). 
If XDG_CACHE_HOME is not defined on Unix, we will fall back to $HOME/.cache/vcpkg/archives based 
on the XDG Base Directory Specification. 
This can be redirected with a symlink, or completely overridden with the command line or environment. 
In the future we can also consider having a user-wide configuration file, 
however we do not believe this is important for any of our key scenarios.

https://vcpkg.readthedocs.io/en/latest/specifications/binarycaching/#solution-aspects

for example with your actions every run it's what happens:

  Could not locate cached archive: /home/runner/.cache/vcpkg/archives/b0/b0c723932ac57ff82b8bb08dad40b2b9c5ed146d.zip

  Stored binary cache: /home/runner/.cache/vcpkg/archives/b0/b0c723932ac57ff82b8bb08dad40b2b9c5ed146d.zip

Caching paths: '/home/runner/work/atomicDEX-Desktop/atomicDEX-Desktop/ci_tools_atomic_dex/vcpkg-repo,!/home/runner/work/atomicDEX-Desktop/atomicDEX-Desktop/ci_tools_atomic_dex/vcpkg-repo/packages,!/home/runner/work/atomicDEX-Desktop/atomicDEX-Desktop/ci_tools_atomic_dex/vcpkg-repo/buildtrees,!/home/runner/work/atomicDEX-Desktop/atomicDEX-Desktop/ci_tools_atomic_dex/vcpkg-repo/downloads'
  Running save-cache
  /usr/local/bin/tar --use-compress-program zstd -T0 -cf cache.tzst -P -C /home/runner/work/atomicDEX-Desktop/atomicDEX-Desktop --files-from manifest.txt
  Cache saved successfully

^ we can see that $HOME/.cache/vcpkg/archives or C:\Users\runneradmin\AppData\Local\vcpkg\archives\ is missing in the caching path

would be nice to have a v6 that cache the good directory

I never made typescript in my life but an equivalent in c++ would be :

std::vector<std::filesystem::path> get_cache_paths() 
{
     std::vector<std::filesystem::path> paths;
#if defined(_WIN32) || defined(WIN32)
        const char* localappdata = nullptr;
        
        if (localappdata = std::getenv("LOCALAPPDATA"); localappdata)
        {
              paths.push_back(std::filesystem::path(localappdata) / "vcpkg" / "archives");
        }
#else
       const char* home = nullptr;
       
        if (home = std::getenv("XDG_CACHE_HOME"); home)
        {
              paths.push_back(std::filesystem::path(home) / "vcpkg" / "archives");
        } else if (home = std::getenv("HOME"); home) {
              paths.push_back(std::filesystem::path(home) / ".cache" / "vcpkg" / "archives");
        }
#endif
   return paths;
}

Export location of downloaded Ninja executable

Sometimes vcpkg ports fail, so it's convenient to work around issues by building with CMake yourself. Github Actions doesn't provide Ninja out of the box, but this action does - however the path is in $env:VCPKG_ROOT\downloads\tools\ninja\1.10.1-windows which is hardcoded to the version.

As a convenience for the unordinary cases, could the location of the ninja executable be standard or exported?

Option to not use cache

Hi, is it possible to choose to not use cache at all, other than using a version <=1.4 ?

The use case for this is: there are multiple workflows for which I want to use this action, but only one of them where I actually want this action to cache artifacts so that its execution time remains low. Since there is not enough space to cache everything, if every other workflow is also caching, the one "critical" workflow will often have its cache overwritten by that of some other workflow.

Please let me know if there is actually an option available for this that I've overlooked.

Overlay port not cached

I'm forced to use a custom overlay port of Lua 5.1 (vcpkg only supports 5.3 and I have a large ecosystem based on 5.1), and it looks like the action does not cache it. Here's how I use the action:

- name: Install dependencies with vcpkg
  uses: lukka/run-vcpkg@v1
  with:
    vcpkgArguments: '@${{env.vcpkgResponseFile}}'
    vcpkgDirectory: '${{github.workspace}}/3rdparty/vcpkg'

Here's how the output looks like:

Computing installation plan...
The following packages are already installed:
    boost-graph[core]:x64-osx
    hunspell[core]:x64-osx
    pugixml[core]:x64-osx
    yajl[core]:x64-osx
The following packages will be built and installed:
    lua[core]:x64-osx -- /Users/runner/runners/2.168.0/work/Mudlet/Mudlet/3rdparty/our-vcpkg-dependencies/lua
Package yajl:x64-osx is already installed
Package hunspell:x64-osx is already installed
Package boost-graph:x64-osx is already installed
Package pugixml:x64-osx is already installed
Starting package 1/1: lua:x64-osx
Building package lua[core]:x64-osx...
-- Installing port from location: /Users/runner/runners/2.168.0/work/Mudlet/Mudlet/3rdparty/our-vcpkg-dependencies/lua
-- Downloading https://www.lua.org/ftp/lua-5.1.5.tar.gz...

The action is in https://github.com/vadi2/Mudlet/blob/add-macos-action-ci/.github/workflows/build-mudlet.yml.

set-env deprecation

Builds using this action are currently failing due to:

Extracted triplet from command line 'x64-windows'.
  Error: Unable to process command '::set-env name=RUNVCPKG_VCPKG_TRIPLET::x64-windows' successfully.
  Error: The `set-env` command is disabled. Please upgrade to using Environment Files or opt into unsecure command execution by setting the `ACTIONS_ALLOW_UNSECURE_COMMANDS` environment variable to `true`. For more information see: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/
  Set task output variable 'RUNVCPKG_VCPKG_TRIPLET_OUT' to value: x64-windows
  Error: Unable to process command '::set-env name=RUNVCPKG_VCPKG_TRIPLET_OUT::x64-windows' successfully.
  Error: The `set-env` command is disabled. Please upgrade to using Environment Files or opt into unsecure command execution by setting the `ACTIONS_ALLOW_UNSECURE_COMMANDS` environment variable to `true`. For more information see: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/

It appears set-env needs to be replaced

Unable to restore cache

I'm trying to cache/restore vcpkg artifacts with vcpkg installed to a path under the C:\ drive.

The reason I'm not using the default workspace directory (under D:\) is because there is not enough free space available
for the installation of all packages, even if installing one package at a time and clearing buildtrees between installations,
instead of installing everything at once by using the response file directly.

While there is enough free space on the C:\ drive to install all packages successfully and complete the jobs,
I can't get the cache to restore correctly in subsequent jobs that attempt to use it. The problem is reproducible.

The cache restoration fails with the following errors:

C:/qbt_tools/vcpkg/: Can't create '\\\\?\\C:\\qbt_tools\\vcpkg'
C:/qbt_tools/vcpkg/.artifactignore: Can't create '\\\\?\\C:\\qbt_tools\\vcpkg\\.artifactignore'
C:/qbt_tools/vcpkg/.git/: Can't create '\\\\?\\C:\\qbt_tools\\vcpkg\\.git'
C:/qbt_tools/vcpkg/.gitattributes: Can't create '\\\\?\\C:\\qbt_tools\\vcpkg\\.gitattributes'
C:/qbt_tools/vcpkg/.github/: Can't create '\\\\?\\C:\\qbt_tools\\vcpkg\\.github'
C:/qbt_tools/vcpkg/.gitignore: Can't create '\\\\?\\C:\\qbt_tools\\vcpkg\\.gitignore'
C:/qbt_tools/vcpkg/.vcpkg-root: Can't create '\\\\?\\C:\\qbt_tools\\vcpkg\\.vcpkg-root'
C:/qbt_tools/vcpkg/bootstrap-vcpkg.bat: Can't create '\\\\?\\C:\\qbt_tools\\vcpkg\\bootstrap-vcpkg.bat'
C:/qbt_tools/vcpkg/bootstrap-vcpkg.sh: Can't create '\\\\?\\C:\\qbt_tools\\vcpkg\\bootstrap-vcpkg.sh'
...
... (same for all other vcpkg files)
...
tar.exe: Error exit delayed from previous errors.
restoreCache() failed: 'Error: Tar failed with error: The process 'C:\windows\System32\tar.exe' failed with exit code 1'.
Cache miss.

Example of run that cached the artifacts successfully: https://github.com/FranciscoPombal/qBittorrent/actions/runs/146840965
Example of run that failed to restore them: https://github.com/FranciscoPombal/qBittorrent/runs/806709981

Is this happening because it's not possible to restore cache to the C:\ drive? Is this a limitation of the underlying cache action?
Any help appreciated.

Awkward to specify --overlay-ports

I have to use a custom port of Lua 5.1 due to vcpkg's limitations (it doesn't support multiple versions of the same library very well) and it's a bit awakrd to specify the --overlay-ports argument. To my understanding my setup forces me to use setupOnly and then run a custom action to install what I need and provide the --overlay-ports flag.

Could there perhaps be an addition input to the action that allows you to specify the rest of the command line arguments to use?

Cache being always missing

I've been struggling to find why the cache is always being missed.

Run lukka/run-vcpkg@v7
tool: C:\Program Files\Git\bin\git.exe
Fetching the Git commit id at 'D:\a\compress-tools-rs\compress-tools-rs\vcpkg' ...
0f0bd549dc2ac273bdb3dbd69b256815c09bcd0a
vcpkg identified at commitId='0f0bd549dc2ac273bdb3dbd69b256815c09bcd0a', adding it to the cache's key.
Cache's key = 'localGitId=707254936-args=1855044079-os=1553167250-imageVer=-2108626026-appendedKey=42-triplet=1258145250'.
Restore vcpkg and its artifacts from cache
⏱ elapsed: 20.593 seconds
Set output env vars
⏱ elapsed: 0.538 seconds
tool: C:\Program Files\Git\bin\git.exe
Fetching the Git commit id at 'D:\a\compress-tools-rs\compress-tools-rs\vcpkg' ...
ec6fe06e8da05a8157dc8581fa96b36b571c1bd5
Check whether vcpkg repository is up to date
  Checking whether vcpkg's repository is updated to commit id 'ec6fe06e8da05a8157dc8581fa96b36b571c1bd5' ...
  tool: C:\Program Files\Git\bin\git.exe
  error: pathspec 'D:\a\compress-tools-rs\compress-tools-rs\vcpkg' did not match any file(s) known to git
  Current commit id of vcpkg: 'ec6fe06e8da05a8157dc8581fa96b36b571c1bd5'.
  Is vcpkg repository updated? No
⏱ elapsed: 0.597 seconds

The workflow can be seen here: https://github.com/OSSystems/compress-tools-rs/blob/master/.github/workflows/windows.yml#L28-L33

VC package was not installed properly

SANDBOX REPOSITORY : Failed RUN

During VS2019 solution build via msbuild build crashes with following error:
fatal error C1083: Cannot open include file: 'curl/curl.h': No such file or directory

Below are config files:


.github/workflows/main.yml

name: Win32Sample GitHub Release
on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  create_release:
    name: Create GitHub Release
    runs-on: windows-2019
    steps:
      - name: Install 7Zip PowerShell Module
        shell: powershell
        run: Install-Module 7Zip4PowerShell -Force -Verbose
      - uses: actions/checkout@v2
        with:
          lfs: true
      - uses: lukka/get-cmake@latest
      - name: Restore from cache and run vcpkg
        uses: lukka/run-vcpkg@v3
        with:
          vcpkgArguments: '@${{ github.workspace }}/build/vcpkg.txt'
          vcpkgTriplet: 'x86-windows'
          vcpkgDirectory: '${{ runner.workspace }}/vcpkg'
          vcpkgGitCommitId: '8a9a97315aefb3f8bc5d81bf66ca0025938b9c91'
          appendedCacheKey: ${{ hashFiles(env.vcpkgResponseFile) }}
      - name: Build Binary
        shell: cmd
        run: call .\build\build.cmd

build\build.cmd

@echo off
pushd "%~dp0..\"

if exist Debug rd /s /q Debug
if exist Release rd /s /q Release
if exist x64 rd /s /q x64

"%programfiles(x86)%\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\msbuild.exe" /p:Configuration=Release /p:Platform=x86

:exit
popd
@echo on

build/vcpkg.txt

curl[tool]
jsoncpp

workflow log

  Run lukka/get-cmake@latest29s
  Cache not found for input keys: 315670198.
Run lukka/get-cmake@latest
Restore from cache
  Cache not found for input keys: 315670198.
Download and extract CMake
  C:\windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('D:\a\_temp\6c8ce093-1657-4c05-9da4-70d0617028e5', 'D:\a\_temp\315670198')"
Add CMake to PATH
get-cmake action execution succeeded
  Restore from cache and run vcpkg7m 12s
  
Run lukka/run-vcpkg@v3
  with:
    vcpkgArguments: @D:\a\FooBar\FooBar/build/vcpkg.txt
    vcpkgTriplet: x86-windows
    vcpkgDirectory: D:\a\FooBar/vcpkg
    vcpkgGitCommitId: 8a9a97315aefb3f8bc5d81bf66ca0025938b9c91
    setupOnly: false
    vcpkgArtifactIgnoreEntries: !.git
  **/*
  !installed
  !/vcpkg
  !vcpkg.exe
  !vcpkgArtifactIgnoreEntries
  
    vcpkgGitURL: https://github.com/microsoft/vcpkg.git
    cleanAfterBuild: true
    doNotUpdateVcpkg: false
    useShell: true
    doNotCache: false
Restore vcpkg and its artifacts from cache
  Cache's key = 'localGitId=-879632411-args=1980734528-os=1553167195-appendedKey=42-triplet=-755526354'.
  Running restore-cache
  Cache miss.
Set output env vars
  Set task output variable 'RUNVCPKG_VCPKG_ROOT_OUT' to value: D:\a\FooBar\vcpkg
tool: C:\Program Files\Git\bin\git.exe
Fetching the commit id at D:\a\FooBar\vcpkg
fatal: not a git repository (or any of the parent directories): .git
Check whether vcpkg repository is up to date

 Build Binary3s
    RUNVCPKG_VCPKG_TRIPLET_OUT: x86-windows
Project "D:\a\FooBar\FooBar\FooBar.sln" (1) is building "D:\a\FooBar\FooBar\source\FooBar.vcxproj" (2) on node 1 (default targets).
PrepareForBuild:
  Creating directory "Release\".
  Creating directory "D:\a\FooBar\FooBar\Release\".
  Creating directory "Release\foo_.0dd6d879.tlog\".
InitializeBuildStatus:
  Creating "Release\foo_.0dd6d879.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
ClCompile:
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.26.28801\bin\HostX86\x86\CL.exe /c /ID:\a\FooBar\FooBar\\include /Zi /nologo /W3 /WX- /diagnostics:column /sdl /O2 /Oi /Oy- /GL /D _CRT_SECURE_NO_WARNINGS /D WIN32 /D NDEBUG /D _CONSOLE /D _UNICODE /D UNICODE /Gm- /EHsc /MD /GS /Gy /fp:precise /permissive- /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"Release\\" /Fd"Release\vc142.pdb" /Gd /TP /analyze- /FC /errorReport:queue foo_bar.cc
  foo_bar.cc
D:\a\FooBar\FooBar\source\foo_bar.cc(8,10): fatal error C1083: Cannot open include file: 'curl/curl.h': No such file or directory [D:\a\FooBar\FooBar\source\FooBar.vcxproj]
Done Building Project "D:\a\FooBar\FooBar\source\FooBar.vcxproj" (default targets) -- FAILED.
Done Building Project "D:\a\FooBar\FooBar\FooBar.sln" (default targets) -- FAILED.

Build FAILED.

"D:\a\FooBar\FooBar\FooBar.sln" (default target) (1) ->
"D:\a\FooBar\FooBar\source\FooBar.vcxproj" (default target) (2) ->
(ClCompile target) -> 
  D:\a\FooBar\FooBar\source\foo_bar.cc(8,10): fatal error C1083: Cannot open include file: 'curl/curl.h': No such file or directory [D:\a\FooBar\FooBar\source\FooBar.vcxproj]

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:03.41
##[error]Process completed with exit code 1.

Cache Behaviour

Hello,

This is a general question which might be helpful to write up in the README. What exactly determines:

  1. When the cache can be stored?
  2. When the cache can be used?

For my current workflow (https://github.com/spinicist/QUIT/actions), building vcpkg and dependencies takes >30 minutes, whereas building my project takes only 5. Hence caching is a real game-changer. I have observed the following:

  1. The cache is only stored at the end of the run in the "post vcpkg" phase, if every phase was successful. This was very frustrating for my build, because for every typo in my .yml file I had to wait 30 minutes for the dependencies to build. Would it be possible to store the cache directly after finishing a successful vcpkg+dependencies build instead?
  2. I kicked off a build with a tag, which will create a Release with my setup. I did this via (approximately) git commit -m "A release build"; git tag a_tag; git push && git push origin a_tag. This starts two builds almost simultaneously in Github Actions, one for the first push and one for the tag. The first build correctly picked up the cached vcpkg information, but the tag did not. Why did the tag build not pick up the cache?

Thanks again for providing these actions, they're very useful.

Problem using May 2021 vcpkg release

We've set up github actions to build libzip on Windows, and use run-vcpkg to install the necessary dependencies.
We initially based our setup on what scummvm does, since the documentation in the Quickstart section of the README doesn't even mention that vcpkgGitCommitId is required.

scummvm is using the November 2020 release of vcpkg so we started with that and got it working:
https://github.com/nih-at/libzip/blob/master/.github/workflows/build.yml
https://github.com/nih-at/libzip/runs/2859455515?check_suite_focus=true

but there was an issue in liblzma, so I tried switching to the May 2021 release of vcpkg:
nih-at/libzip@6405b8d#diff-5c3fa597431eda03ac3339ae6bf7f05e1a50d6fc7333679ec38e21b337cb6721

However, after that change it does not finish building bzip2 any longer (though the bzip2 package itself does not have any changes between the two tags):
https://github.com/nih-at/libzip/runs/2859844478?check_suite_focus=true

I'm not sure if you can see the logs, so here's part of the log:

Install/Update ports
  Running 'vcpkg remove --outdated --recurse ' in directory 'D:\a\libzip\libzip\vcpkg' ...
  There are no outdated packages.
  Using triplet 'x64-windows'.
  Set the environment variable 'RUNVCPKG_VCPKG_TRIPLET' to value: x64-windows
  Set the output variable 'RUNVCPKG_VCPKG_TRIPLET_OUT' to value: x64-windows
  Running 'vcpkg install --recurse zlib bzip2 liblzma zstd --triplet x64-windows --clean-after-build' in directory 'D:\a\libzip\libzip\vcpkg' ...
  Computing installation plan...
  The following packages will be built and installed:
      bzip2[core]:x64-windows -> 1.0.8#1
      liblzma[core]:x64-windows -> 5.2.5#2
      zlib[core]:x64-windows -> 1.2.11#10
      zstd[core]:x64-windows -> 1.4.9
  Detecting compiler hash for triplet x64-windows...
  Could not locate cached archive: C:\Users\runneradmin\AppData\Local\vcpkg\archives\43\43b505470d324322516cdf2f8f95df303ec4da8e.zip
  Could not locate cached archive: C:\Users\runneradmin\AppData\Local\vcpkg\archives\19\19e7a8b72f5b408a7a16139961f88f4430ebd788.zip
  Could not locate cached archive: C:\Users\runneradmin\AppData\Local\vcpkg\archives\3d\3dba13f76ad5a5bd7b46fffcb031c1ed46d375be.zip
  Could not locate cached archive: C:\Users\runneradmin\AppData\Local\vcpkg\archives\b8\b8ff9a9ecba3ccb5ada59896c90cdaab1a1d472d.zip
  Starting package 1/4: bzip2:x64-windows
  Building package bzip2[core]:x64-windows...
  -- Fetching https://sourceware.org/git/bzip2.git...
  CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:91 (file):
    file failed to open for reading (No such file or directory):
  
      D:/a/libzip/libzip/vcpkg/buildtrees/bzip2/git-init-x64-windows-out.log
  Call Stack (most recent call first):
    scripts/cmake/vcpkg_from_git.cmake:85 (vcpkg_execute_required_process)
    ports/bzip2/portfile.cmake:1 (vcpkg_from_git)
    scripts/ports.cmake:142 (include)
  
  
  Error: Building package bzip2:x64-windows failed with: BUILD_FAILED
  Please ensure you're using the latest portfiles with `.\vcpkg update`, then
  submit an issue at https://github.com/Microsoft/vcpkg/issues including:
    Package: bzip2:x64-windows
    Vcpkg version: 2021-05-05-9f849c4c43e50d1b16186ae76681c27b0c1be9d9
  
  Additionally, attach any relevant sections from the log files above.

I then tried adding a manual 'vcpkg update' step and some other things, but couldn't get it to work.
(see https://github.com/nih-at/libzip/commits/master/.github/workflows/build.yml for details)

Is this a problem in vcpkg-run or in vcpkg? I'm not sure where to report this.
Thank you.

Cache miss but fails to cache too

On my fork of a project, I hit this weird problem of being in an in-between state or something when it comes to caching:

https://github.com/TrueBrain/OpenTTD/runs/1668083380?check_suite_focus=true

When trying to restore the cache, it reads:

Restore vcpkg and its artifacts from cache
  Cache's key = 'localGitId=42-args=-2010035955-os=1553167195-appendedKey=42-triplet=877224823', paths = 'c:\vcpkg,!c:\vcpkg\packages,!c:\vcpkg\buildtrees,!c:\vcpkg\downloads'
  Running restore-cache...
  Cache miss.

When trying to store the cache, it reads:

   Caching paths: 'c:\vcpkg,!c:\vcpkg\packages,!c:\vcpkg\buildtrees,!c:\vcpkg\downloads'
  Running save-cache with key 'localGitId=42-args=-2010035955-os=1553167195-appendedKey=42-triplet=877224823' ...
  Warning: reserveCache failed: Cache already exists. Scope: refs/heads/master, Key: localGitId=42-args=-2010035955-os=1553167195-appendedKey=42-triplet=877224823, Version: e596d9224b0d5487c49893de7ad8700f61714e1ba95b948df70e6f4d9d37eb16

And I never end up with anything in the cache :) This only happens on my fork; the upstream project is doing just fine. Not sure what happened, or how to reproduce, honestly. I am just hoping you are like: owh, doh, of course, and that is is a simple fix on either of our ends :D

Tnx!

vcpkg failing on macOS

run-vcpkg is failing to run here, even on a rebuild, with this log:

2021-01-14T13:24:18.2723360Z ##[group]Run lukka/run-vcpkg@v5
2021-01-14T13:24:18.2723870Z with:
2021-01-14T13:24:18.2724710Z   vcpkgArguments: @/Users/runner/work/Mudlet/Mudlet/3rdparty/our-vcpkg-dependencies/vcpkg-x64-osx-dependencies
2021-01-14T13:24:18.2725760Z   vcpkgDirectory: /Users/runner/work/Mudlet/Mudlet/3rdparty/vcpkg
2021-01-14T13:24:18.2726930Z   appendedCacheKey: ba279cb15eb6507b8ab8da50737cc246a49faf17e6d8f0bee7202d39655e603d-key
2021-01-14T13:24:18.2727980Z   setupOnly: false
2021-01-14T13:24:18.2728840Z   vcpkgArtifactIgnoreEntries: !.git
**/*
!installed
!/vcpkg
!vcpkg.exe
!vcpkgArtifactIgnoreEntries

2021-01-14T13:24:18.2729920Z   vcpkgGitURL: https://github.com/microsoft/vcpkg.git
2021-01-14T13:24:18.2730570Z   cleanAfterBuild: true
2021-01-14T13:24:18.2731050Z   doNotUpdateVcpkg: false
2021-01-14T13:24:18.2731510Z   useShell: true
2021-01-14T13:24:18.2731910Z   doNotCache: false
2021-01-14T13:24:18.2732300Z env:
2021-01-14T13:24:18.2732980Z   pythonLocation: /Users/runner/hostedtoolcache/Python/3.9.1/x64
2021-01-14T13:24:18.2733640Z   Qt5_Dir: /Users/runner/work/Mudlet/Qt/5.14.1/clang_64
2021-01-14T13:24:18.2734190Z   Qt5_DIR: /Users/runner/work/Mudlet/Qt/5.14.1/clang_64
2021-01-14T13:24:18.2734780Z   QT_PLUGIN_PATH: /Users/runner/work/Mudlet/Qt/5.14.1/clang_64/plugins
2021-01-14T13:24:18.2735440Z   QML2_IMPORT_PATH: /Users/runner/work/Mudlet/Qt/5.14.1/clang_64/qml
2021-01-14T13:24:18.2736440Z   vcpkgResponseFile: /Users/runner/work/Mudlet/Mudlet/3rdparty/our-vcpkg-dependencies/vcpkg-x64-osx-dependencies
2021-01-14T13:24:18.2737440Z ##[endgroup]
2021-01-14T13:24:18.3765820Z ##[group]Restore vcpkg and its artifacts from cache
2021-01-14T13:24:18.3798640Z vcpkg identified at commitId='4b222f8d2653603b74fa5086cf0b02a1963d3911', adding it to the cache's key.
2021-01-14T13:24:18.3803160Z Cache's key = 'submodGitId=4b222f8d2653603b74fa5086cf0b02a1963d3911-args=262756201-os=-931134771-appendedKey=-1200961648'.
2021-01-14T13:24:18.3806610Z Running restore-cache
2021-01-14T13:24:20.7037240Z Cache Size: ~92 MB (96609131 B)
2021-01-14T13:24:20.7127170Z [command]/usr/bin/tar --use-compress-program zstd -d -xf /Users/runner/work/_temp/7417f9e6-5240-4776-a5ec-8b823a6cc05e/cache.tzst -P -C /Users/runner/work/Mudlet/Mudlet
2021-01-14T13:24:30.5644180Z Cache hit, id=submodGitId=4b222f8d2653603b74fa5086cf0b02a1963d3911-args=262756201-os=-931134771-appendedKey=-1200961648.
2021-01-14T13:24:30.5645890Z ##[endgroup]
2021-01-14T13:24:30.5647210Z ⏱ elapsed: 12.188 seconds
2021-01-14T13:24:30.5704840Z ##[group]Set output env vars
2021-01-14T13:24:30.5715410Z Set task output variable 'RUNVCPKG_VCPKG_ROOT_OUT' to value: /Users/runner/work/Mudlet/Mudlet/3rdparty/vcpkg
2021-01-14T13:24:30.5718940Z ##[endgroup]
2021-01-14T13:24:30.5720240Z ⏱ elapsed: 0.002 seconds
2021-01-14T13:24:30.5721860Z tool: /usr/local/bin/git
2021-01-14T13:24:30.5723190Z Fetching the commit id at /Users/runner/work/Mudlet/Mudlet/3rdparty/vcpkg
2021-01-14T13:24:30.5857980Z 4b222f8d2653603b74fa5086cf0b02a1963d3911
2021-01-14T13:24:30.5867780Z ##[group]Check whether vcpkg repository is up to date
2021-01-14T13:24:30.5870010Z Checking whether vcpkg's repository is updated to commit id '4b222f8d2653603b74fa5086cf0b02a1963d3911' ...
2021-01-14T13:24:30.5891400Z tool: /usr/local/bin/git
2021-01-14T13:24:30.8191270Z  4b222f8d2653603b74fa5086cf0b02a1963d3911 3rdparty/vcpkg (2020.04-1517-g4b222f8d2)
2021-01-14T13:24:30.8416810Z 'vcpkg' is detected as a submodule, adding '.git' to the ignored entries in '.artifactignore' file (for excluding it from caching).
2021-01-14T13:24:30.8519980Z File '.artifactsignore' content: ''**/*', '!installed', '!/vcpkg', '!vcpkg.exe', '!vcpkgArtifactIgnoreEntries', '.git''
2021-01-14T13:24:30.8551750Z Is vcpkg repository updated? Yes
2021-01-14T13:24:30.8567430Z ##[endgroup]
2021-01-14T13:24:30.8579560Z ⏱ elapsed: 0.205 seconds
2021-01-14T13:24:30.8609520Z ##[group]Check whether last vcpkg's build is up to date with sources
2021-01-14T13:24:30.8642900Z Checking last vcpkg build commit id in file '/Users/runner/work/Mudlet/Mudlet/3rdparty/vcpkg/vcpkgLastBuiltCommitId' ...
2021-01-14T13:24:30.9128400Z vcpkg executable is up to date with sources.
2021-01-14T13:24:30.9230150Z ##[endgroup]
2021-01-14T13:24:30.9332730Z ⏱ elapsed: 0.002 seconds
2021-01-14T13:24:30.9434900Z ##[group]Check vcpkg executable exists
2021-01-14T13:24:30.9482030Z vcpkg executable exists at: '/Users/runner/work/Mudlet/Mudlet/3rdparty/vcpkg/vcpkg'.
2021-01-14T13:24:30.9483290Z ##[endgroup]
2021-01-14T13:24:30.9484600Z ⏱ elapsed: 0.052 seconds
2021-01-14T13:24:30.9485620Z ##[group]Install/Update ports
2021-01-14T13:24:30.9488620Z Running 'vcpkg remove --outdated --recurse --overlay-ports=../our-vcpkg-dependencies/lua' in directory '/Users/runner/work/Mudlet/Mudlet/3rdparty/vcpkg' ...
2021-01-14T13:24:30.9560620Z dyld: Symbol not found: ___emutls_v._ZSt11__once_call
2021-01-14T13:24:30.9565730Z   Referenced from: /Users/runner/work/Mudlet/Mudlet/3rdparty/vcpkg/vcpkg
2021-01-14T13:24:30.9568950Z   Expected in: /usr/local/opt/gcc/lib/gcc/10/libstdc++.6.dylib
2021-01-14T13:24:30.9571640Z  in /Users/runner/work/Mudlet/Mudlet/3rdparty/vcpkg/vcpkg
2021-01-14T13:24:30.9585570Z ##[error]Last command execution failed with error code 'null'.
2021-01-14T13:24:30.9601160Z ##[endgroup]
2021-01-14T13:24:30.9605260Z ⏱ elapsed: 0.090 seconds
2021-01-14T13:24:30.9606720Z Error: Last command execution failed with error code 'null'.

The PR does not touch any vcpkg-related code. Could the issue be that the Github environment has changed?

Action broke

https://github.com/Mudlet/Mudlet/pull/3974/checks?check_run_id=873502469

 Running 'vcpkg remove --outdated --recurse --overlay-ports=../our-vcpkg-dependencies/lua' in directory '/Users/runner/work/Mudlet/Mudlet/3rdparty/vcpkg' ...
  dyld: Symbol not found: __ZNKSt3_V214error_category10_M_messageB5cxx11Ei
    Referenced from: /Users/runner/work/Mudlet/Mudlet/3rdparty/vcpkg/vcpkg
    Expected in: /usr/lib/libstdc++.6.dylib
   in /Users/runner/work/Mudlet/Mudlet/3rdparty/vcpkg/vcpkg

Something seems to be wrong with cache?

New v5 warning: Error: spawn C:\windows\system32\cmd.exe ENOENT

We created a pull request (see DOCGroup/ACE_TAO#1279) to upgrade our run-vcpkg to v5 but now we get the warning ##[warning]Error: spawn C:\windows\system32\cmd.exe ENOENT

The full snippet of the log is below

2020-11-02T07:24:50.1382265Z [command]"C:\Program Files\Git\bin\git.exe" log -1 --format='%H'
2020-11-02T07:24:50.1579599Z 'eeb8cb8e7d47aa1d75b0d929f6877ab5e249ada6'
2020-11-02T07:24:50.1918203Z ##[group]Run lukka/run-vcpkg@v5
2020-11-02T07:24:50.1918579Z with:
2020-11-02T07:24:50.1919192Z   vcpkgGitCommitId: 56fffbe49dfb4dd8fae0940f272c5fd2b86be991
2020-11-02T07:24:50.1919971Z   vcpkgArguments: --recurse openssl xerces-c[xmlch-wchar]
2020-11-02T07:24:50.1920461Z   vcpkgTriplet: x64-windows
2020-11-02T07:24:50.1920869Z   appendedCacheKey: VS2017WChar
2020-11-02T07:24:50.1921251Z   setupOnly: false
2020-11-02T07:24:50.1921628Z   vcpkgDirectory: D:\a\ACE_TAO\ACE_TAO/vcpkg
2020-11-02T07:24:50.1922488Z   vcpkgArtifactIgnoreEntries: !.git
**/*
!installed
!/vcpkg
!vcpkg.exe
!vcpkgArtifactIgnoreEntries

2020-11-02T07:24:50.1923468Z   vcpkgGitURL: https://github.com/microsoft/vcpkg.git
2020-11-02T07:24:50.1923993Z   cleanAfterBuild: true
2020-11-02T07:24:50.1924382Z   doNotUpdateVcpkg: false
2020-11-02T07:24:50.1924703Z   useShell: true
2020-11-02T07:24:50.1924989Z   doNotCache: false
2020-11-02T07:24:50.1925247Z env:
2020-11-02T07:24:50.1925594Z   ACE_ROOT: D:\a\ACE_TAO\ACE_TAO/ACE
2020-11-02T07:24:50.1926028Z   TAO_ROOT: D:\a\ACE_TAO\ACE_TAO/TAO
2020-11-02T07:24:50.1926350Z   MPC_ROOT: D:\a\ACE_TAO\ACE_TAO/MPC
2020-11-02T07:24:50.1926688Z   VCPKG_ROOT: D:\a\ACE_TAO\ACE_TAO/vcpkg
2020-11-02T07:24:50.1927168Z   XERCESC_INCDIR: D:\a\ACE_TAO\ACE_TAO/vcpkg/installed/x64-windows/include
2020-11-02T07:24:50.1927762Z   XERCESC_LIBDIR: D:\a\ACE_TAO\ACE_TAO/vcpkg/installed/x64-windows/debug/lib
2020-11-02T07:24:50.1928345Z   SSL_INCDIR: D:\a\ACE_TAO\ACE_TAO/vcpkg/installed/x64-windows/include
2020-11-02T07:24:50.1928902Z   SSL_LIBDIR: D:\a\ACE_TAO\ACE_TAO/vcpkg/installed/x64-windows/debug/lib
2020-11-02T07:24:50.1929312Z ##[endgroup]
2020-11-02T07:24:50.3022207Z ##[group]Restore vcpkg and its artifacts from cache
2020-11-02T07:24:50.3444859Z tool: C:\Program Files\Git\bin\git.exe
2020-11-02T07:24:50.3448788Z Fetching the commit id at D:\a\ACE_TAO\ACE_TAO\vcpkg
2020-11-02T07:24:50.3529930Z ##[warning]Error: spawn C:\windows\system32\cmd.exe ENOENT
2020-11-02T07:24:50.3556062Z Cache's key = 'localGitId=-670594005-args=587385109-os=1553167195-appendedKey=1192715780-triplet=1258145250'.
2020-11-02T07:24:50.3556792Z Running restore-cache
2020-11-02T07:24:56.0214018Z Cache Size: ~224 MB (234506434 B)
2020-11-02T07:24:56.1227292Z [command]"C:\Program Files\Git\usr\bin\tar.exe" --use-compress-program "zstd -d" -xf D:/a/_temp/e0c3b77c-72f7-480c-be3e-319b4dbb6271/cache.tzst -P -C D:/a/ACE_TAO/ACE_TAO --force-local
2020-11-02T07:25:15.1644223Z Cache hit, id=localGitId=-670594005-args=587385109-os=1553167195-appendedKey=1192715780-triplet=1258145250.
2020-11-02T07:25:15.1656304Z ##[endgroup]
2020-11-02T07:25:15.1671825Z ⏱ elapsed: 24.855 seconds
2020-11-02T07:25:15.1673153Z ##[group]Set output env vars
2020-11-02T07:25:15.1673678Z Set task output variable 'RUNVCPKG_VCPKG_ROOT_OUT' to value: D:\a\ACE_TAO\ACE_TAO\vcpkg

Warnings in caching steps

First off, I love your actions. I just wanted to have said that :D

With the new GitHub Actions Summary window, warnings are more visible. We noticed we get two warnings during cached run-vcpkg runs on Windows only (Mac doesn't have this issue, it seems).

  1. Warning: restoreCache() failed once: 'Error: Tar failed with error: The process 'C:\windows\System32\tar.exe' failed with exit code 1' , retrying...
    Caused by:
  c:/vcpkg/.git/objects/pack/pack-7330effa4c511288dc38e7d7971f203d2a4a3a23.idx: Can't unlink already-existing object
  c:/vcpkg/.git/objects/pack/pack-7330effa4c511288dc38e7d7971f203d2a4a3a23.pack: Can't unlink already-existing object

(and this error repeats a second time)

  1. Warning: reserveCache failed: Cache already exists. Scope: refs/heads/master, Key: submodGitId=0a457099416a843f442b6c2275b2ec57239b50d9-args=-2010035955-os=1553167195-appendedKey=42-triplet=867608379, Version: e596d9224b0d5487c49893de7ad8700f61714e1ba95b948df70e6f4d9d37eb16

Is there anything you could do to mute those warnings by any chance? :D

Cheers!

(see https://github.com/TrueBrain/OpenTTD/actions/runs/419062991 for an example of how this looks in the Summary)

Disable telemetry

Could you add an option to disable telemetry?
Maybe should be enabled by default? I don't think Microsoft needs statistics on vcpkg from GitHub Actions.

cannot find bootstrap-vcpkg.bat

I try to use run-vcpkg but I am not able to make it work. I get the error
'"D:\a\TOSR\TOSR\vcpkg\bootstrap-vcpkg.bat' is not recognized as an internal or external command,
operable program or batch file.
Probably I am missing something really simple, but I cannot figure it out.
The double quote in the beginning is suspicious.
This is my actions file

Manifest Mode and Recursive Submodules

Hello,

I wanted to try the new manifest mode cacheing but hit a problem. I recently changed the way I include vcpkg in my repos - it is now a submodule of a submodule. My repo structure now looks like:

root/
     cmake/ <- Submodule that includes my toolchains, which include vcpkg, and a few helper files
           vcpkg/ <- vcpkg submodule

which you can see for real here: https://github.com/spinicist/riesling/tree/tests. I ended up with this structure after discussing with some vcpkg engineers how best to include Address Sanitizer.

run-vcpkg fails to detect that vcpkg is a sub-module in this situation, and gives this error message:

run-vcpkg action execution failed: 'Error: 'vcpkgGitCommitId' input parameter must be provided when the specified vcpkg directory (/home/runner/work/riesling/riesling/cmake/vcpkg) is not a submodule.

However if I provide a vcpkg commit ID, I then get the following error:

Check whether vcpkg repository is up to date
45
  Checking whether vcpkg's repository is updated to commit id '1b5a98571e3e68080d665f20705fb10d8d3c97d4' ...
46
  tool: /usr/local/bin/git
47
  error: pathspec '/Users/runner/work/riesling/riesling/cmake/vcpkg' did not match any file(s) known to git
48
  Current commit id of vcpkg: '1b5a98571e3e68080d665f20705fb10d8d3c97d4'.
49
  Is vcpkg repository updated? No

Run logs in both situations can be found here: https://github.com/spinicist/riesling/actions/runs/449601569 and here: https://github.com/spinicist/riesling/runs/1619416104.

Is there a way run-vcpkg can be made aware of recursive submodules?

Tag in vcpkgCommitId

If I understand correctly, then vcpkgCommitId cannot contain a tag. But if you specify it, then I will get silently non-working cache. Workflow output with tag in vcpkgCommitId (the cache is unpacked but not used).

Caching not working

Thank you very much for your fantastic actions and sorry for my inability to understand them fully.
We are trying to use them in the yolo/Darknet project (feel free to add them to real world examples if you want, after they will be fixed...).
Unfortunately I am experiencing no cache at all for vcpkg artifacts. May I ask you what am I doing wrong?

https://github.com/AlexeyAB/darknet/blob/master/.github/workflows/ccpp.yml

Thank you very very much for your time

Cache always missing

It shows Cache miss first then says cache duplicate. Idk if I did anything wrong with my config.

2020-12-24T15:42:49.2079329Z ##[group]Run lukka/run-vcpkg@v6
2020-12-24T15:42:49.2079872Z with:
2020-12-24T15:42:49.2080397Z   vcpkgArguments: drogon nlohmann-json
2020-12-24T15:42:49.2080984Z   vcpkgTriplet: x64-linux
2020-12-24T15:42:49.2081617Z   vcpkgDirectory: /home/runner/work/CFSPP/b/vcpkg
2020-12-24T15:42:49.2082781Z   vcpkgGitCommitId: e01668e44db57a179fd5b0b668dea7c41621f689
2020-12-24T15:42:49.2083525Z   setupOnly: false
2020-12-24T15:42:49.2084541Z   vcpkgArtifactIgnoreEntries: !.git
**/*
!installed
!/vcpkg
!vcpkg.exe
!vcpkgArtifactIgnoreEntries

2020-12-24T15:42:49.2085767Z   vcpkgGitURL: https://github.com/microsoft/vcpkg.git
2020-12-24T15:42:49.2086476Z   cleanAfterBuild: true
2020-12-24T15:42:49.2087026Z   doNotUpdateVcpkg: false
2020-12-24T15:42:49.2087531Z   useShell: true
2020-12-24T15:42:49.2087962Z   doNotCache: false
2020-12-24T15:42:49.2088365Z env:
2020-12-24T15:42:49.2088752Z   BUILD_TYPE: Release
2020-12-24T15:42:49.2089418Z ##[endgroup]
2020-12-24T15:42:49.3009871Z tool: /usr/bin/git
2020-12-24T15:42:49.3012022Z Fetching the commit id at /home/runner/work/CFSPP/b/vcpkg
2020-12-24T15:42:49.3090376Z ##[group]Restore vcpkg and its artifacts from cache
2020-12-24T15:42:49.3113462Z tool: /usr/bin/git
2020-12-24T15:42:49.3114661Z Fetching the commit id at /home/runner/work/CFSPP/b/vcpkg
2020-12-24T15:42:49.3153192Z Cache's key = 'localGitId=1046141699-args=-1457923159-os=1524360844-appendedKey=42-triplet=-1490537861'.
2020-12-24T15:42:49.3155106Z Running restore-cache...
2020-12-24T15:42:49.3728586Z Cache miss.
2020-12-24T15:42:49.3730275Z ##[endgroup]
2020-12-24T15:42:49.3736375Z ⏱ elapsed: 0.064 seconds
2020-12-24T15:42:49.3740256Z ##[group]Set output env vars
2020-12-24T15:42:49.3749308Z Set the output variable 'RUNVCPKG_VCPKG_ROOT_OUT' to value: /home/runner/work/CFSPP/b/vcpkg
2020-12-24T15:42:49.3752616Z Set the environment variable 'RUNVCPKG_VCPKG_TRIPLET' to value: x64-linux
2020-12-24T15:42:49.3753882Z Set the output variable 'RUNVCPKG_VCPKG_TRIPLET_OUT' to value: x64-linux
2020-12-24T15:42:49.3755141Z ##[endgroup]
2020-12-24T15:42:49.3759701Z ⏱ elapsed: 0.001 seconds
2020-12-24T15:42:49.3786045Z tool: /usr/bin/git
2020-12-24T15:42:49.3787161Z Fetching the commit id at /home/runner/work/CFSPP/b/vcpkg
2020-12-24T15:42:49.3839284Z fatal: not a git repository (or any of the parent directories): .git
2020-12-24T15:42:49.3850420Z ##[group]Check whether vcpkg repository is up to date
2020-12-24T15:42:49.3851850Z Checking whether vcpkg's repository is updated to commit id '' ...
2020-12-24T15:42:49.3870989Z tool: /usr/bin/git
2020-12-24T15:42:49.4235922Z fatal: /home/runner/work/CFSPP/b/vcpkg: '/home/runner/work/CFSPP/b/vcpkg' is outside repository at '/home/runner/work/CFSPP/CFSPP'
2020-12-24T15:42:49.4257273Z Current commit id of vcpkg: ''.
2020-12-24T15:42:49.4257938Z Is vcpkg repository updated? No
2020-12-24T15:42:49.4258466Z ##[endgroup]
2020-12-24T15:42:49.4259132Z ⏱ elapsed: 0.040 seconds
2020-12-24T15:42:49.4259743Z ##[group]Download vcpkg source code repository
2020-12-24T15:42:49.4261048Z Cloning vcpkg in '/home/runner/work/CFSPP/b/vcpkg'...
2020-12-24T15:42:49.4308713Z tool: /usr/bin/git
2020-12-24T15:42:49.4433696Z Cloning into '.'...
2020-12-24T15:42:53.1706122Z Note: switching to 'e01668e44db57a179fd5b0b668dea7c41621f689'.
2020-12-24T15:42:53.1706870Z 
2020-12-24T15:42:53.1708139Z You are in 'detached HEAD' state. You can look around, make experimental
2020-12-24T15:42:53.1709213Z changes and commit them, and you can discard any commits you make in this
2020-12-24T15:42:53.1710183Z state without impacting any branches by switching back to a branch.
2020-12-24T15:42:53.1710646Z 
2020-12-24T15:42:53.1711286Z If you want to create a new branch to retain commits you create, you may
2020-12-24T15:42:53.1712820Z do so (now or later) by using -c with the switch command. Example:
2020-12-24T15:42:53.1713366Z 
2020-12-24T15:42:53.1714080Z   git switch -c <new-branch-name>
2020-12-24T15:42:53.1714759Z 
2020-12-24T15:42:53.1740881Z Or undo this operation with:
2020-12-24T15:42:53.1741630Z 
2020-12-24T15:42:53.1742512Z   git switch -
2020-12-24T15:42:53.1743443Z 
2020-12-24T15:42:53.1744682Z Turn off this advice by setting config variable advice.detachedHead to false
2020-12-24T15:42:53.1745312Z 
2020-12-24T15:42:53.1745901Z HEAD is now at e01668e44 [glbinding] Improve usage information (#15082)
2020-12-24T15:42:53.1748212Z Clone vcpkg in '/home/runner/work/CFSPP/b/vcpkg'.
2020-12-24T15:42:53.1748958Z ##[endgroup]
2020-12-24T15:42:53.1749777Z ⏱ elapsed: 3.747 seconds
2020-12-24T15:42:53.1750464Z ##[group]Build vcpkg
......
2020-12-24T15:57:33.6759859Z ⏱ elapsed: 715.379 seconds
2020-12-24T15:57:33.6760770Z ##[group]Prepare vcpkg generated file for caching
2020-12-24T15:57:33.6763880Z ##[endgroup]
2020-12-24T15:57:33.6764830Z ⏱ elapsed: 0.001 seconds
2020-12-24T15:57:33.6765674Z ##[group]Cache vcpkg and its artifacts
2020-12-24T15:57:33.6789811Z tool: /usr/bin/git
2020-12-24T15:57:33.6790799Z Fetching the commit id at /home/runner/work/CFSPP/b/vcpkg
2020-12-24T15:57:33.6841615Z e01668e44db57a179fd5b0b668dea7c41621f689
2020-12-24T15:57:33.6849438Z vcpkg identified at commitId='e01668e44db57a179fd5b0b668dea7c41621f689', adding it to the cache's key.
2020-12-24T15:57:33.6852240Z Caching paths: '/home/runner/work/CFSPP/b/vcpkg,!/home/runner/work/CFSPP/b/vcpkg/packages,!/home/runner/work/CFSPP/b/vcpkg/buildtrees,!/home/runner/work/CFSPP/b/vcpkg/downloads'
2020-12-24T15:57:33.6854276Z Running save-cache...
2020-12-24T15:57:33.7973132Z ##[warning]reserveCache failed: Cache already exists. Scope: refs/heads/master, Key: submodGitId=e01668e44db57a179fd5b0b668dea7c41621f689-args=-1457923159-os=1524360844-appendedKey=42-triplet=-1490537861, Version: 181b8bcdd0e5da289ad9e13fb5396f255ebe662e241459c93a36258eb5183758
2020-12-24T15:57:33.7998962Z ##[endgroup]
2020-12-24T15:57:33.7999947Z ⏱ elapsed: 0.119 seconds
2020-12-24T15:57:33.8000671Z run-vcpkg  action execution succeeded
2020-12-24T15:57:33.8001459Z run-vcpkg action execution succeeded

My config:

name: CMake

on: [push]

env:
  # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
  BUILD_TYPE: Release

jobs:
  job:
    name: ${{ matrix.os }}-build
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ ubuntu-20.04 ]
        include:
          - os: ubuntu-20.04
            triplet: x64-linux
            vcpkgCommitId: 'e01668e44db57a179fd5b0b668dea7c41621f689'
            vcpkgPackages: 'drogon nlohmann-json'

    steps:
    - uses: actions/checkout@v2
    - uses: lukka/[email protected]

    # Restore from cache the previously built ports. If cache-miss, download and build vcpkg (aka "bootstrap vcpkg").
    - name: Restore from cache and install vcpkg
      # Download and build vcpkg, without installing any port. If content is cached already, it is a no-op.
      uses: lukka/run-vcpkg@v6
      with:
        vcpkgArguments: '${{ matrix.vcpkgPackages }}'
        vcpkgTriplet: '${{ matrix.triplet }}'
        vcpkgDirectory: '${{ runner.workspace }}/b/vcpkg'
        vcpkgGitCommitId: '${{ matrix.vcpkgCommitId }}'

    - name: Create Build Environment
      # Some projects don't allow in-source building, so create a separate build directory
      # We'll use this as our working directory for all subsequent commands
      run: cmake -E make_directory ${{runner.workspace}}/build

    - name: Configure CMake
      # Use a bash shell so we can use the same syntax for environment variable
      # access regardless of the host operating system
      shell: bash
      working-directory: ${{runner.workspace}}/build
      # Note the current convention is to use the -S and -B options here to specify source 
      # and build directories, but this is only available with CMake 3.13 and higher.  
      # The CMake binaries on the Github Actions machines are (as of this writing) 3.12
      run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake

    - name: Link Drogon Binaries
      run: sudo ln -s ${{runner.workspace}}/b/vcpkg/packages/drogon_x64-linux/tools/drogon/drogon_ctl /usr/local/bin
      shell: bash

    - name: Build
      working-directory: ${{runner.workspace}}/build
      shell: bash
      # Execute the build.  You can specify a specific target with "--target <NAME>"
      run: cmake --build . --config $BUILD_TYPE

    - name: Upload Artifact
      uses: actions/upload-artifact@v2
      with:
        name: CFSPP-release
        path: ${{runner.workspace}}/build/CFS++

Retries for "premature close" error during cache restoration

I've noticed these messages appearing in the logs on a non-infrequent basis:

Warning: restoreCache() failed: 'Error [ERR_STREAM_PREMATURE_CLOSE]: Premature close'.
Cache miss.

Whenever this happens all my dependencies are rebuilt which for some projects can be expensive (~2 hours).

As far as I can tell this is a transient error caused by the vm being paused so it would be nice to have at least one retry for this error to avoid unnecessary dependency rebuilding.

vcpkg binary is always being rebuilt

The newly-added "check if binary works" check seems to always be failing, despite the binary being cached. Across macOS/Linux/Windows builds, the check is always returning 1 and the binary is already being rebuilt:

2021-02-22T07:00:13.3308338Z ##[group]Run lukka/run-vcpkg@v7
2021-02-22T07:00:13.3308848Z with:
2021-02-22T07:00:13.3309774Z   vcpkgArguments: @/home/runner/work/Mudlet/Mudlet/3rdparty/our-vcpkg-dependencies/vcpkg-x64-linux-dependencies
2021-02-22T07:00:13.3310901Z   vcpkgDirectory: /home/runner/work/Mudlet/Mudlet/3rdparty/vcpkg
2021-02-22T07:00:13.3312164Z   appendedCacheKey: f180e0c15f8968099cfcd4e5d794450e7f752a92b056726ec61f8410bbe7402d-cachekey
2021-02-22T07:00:13.3313246Z   setupOnly: false
2021-02-22T07:00:13.3314194Z   vcpkgArtifactIgnoreEntries: !.git
**/*
!installed
!/vcpkg
!vcpkg.exe
!vcpkgArtifactIgnoreEntries

2021-02-22T07:00:13.3315361Z   vcpkgGitURL: https://github.com/microsoft/vcpkg.git
2021-02-22T07:00:13.3316043Z   cleanAfterBuild: true
2021-02-22T07:00:13.3316565Z   doNotUpdateVcpkg: false
2021-02-22T07:00:13.3317045Z   useShell: true
2021-02-22T07:00:13.3317469Z   doNotCache: false
2021-02-22T07:00:13.3317923Z env:
2021-02-22T07:00:13.3318428Z   BOOST_ROOT: /home/runner/work/Mudlet/Mudlet/3rdparty/boost
2021-02-22T07:00:13.3319211Z   BOOST_URL: https://sourceforge.net/projects/boost/files/boost/1.72.0/boost_1_72_0.tar.bz2/download
2021-02-22T07:00:13.3320207Z   pythonLocation: /opt/hostedtoolcache/Python/3.9.1/x64
2021-02-22T07:00:13.3321049Z   LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.9.1/x64/lib:/home/runner/work/Mudlet/Qt/5.14.1/gcc_64/lib
2021-02-22T07:00:13.3321889Z   PKG_CONFIG_PATH: /home/runner/work/Mudlet/Qt/5.14.1/gcc_64/lib/pkgconfig
2021-02-22T07:00:13.3322537Z   Qt5_Dir: /home/runner/work/Mudlet/Qt/5.14.1/gcc_64
2021-02-22T07:00:13.3323083Z   Qt5_DIR: /home/runner/work/Mudlet/Qt/5.14.1/gcc_64
2021-02-22T07:00:13.3323702Z   QT_PLUGIN_PATH: /home/runner/work/Mudlet/Qt/5.14.1/gcc_64/plugins
2021-02-22T07:00:13.3324369Z   QML2_IMPORT_PATH: /home/runner/work/Mudlet/Qt/5.14.1/gcc_64/qml
2021-02-22T07:00:13.3325461Z   vcpkgResponseFile: /home/runner/work/Mudlet/Mudlet/3rdparty/our-vcpkg-dependencies/vcpkg-x64-linux-dependencies
2021-02-22T07:00:13.3326440Z ##[endgroup]
2021-02-22T07:00:13.4244698Z vcpkg identified at commitId='4b222f8d2653603b74fa5086cf0b02a1963d3911', adding it to the cache's key.
2021-02-22T07:00:13.4247022Z Cache's key = 'submodGitId=4b222f8d2653603b74fa5086cf0b02a1963d3911-args=-1400687354-os=-2073516187-imageVer=-2108618863-appendedKey=935998087'.
2021-02-22T07:00:13.4248261Z ##[group]Restore vcpkg and its artifacts from cache
2021-02-22T07:00:13.4253688Z Cache's key = 'submodGitId=4b222f8d2653603b74fa5086cf0b02a1963d3911-args=-1400687354-os=-2073516187-imageVer=-2108618863-appendedKey=935998087', paths = '/home/runner/work/Mudlet/Mudlet/3rdparty/vcpkg,!/home/runner/work/Mudlet/Mudlet/3rdparty/vcpkg/packages,!/home/runner/work/Mudlet/Mudlet/3rdparty/vcpkg/buildtrees,!/home/runner/work/Mudlet/Mudlet/3rdparty/vcpkg/downloads'
2021-02-22T07:00:13.4255957Z Running restore-cache...
2021-02-22T07:00:14.1419393Z Cache Size: ~52 MB (54875019 B)
2021-02-22T07:00:14.1448024Z [command]/usr/bin/tar --use-compress-program zstd -d -xf /home/runner/work/_temp/d688779c-7b7f-4dd3-9d84-638e52f9df88/cache.tzst -P -C /home/runner/work/Mudlet/Mudlet
2021-02-22T07:00:15.5037748Z Cache hit, id=submodGitId=4b222f8d2653603b74fa5086cf0b02a1963d3911-args=-1400687354-os=-2073516187-imageVer=-2108618863-appendedKey=935998087.
2021-02-22T07:00:15.5041263Z ##[endgroup]
2021-02-22T07:00:15.5042002Z ⏱ elapsed: 2.076 seconds
2021-02-22T07:00:15.5045212Z ##[group]Set output env vars
2021-02-22T07:00:15.5046887Z Set the output variable 'RUNVCPKG_VCPKG_ROOT_OUT' to value: /home/runner/work/Mudlet/Mudlet/3rdparty/vcpkg
2021-02-22T07:00:15.5049453Z Set the environment variable 'RUNVCPKG_VCPKG_TRIPLET' to value: 
2021-02-22T07:00:15.5050445Z Set the output variable 'RUNVCPKG_VCPKG_TRIPLET_OUT' to value: 
2021-02-22T07:00:15.5051123Z ##[endgroup]
2021-02-22T07:00:15.5051764Z ⏱ elapsed: 0.001 seconds
2021-02-22T07:00:15.5178920Z tool: /usr/bin/git
2021-02-22T07:00:15.5180443Z Fetching the Git commit id at '/home/runner/work/Mudlet/Mudlet/3rdparty/vcpkg' ...
2021-02-22T07:00:15.5244477Z 4b222f8d2653603b74fa5086cf0b02a1963d3911
2021-02-22T07:00:15.5246870Z ##[group]Check whether vcpkg repository is up to date
2021-02-22T07:00:15.5248099Z Checking whether vcpkg's repository is updated to commit id '4b222f8d2653603b74fa5086cf0b02a1963d3911' ...
2021-02-22T07:00:15.5263084Z tool: /usr/bin/git
2021-02-22T07:00:15.6383099Z  4b222f8d2653603b74fa5086cf0b02a1963d3911 3rdparty/vcpkg (2020.04-1517-g4b222f8d2)
2021-02-22T07:00:15.6511901Z 'vcpkg' is detected as a submodule, adding '.git' to the ignored entries in '.artifactignore' file (for excluding it from caching).
2021-02-22T07:00:15.6513900Z File '.artifactsignore' content: ''**/*', '!installed', '!/vcpkg', '!vcpkg.exe', '!vcpkgArtifactIgnoreEntries', '.git''
2021-02-22T07:00:15.6515118Z Is vcpkg repository updated? Yes
2021-02-22T07:00:15.6516157Z ##[endgroup]
2021-02-22T07:00:15.6517028Z ⏱ elapsed: 0.116 seconds
2021-02-22T07:00:15.6518191Z ##[group]Check whether last vcpkg's build is up to date with sources
2021-02-22T07:00:15.6519665Z Checking last vcpkg build commit id in file '/home/runner/work/Mudlet/Mudlet/3rdparty/vcpkg/vcpkgLastBuiltCommitId' ...
2021-02-22T07:00:15.6521604Z vcpkg executable is up to date with sources.
2021-02-22T07:00:15.6522732Z ##[endgroup]
2021-02-22T07:00:15.6523773Z ⏱ elapsed: 0.006 seconds
2021-02-22T07:00:15.6524438Z ##[group]Check vcpkg executable exists
2021-02-22T07:00:15.6541324Z vcpkg executable exists at: '/home/runner/work/Mudlet/Mudlet/3rdparty/vcpkg/vcpkg'.
2021-02-22T07:00:16.6753354Z vcpkg executable returned code 1, forcing a rebuild.
2021-02-22T07:00:16.6754910Z ##[endgroup]
2021-02-22T07:00:16.6756353Z ⏱ elapsed: 1.029 seconds
2021-02-22T07:00:16.6757470Z ##[group]Build vcpkg
2021-02-22T07:00:16.6778738Z tool: /usr/bin/sh
2021-02-22T07:00:19.9989669Z -- The CXX compiler identification is GNU 10.2.0

Confusing submodule / manifest instructions

It is highly recommended to either use vcpkg as a submodule and to use vcpkg.json to declaratively specify the dependencies.

Does it mean It is highly recommended to either use vcpkg as a submodule OR to use vcpkg.json to declaratively specify the dependencies., or It is highly recommended to use vcpkg as a submodule and to use vcpkg.json to declaratively specify the dependencies. ?

Action not correctly caching dependencies when using triplet-overlay

I'm using run-vcpkg to build a library that I need to link statically to libprotobuf (but with DYNAMIC_CRT), so I need to use an overlay to get the right version.

This however seems to trip the caching. Even after consecutive successful runs the Windows job does a full rebuild of all the packages, while the Linux job (which doesn't use an overlay) is correctly retrieving them.

On the Post Restore from cache and install vcpkg step I'm seeing this:

Post job cleanup.
Save vcpkg and its artifacts to cache
  Cache hit occurred on the cache key 'localGitId=-574880384-args=42-os=1553167195-appendedKey=411780070-triplet=1258145250', saving cache is skipped.

Running VCPKG locally correctly detects the package, that's why I assume is something in the Action.

Thanks in advance for any pointers.

dist/index.js not rebuilt after @actions/core update

Similar to hecrj/setup-rust-action#23, @actions/core was updated in #42 but using this action still causes deprecation warnings (documented in the linked issue). I tried to npm install to npm run build but:

npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@lukka%2frun-vcpkg-lib - Not found
npm ERR! 404
npm ERR! 404  '@lukka/[email protected]' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 It was specified as a dependency of 'run-vcpkg'

Any way to only cache the vcpkg executable and tools?

Hello, thank you for this great action!

I have maybe a weird request: Is there any way to cache only the vcpkg executable and tools that are downloaded (or to put another way: exclude the build artifacts of the libraries)?

I'm working on some projects that have dependencies on some very large projects, like LLVM, and the cache grows well beyond GitHub Actions' allowable 5GB limit.

As an alternative, I'm exploring the NuGet binarycaching that will hopefully be able to pull the pre-built libraries that are compatible (read: matching hashes) with the build environment and vcpkg checkout to workaround these limits (... I still need to test if there are NuGet upload size limits). It would be nice to take advantage of the GitHub Action caches for vcpkg binary and the tools (ninja, cmake, etc.) that are downloaded though.

Related: I can't seem to find where the vcpkgArtifactIgnoreEntries key is used in the implementation of this action. It looks like the artifact entries are hardcoded here. Am I missing something?

const pathsToCache: string[] = [
vcpkgDir,
path.normalize(`!${path.join(vcpkgDir, 'packages')}`),
path.normalize(`!${path.join(vcpkgDir, 'buildtrees')}`),
path.normalize(`!${path.join(vcpkgDir, 'downloads')}`)
];

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.