Bug 37969 - spdlog/fmt/bundled/core.h missing after upgrade to 1.5.0
Summary: spdlog/fmt/bundled/core.h missing after upgrade to 1.5.0
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: libspdlog-devel (show other bugs)
Version: unstable
Hardware: all Linux
: P5 normal
Assignee: Vitaly Lipatov
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-30 14:27 MSK by Andrew Vasilyev
Modified: 2020-01-31 16:37 MSK (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Vasilyev 2020-01-30 14:27:31 MSK
In spdlog 1.3.1:

apt-file spdlog/fmt/bundled/core.h
libspdlog-devel: /usr/include/spdlog/fmt/bundled/core.h

In spdlog 1.5.0:

rpm -ql libspdlog-devel-1.5.0-alt1 | fgrep /fmt/ 
/usr/include/spdlog/fmt/bin_to_hex.h
/usr/include/spdlog/fmt/fmt.h
/usr/include/spdlog/fmt/ostr.h

No spdlog/fmt/bundled/ directory at all.

But in 1.5.0 source tree it still exists:

[spdlog.git] / spdlog / include / spdlog / fmt / bundled /
drwxr-xr-x	 	..	
-rw-r--r--	1408	LICENSE.rst	blob | history | raw
-rw-r--r--	34870	chrono.h	blob | history | raw
-rw-r--r--	22421	color.h	blob | history | raw
-rw-r--r--	19797	compile.h	blob | history | raw
-rw-r--r--	50302	core.h	blob | history | raw
-rw-r--r--	50189	format-inl.h	blob | history | raw
-rw-r--r--	116422	format.h	blob | history | raw
-rw-r--r--	2870	locale.h	blob | history | raw
-rw-r--r--	4607	ostream.h	blob | history | raw
-rw-r--r--	9025	posix.h	blob | history | raw
-rw-r--r--	21679	printf.h	blob | history | raw
-rw-r--r--	11858	ranges.h	blob | history | raw
Comment 1 Andrew Vasilyev 2020-01-30 16:08:14 MSK
This is due to the following addition in spec:

-%cmake
+%cmake -DSPDLOG_BUILD_SHARED=ON \
+       -DSPDLOG_FMT_EXTERNAL=ON

Is there real need for having SPDLOG_FMT_EXTERNAL=ON ?
Comment 2 Vitaly Lipatov 2020-01-30 20:44:44 MSK
Опишите, в чём проблема у вас при сборке с новой версией spdlog.
Comment 3 Andrew Vasilyev 2020-01-30 20:54:55 MSK
As a result the building of lizardfs failed with the following error:

make[2]: Entering directory '/usr/src/RPM/BUILD/lizardfs-3.13.0/BUILD'
[  0%] Building CXX object src/protocol/CMakeFiles/lzfsprotocol.dir/packet.cc.o
In file included from /usr/include/spdlog/common.h:38,
                 from /usr/include/spdlog/spdlog.h:12,
                 from /usr/src/RPM/BUILD/lizardfs-3.13.0/src/common/slogger.h:29,
                 from /usr/src/RPM/BUILD/lizardfs-3.13.0/src/common/massert.h:28,
                 from /usr/src/RPM/BUILD/lizardfs-3.13.0/src/common/serialization.h:37,
                 from /usr/src/RPM/BUILD/lizardfs-3.13.0/src/protocol/packet.h:28,
                 from /usr/src/RPM/BUILD/lizardfs-3.13.0/src/protocol/packet.cc:20:
/usr/include/spdlog/fmt/fmt.h:22:10: fatal error: spdlog/fmt/bundled/core.h: No such file or directory
   22 | #include <spdlog/fmt/bundled/core.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [src/protocol/CMakeFiles/lzfsprotocol.dir/build.make:63: src/protocol/CMakeFiles/lzfsprotocol.dir/packet.cc.o] Error 1

  From /usr/include/spdlog/fmt/fmt.h: 
  
#if !defined(SPDLOG_FMT_EXTERNAL)
#ifdef SPDLOG_HEADER_ONLY
#ifndef FMT_HEADER_ONLY
#define FMT_HEADER_ONLY
#endif
#endif
#ifndef FMT_USE_WINDOWS_H
#define FMT_USE_WINDOWS_H 0
#endif
#include <spdlog/fmt/bundled/core.h>
#include <spdlog/fmt/bundled/format.h>
#else // SPDLOG_FMT_EXTERNAL is defined - use external fmtlib
#include <fmt/core.h>
#include <fmt/format.h>
#endif

  The problem caused by missed definition of macros SPDLOG_FMT_EXTERNAL, which should be probably defined in libspdlog-devel includes when built with external libfmt. 

  There is /usr/include/spdlog/tweakme.h with SPDLOG_FMT_EXTERNAL comment out.

  If define SPDLOG_FMT_EXTERNAL while building lizardfs, the compilation succeeds. But it is not the right solution, isn't it?
Comment 4 Vitaly Lipatov 2020-01-30 22:11:36 MSK
(Ответ для Andrew Vasilyev на комментарий #3)
...
>   There is /usr/include/spdlog/tweakme.h with SPDLOG_FMT_EXTERNAL comment
> out.
> 
>   If define SPDLOG_FMT_EXTERNAL while building lizardfs, the compilation
> succeeds. But it is not the right solution, isn't it?
Хорошо, я проверяю, чтобы этот макрос был раскомментирован в пакете.
Comment 5 Repository Robot 2020-01-30 23:20:10 MSK
spdlog-1.5.0-alt2 -> sisyphus:

 Thu Jan 30 2020 Vitaly Lipatov <lav@altlinux.ru> 1.5.0-alt2
 - patch tweakme.h to use external libfmt for the library clients (ALT bug 37969)
Comment 6 Andrew Vasilyev 2020-01-31 16:37:36 MSK
  Спасибо!