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

[package] spdlog/[> 1.10]: Conflicting settings in conanfile prevent install fmt bundled #25292

Open
andreprat opened this issue Sep 17, 2024 · 2 comments
Assignees
Labels
question Further information is requested

Comments

@andreprat
Copy link

The settings from the conanfile.py seem to be contradicting and not enabling the install of the fmt bundled inside spdlog
Is this intended?

if not self.options.get_safe("use_std_fmt"):
fmt = self.dependencies["fmt"]
tc.variables["SPDLOG_FMT_EXTERNAL"] = not fmt.options.header_only
tc.variables["SPDLOG_FMT_EXTERNAL_HO"] = fmt.options.header_only

In spdlog package CMakeLists.txt:

https://github.com/gabime/spdlog/blob/7e635fca68d014934b4af8a1cf874f63989352b7/CMakeLists.txt#L320-L323

if(NOT SPDLOG_USE_STD_FORMAT AND NOT SPDLOG_FMT_EXTERNAL AND NOT SPDLOG_FMT_EXTERNAL_HO)
        install(DIRECTORY include/${PROJECT_NAME}/fmt/bundled/
                DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/fmt/bundled/")
    endif()
@Ahajha
Copy link
Contributor

Ahajha commented Sep 19, 2024

I would imagine this is intended, yes. For the sake of Conan, we want to always either use Conan's fmt, or std::format. Allowing use of the bundled fmt could cause problems if there are other fmts in the dependency graph.

@uilianries
Copy link
Member

I would imagine this is intended, yes. For the sake of Conan, we want to always either use Conan's fmt, or std::format. Allowing use of the bundled fmt could cause problems if there are other fmts in the dependency graph.

Correct, and also it gives not the control the dependencies graph, but also allows using different fmt version.

The most important I would say is having visibility in the dependencies graph. For instance, you can have a conanfile.txt, where you have both fmt and spdlog listed, and a third package that needs fmt as well. Using Conan fmt package, will give the change to use the very same version for these 3 packages. Otherwise, using the vendorized version available in spdlog may break when consuming, as that fmt version may not be compatible with the fmt Conan package, causing symbols conflicts, resulting in an incompatible ABI.

@andreprat Please, specify if are facing an error or failure when using the spdlog with fmt Conan package.

@uilianries uilianries added the question Further information is requested label Sep 19, 2024
@uilianries uilianries self-assigned this Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants