Open rdong8 opened 1 month ago
I did some experimenting - I can reproduce this, but I think this might actually be a spdlog bug. This works using clang 20, but fails with clang 16 and 18. Or maybe not... might have done something incorrectly. Will keep testing.
Okay did a proper test using only spdlog, and I do believe it's a bug on their part. If I go to their main repo and do just
cmake -B build -DCMAKE_C_COMPILER=clang-16 -DCMAKE_CXX_COMPILER=clang++-16 -DSPDLOG_USE_STD_FORMAT=ON -DCMAKE_CXX_FLAGS="-stdlib=libc++" -G Ninja
cmake --build build
This also repros with clang 18 and 20. I can do some more testing, it's possible it's failing with its clang + libc++ handling.
It seems to be a LLVM bug: llvm/llvm-project#66466
I think you can install the library by not building example.cpp
in spdlog.
Description
The
use_std_fmt
forspdlog
does not work properly. It is supposed to makespdlog
use the (C++20 standard format library)[https://en.cppreference.com/w/cpp/utility/format/format] instead offmt
, but enabling it seems to simply stopfmt
from being included as a dependency without actually using the standard format facilities.Package and Environment Details
Conan profile
Host profile: [settings] arch=x86_64 build_type=Release compiler=clang compiler.cppstd=23 compiler.libcxx=libc++ compiler.version=18 os=Linux [buildenv] CC=clang CXX=clang++
Build profile: [settings] arch=x86_64 build_type=Release compiler=clang compiler.cppstd=23 compiler.libcxx=libc++ compiler.version=18 os=Linux [buildenv] CC=clang CXX=clang++
Steps to reproduce
The full example code is here:
example.zip
Note that the code in
example.cpp
comes fromuser_defined_example
inspdlog
's own example code.Logs
Click to expand log
``` BUILD_DIR=build/ \ conan \ install . \ -b missing \ -s build_type=Release \ -s "&:build_type=Debug" ======== Input profiles ======== Profile host: [settings] arch=x86_64 build_type=Release compiler=clang compiler.cppstd=23 compiler.libcxx=libc++ compiler.version=18 os=Linux &:build_type=Debug [buildenv] CC=clang CXX=clang++ Profile build: [settings] arch=x86_64 build_type=Release compiler=clang compiler.cppstd=23 compiler.libcxx=libc++ compiler.version=18 os=Linux [buildenv] CC=clang CXX=clang++ ======== Computing dependency graph ======== Graph root conanfile.py: /home/rd8/tmp/spdlog/conanfile.py Requirements spdlog/1.14.1#972bbf70be1da4bc57ea589af0efde03 - Cache ======== Computing necessary packages ======== Requirements spdlog/1.14.1#972bbf70be1da4bc57ea589af0efde03:f5531dce08d48188ae2f58763ed909900b521a32#e4e664ca7351fdfe34910221589faee0 - Cache ======== Installing packages ======== spdlog/1.14.1: Already installed! (1 of 1) WARN: deprecated: Usage of deprecated Conan 1.X features that will be removed in Conan 2.X: WARN: deprecated: 'cpp_info.names' used in: spdlog/1.14.1 ======== Finalizing install (deploy, generators) ======== conanfile.py: Writing generators to /home/rd8/tmp/spdlog/build/Debug/generators conanfile.py: Generator 'CMakeDeps' calling 'generate()' conanfile.py: CMakeDeps necessary find_package() and targets for your CMakeLists.txt find_package(spdlog) target_link_libraries(... spdlog::spdlog) conanfile.py: Calling generate() conanfile.py: Generators folder: /home/rd8/tmp/spdlog/build/Debug/generators conanfile.py: CMakeToolchain generated: conan_toolchain.cmake conanfile.py: CMakeToolchain: Preset 'conan-debug' added to CMakePresets.json. (cmake>=3.23) cmake --preset conan-debug (cmake<3.23) cmake