【问题标题】:Cmake and PugiXML in Github ActionsGithub Actions 中的 Cmake 和 PugiXML
【发布时间】:2021-10-11 23:35:27
【问题描述】:

我尝试让 pugixml 在 github 操作中运行。我会对任何有效的解决方案感到满意...

我将下载添加到 cmake.yml

      run: sudo apt-get update && sudo apt-get install libsystemd-dev libpugixml-dev

Ubuntu 内部 github 操作正在安装 1.10-1:

Get:1 http://azure.archive.ubuntu.com/ubuntu focal/universe amd64 libpugixml1v5 amd64 1.10-1 [89.9 kB]
Get:2 http://azure.archive.ubuntu.com/ubuntu focal/universe amd64 libpugixml-dev amd64 1.10-1 [105 kB]
Get:3 http://azure.archive.ubuntu.com/ubuntu focal-updates/main amd64 libsystemd-dev amd64 245.4-4ubuntu3.11 [246 kB]

在我的私人机器上,我使用 Debian 测试,其中安装了版本:1.11.4-1 的 pugixml。

CMake 现在告诉它找不到 1.10 或更高版本。看起来 ubuntu 的版本标签不正确(?)。有没有办法在这些 github-actions 中进行调试?

CMake Deprecation Warning at plog/CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Checking for module 'libsystemd'
--   Found libsystemd, version 245
CMake Error at CMakeLists.txt:20 (find_package):
  Could not find a configuration file for package "pugixml" that is
-- Configuring incomplete, errors occurred!
  compatible with requested version "1.10".
See also "/home/runner/work/sdbus_for_dummies/sdbus_for_dummies/build/CMakeFiles/CMakeOutput.log".

See also "/home/runner/work/sdbus_for_dummies/sdbus_for_dummies/build/CMakeFiles/CMakeError.log".
  The following configuration files were considered but not accepted:

    /usr/lib/x86_64-linux-gnu/cmake/pugixml/pugixml-config.cmake, version: unknown
    /lib/x86_64-linux-gnu/cmake/pugixml/pugixml-config.cmake, version: unknown

【问题讨论】:

  • 尝试在包packages.ubuntu.com/hirsute/libpugixml1v5下安装。而不是安装libpugixml-dev,请尝试安装libpugixml1v5
  • 感谢您的建议,但此软件包已安装:获取:1 azure.archive.ubuntu.com/ubuntufocus/universe amd64 libpugixml1v5 amd64 1.10-1 [89.9 kB] 获取:2 azure.archive.ubuntu.com/ubuntufocus/universe amd64 libpugixml-dev amd64 1.10-1 [105 kB] 获取:3 azure.archive.ubuntu.com/ubuntufocus-updates/main amd64 libsystemd-dev amd64 245.4-4ubuntu3.11 [246 kB]
  • 所以当您安装libpugixml-dev 时,它会安装带有版本1.10-1libpugixml1v5。但是当你安装libpugixml1v5它应该安装版本1.11.4-1
  • 我试过了,它仍然是 1.10-1。我可以在 github 操作中使用更新的 ubuntu 版本吗?
  • 你可以尝试从link下载.Deb包并安装它

标签: c++ ubuntu cmake github-actions pugixml


【解决方案1】:

我通过使用 vcpkg 安装 pugixml 解决了这个问题:

    - name: Install pugixml via vcpkg
      run: sudo vcpkg install pugixml && sudo vcpkg integrate install
  
    - name: Configure CMake
      # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
      # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
      run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_TOOLCHAIN_FILE=/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake
    - name: Build
      # Build your program with the given configuration
      run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-11-05
    • 2020-01-14
    • 2022-10-05
    • 2019-09-21
    • 2020-07-11
    • 2020-05-30
    • 2021-08-30
    • 2020-04-15
    相关资源
    最近更新 更多