Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

安装版本大于20230802.1的abseil失败 #4469

Closed
junity233 opened this issue Jun 25, 2024 · 5 comments · Fixed by #4664
Closed

安装版本大于20230802.1的abseil失败 #4469

junity233 opened this issue Jun 25, 2024 · 5 comments · Fixed by #4664
Labels

Comments

@junity233
Copy link

Xmake 版本

v2.9.2+master.a298a7d88

操作系统版本和架构

Windows 11 家庭中文版 22H2 22621.3737

描述问题

安装abseil>时,cmake报错:

CMake Error at CMake/AbseilHelpers.cmake:317 (target_link_libraries):
  The link interface of target "test_allocator" contains:
    GTest::gmock
  but the target was not found.  Possible reasons include:
    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.
Call Stack (most recent call first):
  absl/container/CMakeLists.txt:206 (absl_cc_library)
CMake Warning:
  Manually-specified variables were not used by the project:
    CMAKE_BUILD_TYPE
    CMAKE_C_FLAGS_RELEASE
CMake Generate step failed.  Build files cannot be regenerated correctly.
HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
if you want to get more verbose errors, please see:
  -> C:\Users\Junity\AppData\Local\.xmake\cache\packages\2406\a\abseil\20240116.1\installdir.failed\logs\install.txt

C:\Users\Junity\AppData\Local.xmake\cache\packages\2406\a\abseil\20240116.1\installdir.failed\logs\install.txt内容如下:

CMake Error at CMake/AbseilHelpers.cmake:317 (target_link_libraries):
  The link interface of target "test_allocator" contains:

    GTest::gmock

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  absl/container/CMakeLists.txt:206 (absl_cc_library)


CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_BUILD_TYPE
    CMAKE_C_FLAGS_RELEASE


CMake Generate step failed.  Build files cannot be regenerated correctly.
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 - not found
-- Found Threads: TRUE
-- Configuring done (5.7s)
-- Generating done (1.0s)

abseil<=20230802.1可以正常安装

期待的结果

abseil被成功安装

工程配置

abseil由protobuf-cpp引入,配置如下:

add_requires("uwebsockets","easyloggingpp","nlohmann_json","argparse")

target("server")
    set_kind("binary")
    add_packages("uwebsockets","easyloggingpp","nlohmann_json","argparse","protobuf-cpp")
    add_rules("protobuf.cpp")
    add_files("src/*.cpp")
    add_files("$(projectdir)/protocol/*.proto")
    add_includedirs("include")
    add_includedirs("$(projectdir)/protocol")
    set_languages("cxx17")
    add_defines("VERSION=\"1.0\"")
    set_rundir("$(projectdir)/test")

附加信息和错误日志

似乎是abseil自身的问题,我尝试过直接拉取abseil并使用cmake构建,但同样失败。由于其它依赖abseil的库(如protobuf-cpp)默认使用最新版的abseil,这个问题可能会导致所有依赖abseil的库无法构建

@junity233 junity233 added the bug label Jun 25, 2024
@junity233
Copy link
Author

现在我的解决方案是修改abseil的xmake.lua,将新版本删去

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Title: Failed to install abseil with version greater than 20230802.1

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Now my solution is to modify abseil's xmake.lua and delete the new version

@waruqi
Copy link
Member

waruqi commented Jun 26, 2024

可以 add_requireconfs("protobuf-cpp.abseil", {version = "xxx", override = true}) 改写依赖版本

或者提个 pr 过来改进下包

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


You can rewrite the dependency version with add_requireconfs("protobuf-cpp.abseil", {version = "xxx", override = true})

@c8ef c8ef linked a pull request Jul 16, 2024 that will close this issue
c8ef pushed a commit that referenced this issue Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants