首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >在github操作中运行-vcpkg和run-cmake :系统无法找到仅在windows上指定的路径

在github操作中运行-vcpkg和run-cmake :系统无法找到仅在windows上指定的路径
EN

Stack Overflow用户
提问于 2021-08-09 18:20:45
回答 1查看 406关注 0票数 0

我尝试使用github操作与CMake和vcpkg进行新的设置。除了windows之外,所有的配置都可以正常工作。发生了一个奇怪的错误,我不确定为什么会发生,也不确定如何修复它:

代码语言:javascript
运行
复制
► Run lukka/run-cmake@v3
tool: D:\a\_temp\909795809\cmake-3.21.1-windows-x86_64\bin\cmake.exe
tool: D:\a\_temp\909795809\ninja.exe
► Setup environment variables for triplet 'x64-windows' using 'vcpkg env'
⏱ elapsed: 2.161 seconds
Error: get_directories_non_recursive(D:\a\kangaru\kangaru\vcpkg_installed\x64-windows\tools): The system cannot find the path specified.



    at CMakeUtils.<anonymous> (D:\a\_actions\lukka\run-cmake\v3\dist\index.js:4765:27)
    at Generator.next (<anonymous>)
    at fulfilled (D:\a\_actions\lukka\run-cmake\v3\dist\index.js:4717:58)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
Error: run-cmake action execution failed: 'Error: get_directories_non_recursive(D:\a\kangaru\kangaru\vcpkg_installed\x64-windows\tools): The system cannot find the path specified.

我的工作流文件如下:

代码语言:javascript
运行
复制
on: [push, pull_request]

jobs:
  build:
    env:
      buildDir: ${{ github.workspace }}/build
    name: ${{ matrix.os }}-hosted-basic
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
        include:
          - os: windows-latest
            triplet: x64-windows
            build-type: RelWithDebInfo
          - os: ubuntu-latest
            triplet: x64-linux
            build-type: RelWithDebInfo
          - os: macos-latest
            triplet: x64-osx
            build-type: RelWithDebInfo
            
    steps:
      - uses: actions/checkout@v2

      - name: get-cmake
        uses: lukka/get-cmake@v3.21.1

      - name: Run vcpkg
        uses: lukka/run-vcpkg@v6
        with:
          # Just install vcpkg for now, do not install any ports in this step yet.
          setupOnly: true
          # Location of the vcpkg as submodule of the repository.
          vcpkgDirectory: '${{ github.workspace }}/vcpkg'
          vcpkgGitCommitId: '57bd7102d9fd880daa1b0958692294c4a125f6d8'
          # Since the cache must be invalidated when content of the vcpkg.json file changes, let's
          # compute its hash and append this to the computed cache's key.
          appendedCacheKey: ${{ hashFiles( '**/vcpkg.json' ) }}
          vcpkgTriplet: ${{ matrix.triplet }}
          # Ensure the vcpkg artifacts are cached, they are generated in the 'CMAKE_BINARY_DIR/vcpkg_installed'.
          additionalCachedPaths: ${{ env.buildDir }}/vcpkg_installed
      - name: 'Run CMake with Ninja, install dependencies with vcpkg, build with CMake'
        uses: lukka/run-cmake@v3
        with:
          cmakeListsOrSettingsJson: CMakeListsTxtBasic
          cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt'
          useVcpkgToolchainFile: true
          cmakeAppendedArgs: '-GNinja -DKANGARU_TEST=ON'
          buildDirectory: ${{ env.buildDir }}

      - name: Test
        working-directory: ${{github.workspace}}/build
        # Execute tests defined by the CMake configuration.  
        # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
        run: ctest -C ${{env.build-type}}

我主要关注run-vcpkg quickstart guide

您可以查看live error here

EN

回答 1

Stack Overflow用户

发布于 2021-10-21 13:38:55

此问题已在此处报告,并已得到解决:https://github.com/microsoft/vcpkg/issues/19552

上下文:当run-cmake使用vcpkg工具链在Windows上启动CMake时,除非已经定义了CC/CXX环境变量,否则将通过运行vcpkg env --triplet <triplet>命令为MSVC工具集设置环境。

不幸的是,在他的commit之后,这个命令在vcpkg中被破坏了,当调用它时,它会失败,并显示您所报告的:

代码语言:javascript
运行
复制
Error: get_directories_non_recursive(D:\a\path\\vcpkg_installed\x64-windows\tools): 
The system cannot find the path specified.

使用vcpkg存储库Git提交比e52d3b24cb45d1e5c8a6eddcce1b12bf570608da更新的版本包含修复。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68716831

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档