FS#63907 - [spdlog] Missing dependency: fmt

Attached to Project: Community Packages
Opened by Luca Weiss (z3ntu) - Tuesday, 24 September 2019, 17:25 GMT
Last edited by Antonio Rojas (arojas) - Friday, 04 October 2019, 17:38 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To No-one
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:
Compiling a software depending on spdlog (e.g. nheko in the AUR) fails with the following error:

CMake Error at /usr/share/cmake-3.15/Modules/CMakeFindDependencyMacro.cmake:47 (find_package):
Could not find a package configuration file provided by "fmt" with any of
the following names:

fmtConfig.cmake
fmt-config.cmake

Add the installation prefix of "fmt" to CMAKE_PREFIX_PATH or set "fmt_DIR"
to a directory containing one of the above files. If "fmt" provides a
separate development package or SDK, be sure it has been installed.
Call Stack (most recent call first):
/usr/lib64/cmake/spdlog/spdlogConfig.cmake:30 (find_dependency)
CMakeLists.txt:273 (find_package)

As far as I know, the -DSPDLOG_FMT_EXTERNAL=ON flag also modifies the installed CMake file to not look for the bundled fmt, which causes this issue to happen.

Additional info:
* spdlog 1.3.1-3
This task depends upon

Closed by  Antonio Rojas (arojas)
Friday, 04 October 2019, 17:38 GMT
Reason for closing:  Fixed
Comment by Daniel Sonck (dsonck92) - Tuesday, 01 October 2019, 13:12 GMT
I can confirm this bug. It can be resolved by manually installing the fmt library.

Since the PKGBUILD seems to use -DSPDLOG_FMT_EXTERNAL=ON, spdlog should depend on fmt as well (instead of only in makedepends). It can also be decided to use -DSPDLOG_FMT_EXTERNAL=OFF as the package seems to install the internal fmt headers anyways.

While trying to create a patch for this PKGBUILD to ease fixing this issue I noticed that the current fmt shipped by Arch actually fails compiling the tests. By this information, I actually suggest having -DSPDLOG_FMT_EXTERNAL=OFF to have better source compatibility.
Comment by Daniel Sonck (dsonck92) - Tuesday, 01 October 2019, 13:14 GMT
The two patches. Whichever is more conforming to the arch community repository. Personally I lean towards the "nofmt.patch" as it reduces potential incompatibilities with spdlog and fmt, and since the pkgbuild already ships bundled/fmt, there's no size benefit
Comment by Daniel Sonck (dsonck92) - Tuesday, 01 October 2019, 13:30 GMT
By current fmt, I mean 6.0.0-1

Loading...