lukka / run-vcpkg

The GitHub Action to setup vcpkg for your C++ based projects. Stores built ports using Binary Caching backed onto GH Cache.
MIT License
194 stars 26 forks source link

Overlay port not cached #10

Closed vadi2 closed 4 years ago

vadi2 commented 4 years ago

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.

lukka commented 4 years ago

@vadi2 you need to add another step actions/cache with this path: /Users/runner/runners/2.168.0/work/Mudlet/Mudlet/3rdparty/our-vcpkg-dependencies/lua

The 'run-vpkg' is supporting auto-caching only on the auto_cache branch (lukka/run-vcpkg@auto_cache), you might give it a try. I will release it pretty soon. p.s. i guess overlay's are not cached automatically...

vadi2 commented 4 years ago

Did you mean lukka/run-vcpkg@auto_cache ?

vadi2 commented 4 years ago

It did not seem to work, see this run which should have been cached since the previous run introduced the switch: https://github.com/vadi2/Mudlet/runs/578784654

vadi2 commented 4 years ago

Maybe that's what you meant by overlay ports not being cached :) so I'll go with another actions/cache call as you recommended.

lukka commented 4 years ago

released the auto-caching version of run-vcpkg! It caches the content of VCPKG_ROOT, so ensure overlay are stored under that directory, and let me know!

vadi2 commented 4 years ago

What is the VCPKG_ROOT variable? https://github.com/marketplace/actions/run-vcpkg doesn't explain it - and so my overlay port isn't getting cached: https://github.com/vadi2/Mudlet/runs/581900260?check_suite_focus=true

lukka commented 4 years ago

@vadi2 the VCPKG_ROOT environment variable contains the path to the instance of vcpkg, i.e. /Users/runner/runners/2.168.0/work/Mudlet/Mudlet/3rdparty/vcpkg. Looks like the overlays are created outside that directory, which is the only one cached by the action.

I see two options: 1- the action could identify the usage of overlays, and understand what the paths to the installed directory for the overlays are, and cache those directories as well; 2- if you just fork vcpkg in your own repository (you can use vcpkgGitURL input to specify your fork), you can add the ports you want and you would not have to deal with overlays at all;

I prefer the latter because it is self contained and you have full control of your dependencies. With overlays you still have control, but the dependencies are sparse across the vcpkg repository and your repository that contains the added ports.

vadi2 commented 4 years ago

I'd prefer the former, because I'm new to vcpkg and forking and maintaining our own repo is a bit too much - having had to create an overlay port is as much as I'd like to go.

lukka commented 4 years ago

@vadi2 you are welcome to review (and test in your workflow as well) the following PR that covers your scenario: https://github.com/lukka/run-vcpkg/pull/14

lukka commented 4 years ago

fixed in https://github.com/lukka/run-vcpkg/pull/14