run-vcpkg: VCPKG failing to build library
I hope this is the right place. I don’t have any issues using vcpkg + cmake on any of my desktops (win + linux) but with run-vcpkg
action, I am getting the following issue:
Running 'vcpkg install,--recurse,--clean-after-build,--x-install-root,/home/runner/work/Client/Client/vcpkg/installed,--triplet,x64-linux' in directory '/home/runner/work/Client/Client' ...
Running command '/home/runner/work/Client/Client/vcpkg/vcpkg' with args 'install,--recurse,--clean-after-build,--x-install-root,/home/runner/work/Client/Client/vcpkg/installed,--triplet,x64-linux' in current directory '/home/runner/work/Client/Client'.
Error: discord-game-sdk:x64-linux@2.5.6#4 is only supported on '((x64 & (windows | osx | linux)) | (x86 & windows)) & !uwp & !static'
As you can see, the tuple is correctly selecting x64-linux
for this library. I can build on archlinux and ubuntu just fine manually but not on github with this action module.
Here’s my vcpkg.json
file:
{
"name": "my-client",
"version-string": "1.0.0",
"dependencies": [
{
"name": "pthreads",
"version>=": "3.0.0#10"
},
{
"name": "poco",
"version>=": "1.11.1"
},
{
"name": "openssl",
"version>=": "1.1.1n#1"
},
{
"name": "fluidsynth",
"version>=": "2.2.6"
},
{
"name": "lua",
"version>=": "5.4.4#1"
},
{
"name": "discord-game-sdk",
"version>=": "2.5.6#4"
}
],
"builtin-baseline": "91dd61bd441a68b4017b61011d0350b2e6aeeccf"
}
And here’s the run step where I include the action:
- name: run-vcpkg
# You may pin to the exact commit or the version.
# uses: lukka/run-vcpkg@97a66cd144358612fab189bf2836619f392ef083
uses: lukka/run-vcpkg@v10.7
with:
vcpkgDirectory: ${{ github.workspace }}/vcpkg
# Run the installation of package by running `vcpkg install` on the directory of the discovered 'vcpkg.json' file. Default is false.
runVcpkgInstall: true
vcpkgGitCommitId: 91dd61bd441a68b4017b61011d0350b2e6aeeccf
# Specify the URL Git repository to download vcpkg from
vcpkgGitURL: https://github.com/microsoft/vcpkg.git
# Avoid to update vcpkg (launching git) in the specified 'vcpkgDirectory'. This is useful when vcpkg is being checkout independently of the run-vcpkg action. Default is false.
# doNotUpdateVcpkg: # optional
# Disable the automatic caching mechanism by setting it to true. Default is false.
# doNotCache: # optional
# Specify the glob expression used to discover the vcpkg.json whose content's hash is added to the cache key. On Windows runners using `github.workspace` context to form the expression would not work as expected since it contains backslashes. Use instead `**/path/to/vcpkg.json` to match the desired `vcpkg.json` file.
vcpkgJsonGlob: '**/vcpkg.json'
Is there an explicit “dynamic/static” setting I was supposed to provide somewhere? It seems odd that the tuple is matching the reported constraints and I can build fine with the same vcpkg on all my machines.
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 17 (4 by maintainers)
I’m also trying to understand what the correct way to achieve this. Unless I misunderstood, it should be done through expressions, but it is not working.
Have a look at the quick start code of this repo (in the README). At the end it shows how to change the triplet used.
That is absolutely horrific. Thanks for the link. I was expecting a vpkg optional switch flag or something. Is there no other alternative?
I don’t see it: https://github.com/lukka/CppCMakeVcpkgTemplate/blob/main/vcpkg.json
I checked the rest of the README and at the bottom it shows the triplet matrix – which IIRC is used for all packages on a per platform-basis.
I don’t need to change the triplet for all of my packages, just one package specifically to use the
-static
variant when on Ubuntu. And I don’t want all of my packages to be static either.Haha yes I mean dynamic. 😃