Coder Social home page Coder Social logo

integrate install about run-vcpkg HOT 14 CLOSED

lukka avatar lukka commented on June 4, 2024
integrate install

from run-vcpkg.

Comments (14)

lukka avatar lukka commented on June 4, 2024

@jmoguillansky-gpsw run-vcpkg does not run the command vcpkg integrate install. Please elaborate what is the use case in order to grab the requirements.
Currently you can run vcpkg integrate install in a run step if it is needed.

from run-vcpkg.

jmoguillansky-gpsw avatar jmoguillansky-gpsw commented on June 4, 2024

Thanks @lukka for the quick response. For now I'll just run vcpkg integrate install manually. Currently we use that command as part of the build. This command adds the includes/libs to global visual studio configuration.

from run-vcpkg.

lukka avatar lukka commented on June 4, 2024

@jmoguillansky-gpsw ok, it would be helpful to take a look to what the actual workflow is, if publicly available.
For a CMake based project, providing the toolchain file suffices, and only for MSBuild based projects the integrate install command may be a requirement.

from run-vcpkg.

jmoguillansky-gpsw avatar jmoguillansky-gpsw commented on June 4, 2024

Hi @lukka I'm currently trying to integrate run-vcpkg into the project, it would be very helpful to have vcpkg caching mechanism.
Here's a link to the github action run:
https://github.com/gopro/gopro-lib-node.gl/runs/1560926321?check_suite_focus=true

and here's the code snippet:

- name: Restore from cache and install vcpkg
    uses: lukka/run-vcpkg@v6
    with:
      vcpkgGitCommitId: 595777db2332a3442b73f9af9f656355f207aec9
      vcpkgTriplet: x64-windows
      vcpkgArguments: pthreads opengl-registry ffmpeg[ffmpeg] sdl2
      cleanAfterBuild: false

  - name: vcpkg integrate install
    run: |
      cd vcpkg && ./vcpkg.exe integrate install

Thanks for the help!

from run-vcpkg.

lukka avatar lukka commented on June 4, 2024

@jmoguillansky-gpsw To me it looks like the vcpkg integrate install command is not needed for your workflow. The command would only help for MSBuild based projects, as it places a couple of .props/.targets MSBuild files that are then consumed by MSBuild, which you are not using.

I see your Makefile uses VCPKG_DIR: I would suggest instead to use the existing VCPKG_ROOT env var instead.

Please take a look at the vcpkg best practices, I'd suggest you to use a vcpkg.json manifest file if you use a recent commit id of vcpkg repository.

from run-vcpkg.

jmoguillansky-gpsw avatar jmoguillansky-gpsw commented on June 4, 2024

Thanks @lukka for the support ,
I can't get the caching mechanism working?

I made a test script:
Here's the code:

 name: 'tests Windows'

 on:
push:
  branches:
    - 'master'
 pull_request:
 workflow_dispatch:

 jobs:
   win-msvc:

 runs-on: windows-latest

 steps:
  - name: Install dependencies via vcpkg
    uses: lukka/run-vcpkg@v6
    with:
      vcpkgGitCommitId: 595777db2332a3442b73f9af9f656355f207aec9
      vcpkgTriplet: x64-windows
      vcpkgArguments: pthreads sdl2

  - name: vcpkg integrate install
    shell: cmd
    run: |
      cd vcpkg && vcpkg.exe integrate install

and the log:

