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

[bug] abseil/20230802.1: link failure #25071

Closed
gouriano opened this issue Aug 28, 2024 · 6 comments
Closed

[bug] abseil/20230802.1: link failure #25071

gouriano opened this issue Aug 28, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@gouriano
Copy link
Contributor

Description

I have a problem linking against gRPC, but the real problem seems to be abseil package

Package and Environment Details

Linux
cmake 3.21.2
conan 2.6.0

Conan profile

Host profile:
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=13
os=Linux
[conf]

Build profile:
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=13
os=Linux
[conf]

Steps to reproduce

Take test_package.cpp source file from abseil recipe
https://github.com/conan-io/conan-center-index/blob/master/recipes/abseil/all/test_package/test_package.cpp

Create CMakeLists.txt

cmake_minimum_required(VERSION 3.15)
project(test_package LANGUAGES CXX)
find_package(absl REQUIRED)
add_executable(test test_package.cpp)
target_link_libraries(test abseil::abseil)

and create the following conanfile.txt:

[requires]
grpc/1.50.1
[options]
abseil*:shared=True
grpc*:shared=True
protobuf*:shared=True
[generators]
CMakeDeps
[layout]
cmake_layout

Yes, require grpc (which requires abseil, as we know)
Now run

conan install . --build missing -s build_type=Release

and look at build/Release/generators/absl-release-x86_64-data.cmake
we see:
set(abseil_LIBS_RELEASE )
The list is empty.

Now delete build directory, add abseil into conanfile.txt, and do "conan install" again

[requires]
abseil/20230802.1
grpc/1.50.1
[options]
abseil*:shared=True
grpc*:shared=True
protobuf*:shared=True
[generators]
CMakeDeps
[layout]
cmake_layout

Now in absl-release-x86_64-data.cmake we see

set(abseil_LIBS_RELEASE absl_flags_parse absl_log_flags .. and the long list of libraries)

Is this behavior by design, or is it a bug?

My point here is that I do not know what is abseil and I do not care.
What I need is grpc. I request grpc, I "find_package(gRPC)", and then linking fails because abseil libraries are missing
So, let me repeat my question.

Is this behavior by design, or is it a bug?

Logs

without requires/abseil/20230802.1:
lots of
test_package.cpp:(.text.startup+0x365): undefined reference to ...

with requires/abseil/20230802.1:
build is ok

@gouriano gouriano added the bug Something isn't working label Aug 28, 2024
@gouriano gouriano changed the title [package] abseil/20230802.1: link failure [bug] abseil/20230802.1: link failure Aug 28, 2024
@gouriano
Copy link
Contributor Author

gouriano commented Aug 28, 2024

The same story is with protobuf.
If it is absent in the list of requires, protobuf_LIBS_RELEASE list in protobuf-release-x86_64-data.cmake file is empty.
If present, protobuf_LIBS_RELEASE list is not empty.
It is so in "shared" mode only. in "shared=False", everything works as expected - LIBS_RELEASE lists are never empty

@SpaceIm
Copy link
Contributor

SpaceIm commented Aug 29, 2024

https://github.com/conan-io/conan/issues would be a better place for this question, conan-center is not responsible of the design of files generated by CMakeDeps generator depending on shared option of dependencies.

Your issue might be related to conan-io/conan#13560, but I can't say for sure since you didn't share full log.

@gouriano
Copy link
Contributor Author

Can you move it into conan/issues, or should I resubmit?

@SpaceIm
Copy link
Contributor

SpaceIm commented Aug 29, 2024

I'm not part of conan team, I can't move issues.

@gouriano
Copy link
Contributor Author

resubmitted
conan-io/conan#16911

@memsharded
Copy link
Member

Closing as duplicated, lets follow up better in the Conan repo ticket

@memsharded memsharded closed this as not planned Won't fix, can't repro, duplicate, stale Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants