conan-io / conan-center-index

Recipes for the ConanCenter repository
https://conan.io/center
MIT License
948 stars 1.73k forks source link

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

Open andreprat opened 3 days ago

andreprat commented 3 days ago

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

https://github.com/conan-io/conan-center-index/blob/8cf9b27025fe69bb599c18de785fce4622aa053a/recipes/spdlog/all/conanfile.py#L125-L128

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 commented 1 day ago

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 commented 1 day ago

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.