FS#74295 - spdlog missing tweak for external fmt

Attached to Project: Community Packages
Opened by Guillaume Dollé (gdolle) - Thursday, 31 March 2022, 23:14 GMT
Last edited by Brett Cornwall (ainola) - Monday, 16 January 2023, 01:39 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Brett Cornwall (ainola)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

fmt does not seem bundled with spdlog, the current package is configured with `-DSPDLOG_FMT_EXTERNAL=ON`
which is provided by fmt package (maybe to be added as dependency).
I think also that the spdlog configuration header should be tweaked "/usr/include/spdlog/tweakme.h"
by uncommenting line 74
```
#define SPDLOG_FMT_EXTERNAL
```
(otherwise spdlog/fmt/fmt.h will look for missing spdlog/fmt/bundled/* headers).

[1] https://spdlog.docsforge.com/v1.x/8.tweaking/

Additional info:
* package version(s) 1.9.2-3
* config and/or log files etc.
* link to upstream bug report, if any

Steps to reproduce:
This task depends upon

Closed by  Brett Cornwall (ainola)
Monday, 16 January 2023, 01:39 GMT
Reason for closing:  Fixed
Additional comments about closing:  spdlog-1.11.0-2
Comment by Brett Cornwall (ainola) - Tuesday, 05 April 2022, 19:30 GMT
Thanks for bringing this up, gdolle! I've chimed in at https://github.com/gabime/spdlog/issues/2310 to hopefully get this changed at the upstream level. Let's see what happens...
Comment by Brett Cornwall (ainola) - Sunday, 22 May 2022, 03:36 GMT
Upstream doesn't seem interested. It looks like we'll just have to patch it.
Comment by Lukas Frank (Rukula) - Monday, 02 January 2023, 14:35 GMT
I think I ran into exactly this problem. I tried compiling https://github.com/Decave/JCoz which depends upon spdlog. It gives me the error:

[admin_t@archpc JCoz]$ make all
g++ -I/usr/lib/jvm/zulu-8/bin/../include -I/usr/lib/jvm/zulu-8/bin/../include/linux -I/usr/include -mfpmath=sse -std=gnu++0x -fdiagnostics-show-option -fexceptions -fno-asynchronous-unwind-tables -fno-omit-frame-pointer -fno-strict-aliasing -fPIC -funsigned-char -Fvisibility=hidden -m64 -msse2 -g -D__STDC_FORMAT_MACROS -Wframe-larger-than=16384 -Wno-unused-but-set-variable -Wunused-but-set-parameter -Wvla -Wno-conversion-null -Wno-builtin-macro-redefined -Wformat-security -Wformat -Wno-char-subscripts -Wno-sign-compare -Wno-strict-overflow -Wnon-virtual-dtor -Woverloaded-virtual -Wwrite-strings -O3 -c /home/admin_t/Code/JCoz/src/native/bci_hits.cc -o /home/admin_t/Code/JCoz/build-64/bci_hits.pic.o
In Datei, eingebunden von /usr/include/spdlog/common.h:45,
von /usr/include/spdlog/spdlog.h:12,
von /home/admin_t/Code/JCoz/src/native/bci_hits.cc:4:
/usr/include/spdlog/fmt/fmt.h:27:14: schwerwiegender Fehler: spdlog/fmt/bundled/core.h: Datei oder Verzeichnis nicht gefunden
27 | # include <spdlog/fmt/bundled/core.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
Kompilierung beendet.
make: *** [Makefile:84: /home/admin_t/Dokumente/thi/Bachelorarbeit/Code/JCoz/build-64/bci_hits.pic.o] Fehler 1

Which shows that that spdlog tries to access /usr/include/spdlog/fmt/bundled/core.h while the directory /usr/include/spdlog/fmt/bundled does not exist. Upstream there exists a fmt/bundeled directory ( https://github.com/gabime/spdlog/tree/v1.x/include/spdlog/fmt ).
Comment by Brett Cornwall (ainola) - Monday, 02 January 2023, 18:10 GMT
Thanks for bringing this back to my attention, Rukula. This slipped my mind. :(

Could you test with spdlog-1.11.0-2 which was just pushed to [community-testing]? That should resolve the issue. gdolle, if you're still hanging around feel free to test, too!
Comment by Lukas Frank (Rukula) - Thursday, 05 January 2023, 19:24 GMT
Thank you for the quick fix.
I installed spdlog-1.11.0-2 and it fixes the specific problem I had with the compilation. Now JCoz does compile, but doesn't run. This way I can not confirm whether spdlog works properly. Trying to run JCoz gives an error:

[admin_t@archpc JCoz]$ make run-workload
cd src/java/src/test/java/; \
java \
-agentpath:/home/admin_t/Code/JCoz/build-64/liblagent.so \
-cp $(readlink -f ../../../target/client*dependencies.jar):. \
test.TestThreadSerial --fast
Error occurred during initialization of VM
Could not find agent library /home/admin_t/Code/JCoz/build-64/liblagent.so in absolute path, with error: /home/admin_t/Code/JCoz/build-64/liblagent.so: undefined symbol: _ZTIN3fmt2v912format_errorE
make: *** [Makefile:105: run-workload] Fehler 1

https://github.com/Nheko-Reborn/nheko/issues/362 seems to suggest that this could be related to libfmt, although it could also just be a problem of JCoz since it doesn't look like it is maintained anymore.
It would be helpful if somebody has a working application that uses spdlog and confirm that it works in a normal usecase.
Comment by Brett Cornwall (ainola) - Monday, 16 January 2023, 01:39 GMT
Thanks for testing. I'm going to go ahead and move that package to [community]. If there's anything else that needs to happen, please file another ticket!

Loading...