Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quill built with QUILL_FMT_EXTERNAL fails to find system Fmt includes #130

Open
alebcay opened this issue Sep 2, 2021 · 2 comments
Open

Comments

@alebcay
Copy link

alebcay commented Sep 2, 2021

Hello, I encountered this issue in trying to package Quill for the Homebrew package manager. Right now we build Quill and use its bundled Fmt. Ideally we would use system/external Fmt, to reduce duplication of dependencies and make updating dependencies easier.

When building Quill with the QUILL_FMT_EXTERNAL option, the build and install succeeds. I see that the bundled Fmt is not installed. However, trying to include Quill headers results in:

In file included from /usr/local/Cellar/quill/1.6.3/include/quill/Logger.h:8:
/usr/local/Cellar/quill/1.6.3/include/quill/Fmt.h:20:12: fatal error: 'quill/bundled/fmt/chrono.h' file not found
  #include "quill/bundled/fmt/chrono.h"
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

The issue is that when building with QUILL_FMT_EXTERNAL, Fmt headers are located somewhere else. But the Quill headers still expect Fmt to be present in the bundled location. A workaround for now that worked for me is to symlink the Fmt headers folder into the bundled location, but for distributing via package manager, this is not ideal.

@odygrd
Copy link
Owner

odygrd commented Sep 9, 2021

Hello, thanks for reporting and for packing the new version :)

Looking into this, after installing Quill you still should pass the flag into your project.

e.g as a compiler flag -DQUILL_FMT_EXTERNAL or before including quill.h

#define QUILL_FMT_EXTERNAL
#include "Quill.h"

Do you mean that for a package manager that is not an ideal solution and would like something where quill is aware the bundled one is missing without the additional flag ?

@alebcay
Copy link
Author

alebcay commented Sep 9, 2021

Ah, I see, that makes more sense.

Yes, I think that would be helpful from a packaging perspective, if it's something that you'd be comfortable including. To me it seems that the choice of bundled vs external fmt is something that happens at configure + build time (and should be remembered), rather than counting on consumers to remember.

I could also see it being confusing for other projects that depend on Quill, as they also now need to check if the Quill being used has internal vs external Fmt and the compiler flag needs to be set. One option is to preprocess Logger.h (and other headers) to point to the desired location at configure/build time (in my opinion, the most foolproof way) or another option is to conditionally modify the pkg-config file with the flag at configure/build-time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants