Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 827889 - dev-libs/spdlog-1.9.2 is unusable by default with libfmt unbundled
Summary: dev-libs/spdlog-1.9.2 is unusable by default with libfmt unbundled
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: David Roman
URL: https://github.com/gabime/spdlog/issu...
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks: 828349
  Show dependency tree
 
Reported: 2021-11-30 10:44 UTC by Alexey
Modified: 2022-03-10 23:58 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey 2021-11-30 10:44:41 UTC
$ cat test.cpp
#include <spdlog/spdlog.h>

$ g++ test.cpp
In file included from /usr/include/spdlog/common.h:36,
                 from /usr/include/spdlog/spdlog.h:12,
                 from test.cpp:1:
/usr/include/spdlog/fmt/fmt.h:22:14: fatal error: spdlog/fmt/bundled/core.h: No such file or directory
   22 | #    include <spdlog/fmt/bundled/core.h>
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

The fix is to uncomment #define SPDLOG_FMT_EXTERNAL in /usr/include/spdlog/tweakme.h, and that should be done via a patch in dev-libs/spdlog/files/ because this is specific to the way how spdlog is installed, and not related to projects which use spdlog
Comment 1 Ao Shen 2021-12-29 05:17:41 UTC
AFAIK the ebuild use `-DSPDLOG_BUILD_SHARED=yes` so the resulting library is *not* header-only anymore.

$ pkg-config --cflags --libs spdlog
-DSPDLOG_SHARED_LIB -DSPDLOG_COMPILED_LIB -DSPDLOG_FMT_EXTERNAL -lspdlog -pthread -lfmt

pkg-config indeed gives appropriate flags for linking against libspdlog.so and libfmt.so installed in the system.

However, my concern is, as it is a compiled library, it should use cmake-multilib.eclass instead to build 32- and 64-bit libraries for multilib environment.
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-01-02 06:21:42 UTC
ping
Comment 3 David Roman 2022-01-02 14:35:02 UTC
I opened an issue upstream some days ago about the use of bundled fmt, it's not a big issue but it really doesn't makes sense to include a bundled library that is not installed. For now I will patch it so it only includes system fmt and use the correct eclass too. thanks
Comment 4 Larry the Git Cow gentoo-dev 2022-03-10 23:58:27 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fc822ea2139fce41df9ca35b3e8a02a8f4dba185

commit fc822ea2139fce41df9ca35b3e8a02a8f4dba185
Author:     David Roman <davidroman96@gmail.com>
AuthorDate: 2022-01-18 23:37:51 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-03-10 23:58:16 +0000

    dev-libs/spdlog: force use of external fmt lib
    
    Closes: https://bugs.gentoo.org/827889
    Package-Manager: Portage-3.0.30, Repoman-3.0.3
    Signed-off-by: David Roman <davidroman96@gmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/23863
    Signed-off-by: Sam James <sam@gentoo.org>

 .../spdlog/files/spdlog-force_external_fmt.patch   | 15 ++++++
 dev-libs/spdlog/spdlog-1.9.2-r1.ebuild             | 53 ++++++++++++++++++++++
 2 files changed, 68 insertions(+)