rizsotto / Bear

Bear is a tool that generates a compilation database for clang tooling.
GNU General Public License v3.0
4.76k stars 312 forks source link

fmt - formattable evaluates to false #458

Closed theoparis closed 2 years ago

theoparis commented 2 years ago

Describe the bug

I tried to build bear, spdlog and fmt from source, as the arch linux package can't be used due to spdlog not bundling fmt and causing runtime errors.

/usr/include/c++/11.2.0/bits/std_function.h:413:9:   required by substitution of ‘template<class _Functor, class, class> std::function<void(const sys::Process&)>::function(_Functor) [with _Functor = {anonymous}::spawn_process({anonymous}::spawn_function_t, const std::filesystem::__cxx11::path&, const std::__cxx11::list<std::__cxx11::basic_string<char> >&, const std::map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >&)::<lambda(const auto:10&)>; <template-parameter-1-2> = void; <template-parameter-1-3> = void]’
/home/theo/dev/Bear/source/libsys/source/Process.cc:160:28:   required from here
/usr/local/include/fmt/core.h:1724:7: error: static assertion failed: Cannot format an argument. To make type T formattable provide a formatter<T> specialization: https://fmt.dev/latest/api.html#udt
 1724 |       formattable,
      |       ^~~~~~~~~~~
/usr/local/include/fmt/core.h:1724:7: note: ‘formattable’ evaluates to false
/home/theo/dev/Bear/source/libsys/source/Process.cc:59:19: warning: ‘std::ostream& {anonymous}::operator<<(std::ostream&, const {anonymous}::Arguments&)’ defined but not used [-Wunused-function]
   59 |     std::ostream& operator<<(std::ostream& os, const Arguments& arguments)
      |                   ^~~~~~~~

To Reproduce Steps to reproduce the behavior:

Install bear, spdlog and fmt from source using cmake

Expected behavior

To be able to build and install bear from source using CMake.

Environment:

Additional context

Before you send...

(no where in the issues or readme does it mention anytime about these specific errors)

theoparis commented 2 years ago

The reason I can't use arch linux's spdlog package is due to this:

bear: symbol lookup error: /usr/lib/libspdlog.so.1: undefined symbol: _ZN3fmt2v86detail14snprintf_floatIdEEiT_iNS1_11float_specsERNS1_6bufferIcEE
rizsotto commented 2 years ago

Hey @theoparis , thanks for the report.

One of the CI job is building Bear without the dependencies installed from pacakges. (See this for example.) The trick is that you don't build the dependencies, but allow Bear to build it for itself.

Since I can't reproduce this, I am closing the ticket.