-
-
Notifications
You must be signed in to change notification settings - Fork 604
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
Multiple error messages of type: println
is not a member of fmt
#549
Comments
The addition of I had to re-clone it and repeat the whole building process to force it to use the forked version located in We need to let users know they need to either re-clone the whole repo or init the submodule and pull the latest changes. Update: I personally just tried @aristocratos can we update the README to include the necessary command(s) that users need to use to pull changes from submodules too? For transmission, we use the following commands for updating the repo and then build the project with the latest changes:
|
For some reason, GitHub does not let me fork btop 🤔 or edit the README file...anyway. Can we add a sub-step called
with a tip:
|
I have the same issue with compiling btop on my Gentoo Linux. It uses g}} 12.2.1 and compiles with c++20. I have just recloned the btop repository, and I see the lib/fmt/ directory. But that directory is empty. |
Weird...go inside that directory and run |
hmm, it does, but you have to be in the lib/ directory. It does nothing if I'm in the toplevel directory, or in the lib/fmt/ directory. And I should have paid more attention to the updated README.md file. I didn't use "--recursive" with the git clone command. The compilation now works for me with the current HEAD revision. |
Gonna add some more documentation. Probably gonna be a lot of these issues in the coming weeks for people who compile themself and just run |
the best would be, if make could detect that this file fails to build and print a message to check the lib/fmt/ directory. |
I've just noticed that the build works if libfmt 10 is installed on the system (Gentoo Linux in my case). Does this mean we now have a hard dependency on libfmt 10? Because there are problems for older projects which are incompatible with libfmt 10, hence requiring older libfmt to stick around on operating systems for a little longer. If it's not crucial for btop's operation, I'd rather not have a hard dependency on libfmt 10, but make the code at least compatible to libfmt 9, which is the version available in Debian bookworm (and hence the version one might expect on many server systems where btop might be used as a resource monitor). This would mean that println must not be used, though. |
@NexAdn Unless you got exactly the same version as in the submodule installed on your system, it's not guaranteed to work. |
Simply replacing calls to fmt::println with calls to fmt::print allows btop to be compiled with libfmt 8 and 9, allowing compatibility with the system libraries of more operating systems. Issue: aristocratos#549
Well, for local development that might be nice, but for packaging I'm gonna download a source tarball which won't include the submodule. Usually, submodules don't bring much of a benefit compared to pulling in dependencies as system packages, but can increase the maintenance overhead for system packagers. Thus, unless it is crucial not to use a system package, I'd rather avoid using submodules when packaging software for a system. Compatibility with system libfmt 8, 9 and 10 can be established by simply replacing calls to Since I now have the patch ready anyway, I'm gonna open PR. If you're willing to allow system libfmt to be used for building btop, please consider merging it. I'd be very grateful to have the option not to use git submodules. |
Actually this might be a better idea: AcademySoftwareFoundation/MaterialX#317 (comment) Including a |
Well, the current limit is only that println is no longer allowed. But since this can be considered as a convenience wrapper around print, I don't see how banning println in the code limits the functionality in any way.
I'm still not a fan of bundling dependencies in the first place, but keeping the submodules for development and yet still have only a single tarball with all deps in it to download for packaging is a good compromise if you'd like to stick with bundled dependencies. |
If you look at https://github.com/fmtlib/fmt/releases you'll see that there's a lot more than just
Why not? All bundled dependencies are "header only", no extra build steps and you'll always have the "correct" version. |
Of course there is. However, since btop works perfectly fine with 8 through ten when println is replaced with print, it seems like println is the only feature from v10 that is actually used in btop. So adding compatibility with 8 and 9 is imho really not that big of a deal. If you'd like to use other v10 features which aren't available in 8 and 9 and have to “good” alternatives there, requiring v10 is of course a sensible decision.
Not particularly relevant in this case, but I have dealt with packages where devs didn't care about getting their bundled dependencies clean, leading to headers or libs of bundled dependencies being installed in the system (which of course then cause conflicts with the system-installed dependencies). Simply moving bundled libs to another directory can then break the package itself (if not done correctly), while keeping the bundled libs in place might cause breakage to other packages on the system which now use that bundled lib instead of the real library from the system package. Fixing this can be very annoying. Apart from that, with bundled libs a system package maintainer has no control over per-package compiler/linker flags or patches required to make the package work on a system or to apply critical security fixes. Luckily, this is only rarely needed, but when the library is bundled other packages, it's hard to track all the packages that need patching of the bundled library down. With a system package, you always have one single package that needs patching, not dozens. Admittedly, these problems are not that relevant in the case of btop, but they're a general motivation for me to keep bundled libs out of software (or at least optional) as much as possible. Most of the time, keeping a dependency's version pinned isn't really required to make the software work and having compatibility across a reasonable range of dependency versions isn't that much of a hassle. |
The most crucial thing is having the UTF-8 support working correctly when I start to convert all the big strings in
I can understand that. I've even thought about adding a version checker and updater in the static releases since the binary will keep on working regardless of any updates/changes to the system it's running on. Software releases on Linux through distribution packaging is kind of a mess in general, in regards to the different standards, rules, formats and dependency version availability between distros. And alternatives like snap, flatpack and appimages aren't really that good either with the risk of issues with performance, access to the running system, file sizes and so on. In a perfect world "in regards to btop++ :)", everyone would use the static releases. |
I've just pulled the latest changes and attempted to compile the code:
The text was updated successfully, but these errors were encountered: