-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[AVRO-3967] Replace boost::format with fmt library #2832
Conversation
It might be trivial to you but to me it looks like it needs a JIRA issue (for the changelog) :-) |
Sure! Sorry I hadn't added it earlier. Will do this now |
I see that In general, I would like to see it updated at some pointed as it seems quite a bit outdated tbh |
The ARM64 builders run on Ubuntu 20.04 with GCC 9.3.0 |
@martin-g so the quick research shows that on Ubuntu 20.04 the version of fmt is too old (6.1.2 while the latest one is 10.2.0). As an alternative of relying to the system dependencies we can use WDYT? |
The ARM64 CI is a |
Thanks for the help! Let's hear from Apache Infra... I'll try to find PPA for fmtlib, but it seems it's not that common, especially for ARM64. |
https://ubuntu.pkgs.org/22.04/ubuntu-universe-arm64/libfmt-dev_8.1.1+ds1-2_arm64.deb.html
|
Thanks! Let's see if fmt 8 will do the trick |
Checked locally with Ubuntu 20.04 docker image, and it doesn't work unfortunately :(
Alternatively, I can try to build it just on that Ubuntu in CI. Shouldn't take long. |
Could you trigger the CI before I fix the merge conflicts? Wanna see if taking the latest one with FetchContent would do the trick. |
I can't! You need to resolve the conflicts first |
This reduces the binary size quite significantly and doesn't require an addtitional object creation during exception throwing.
Hey, I've pushed one more commit. Could this be approved to trigger the CI? |
@@ -22,6 +22,7 @@ | |||
#include <cstdint> | |||
#include <cstring> | |||
#include <memory> | |||
#include <vector> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this include needed/used ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I currently have a limited access to my laptop (until Friday). I'll double check this by next week.
IIRC I got compile error without it because I removed include of boost/format from one of the headers. But I'll definitely double check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@martin-g so yeah this include is needed, because there's usage of std::vector
in the signature of snapshot()
on line 177. Without it, compilation failed for me.
Thank you, @mkmkme ! |
The fmt library was added to cpp in cpp20. So this change would break projects on an older dialect, such as cpp17. |
@marlowa libfmt is not the same as std::fmt, the https://github.com/fmtlib/fmt project is compatible with older c++ standards than c++20 where |
* Replace boost::format with fmt library This reduces the binary size quite significantly and doesn't require an addtitional object creation during exception throwing. * cmake: get fmt with FetchContent * cmake: always use fmt-header-only
AVRO-3967
This reduces the binary size quite significantly and doesn't require an additional object creation during exception throwing.
What is the purpose of the change
This change replaces
boost::format
withfmt
library. It increases the readability and reduces the binary size quite significantly (on my machine I noticedavrogencpp
being 27M withboost::format
and 14M withfmt
.Verifying this change
This change is a trivial rework / code cleanup without any test coverage.
Documentation