Run 1:
2020-12-17T01:22:18.7755391Z ##[group]Cache vcpkg and its artifacts
2020-12-17T01:22:18.8010325Z tool: C:\Program Files\Git\bin\git.exe
2020-12-17T01:22:18.8011384Z Fetching the commit id at D:\a\gopro-pkg\gopro-pkg\vcpkg
2020-12-17T01:22:18.8277130Z 595777db2332a3442b73f9af9f656355f207aec9
2020-12-17T01:22:18.8325908Z vcpkg identified at commitId='595777db2332a3442b73f9af9f656355f207aec9', adding it to the cache's key.
2020-12-17T01:22:18.8330479Z Caching paths: 'D:\a\gopro-pkg\gopro-pkg\vcpkg,!D:\a\gopro-pkg\gopro-pkg\vcpkg\packages,!D:\a\gopro-pkg\gopro-pkg\vcpkg\buildtrees,!D:\a\gopro-pkg\gopro-pkg\vcpkg\downloads'
2020-12-17T01:22:18.8331628Z Running save-cache...
2020-12-17T01:22:19.0462564Z ##[warning]reserveCache failed: Cache already exists. Scope: refs/heads/master, Key: submodGitId=595777db2332a3442b73f9af9f656355f207aec9-args=-921422610-os=1553167195-appendedKey=42-triplet=1258145250, Version: 08941d5f3e94c016a7135b24720cc07ea555ab0edb184a7c0b255970ce334563
2020-12-17T01:22:19.0480475Z ##[endgroup]
2020-12-17T01:22:19.0481545Z :stopwatch: elapsed: 0.270 seconds
2020-12-17T01:22:19.0482433Z run-vcpkg action execution succeeded
2020-12-17T01:22:19.0483082Z run-vcpkg action execution succeeded

Run 2:
2020-12-17T01:18:49.7208423Z ##[group]Restore vcpkg and its artifacts from cache
2020-12-17T01:18:49.7209233Z tool: C:\Program Files\Git\bin\git.exe
2020-12-17T01:18:49.7210135Z Fetching the commit id at D:\a\gopro-pkg\gopro-pkg\vcpkg
2020-12-17T01:18:49.7214138Z Cache's key = 'localGitId=91193352-args=-921422610-os=1553167195-appendedKey=42-triplet=1258145250'.
2020-12-17T01:18:49.7215514Z Running restore-cache...
2020-12-17T01:18:50.1744817Z Cache miss.
2020-12-17T01:18:50.1750088Z ##[endgroup]

Please advise, is there something I'm doing wrong?

from run-vcpkg.

lukka avatar lukka commented on June 4, 2024

@jmoguillansky-gpsw in Run1 the cache id is different than in Run2. Looks like in Run1 the vcpkg directory is a submodule, but in Run2 it is not.

Could you provide the links to Run1 and Run2?

from run-vcpkg.

lukka avatar lukka commented on June 4, 2024

@jmoguillansky-gpsw
Using lukka/run-vcpkg@v6 add in your workflow a value for additionalCachedPaths as shown in the quickstart documentation.
The problem you described should be fixed, please report it back.

from run-vcpkg.

jmoguillansky-gpsw avatar jmoguillansky-gpsw commented on June 4, 2024

Hi @lukka ,
Latest vcpkg supports binary caching (as you probably know).
It would be great if run-vcpkg action automatically cached the artifacts folder by default, and simplified the configuration required from the user
(e.g. by default its under C:\Users<username>\AppData\Local\vcpkg\archives), and it can be customized with "VCPKG_BINARY_SOURCES" env variable (see https://devblogs.microsoft.com/cppblog/vcpkg-accelerate-your-team-development-environment-with-binary-caching-and-manifests/).

from run-vcpkg.

jmoguillansky-gpsw avatar jmoguillansky-gpsw commented on June 4, 2024

Hi @lukka , now everything seemed to work.
Not sure why it got errors previously.
Thanks!

from run-vcpkg.

lukka avatar lukka commented on June 4, 2024

@jmoguillansky-gpsw I like the suggestion to minimize the amount of inputs the action requires, I am absolutely pro to remove unneeded input and to ease the user experience.
Regarding binary caching:

  • there is no way to determine exactly what is the directory that vcpkg has used to put the artifacts. It can be any of the ones specified in the Configuration paragraph. Unfortunately, vcpkg does not tell which one was used.
  • my thinking is that caching the content of CMAKE_BUILD_DIR/vcpkg_installed or $VCPKG_ROOT/installed is a better choice: #54 (comment)

Let me know if there is anything that can be done to improve the user experience, thanks!

from run-vcpkg.

jmoguillansky-gpsw avatar jmoguillansky-gpsw commented on June 4, 2024

from run-vcpkg.

lukka avatar lukka commented on June 4, 2024

@jmoguillansky-gpsw I'd be happy to see more elaborated design on how the input of the action could be reworked in order to deal with VCPKG_BINARY_SOURCES?

from run-vcpkg.

lukka avatar lukka commented on June 4, 2024

Feel free to report any problem you may experience!

from run-vcpkg.

Related Issues (20)

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.