Closed tchaikov closed 2 months ago
the date of f38's EOL will be Tue 2024-05-14 ^1 which is only 3 months ahead. we should be better prepared for switching to a supported distro for our base image, otherwise we would have to maintain an unsupported fedora linux release. the successor of f38 is f39, to run scylla on f39 would need to overcome some problems, one of them is this issue. in addition to it, we also have #16676 .
the take away is, we need to speed up the change. the patch adapted from the work at #15599 for building scylla on f39 on my local branch is like
146 files changed, 582 insertions(+), 191 deletions(-)
in which, most of the fmt::formatter<>
specializations are implemented using fmt::ostream_formatter
.
@tchaikov if you need to speed things up and you have these patches ready, you can start sending PRs which bundle some number of them (say a dozen or so), titled Convert operator<< to fmt::formatter 1/N
, then 2/N
, ....
It is fine to bundle these very similar patches into PRs. If you can find a common theme, like all patches touching the same subsystem, that is fine, but it is not required. Just don't put too many patches into a bundle, because all maintainers will run away if they see 100 patches in a PR :laughing:.
hi Botond, thank you for the suggestion! actually, only a very small part of the changes is ready in my local branch, i always pick some of types as my warm-up exercise on daily basis. but taking the load of reviewers and the work of test failures annotations into consideration, to send the patches in a small bundles is still a big win, as it would be a much more efficient.
i will go in this way.
the date of f38's EOL will be Tue 2024-05-14 1 which is only 3 months ahead. we should be better prepared for switching to a supported distro for our base image, otherwise we would have to maintain an unsupported fedora linux release. the successor of f38 is f39, to run scylla on f39 would need to overcome some problems, one of them is this issue. in addition to it, we also have #16676 .
I have made the mistake of upgrading to Fedora 39, and was sad - and frankly shocked - that Scylla no longer compiles on it without dbuild. I am shocked because Fedora 39 is already 4 months old - nobody was bothered by this except you???
I think we need to fix this quickly - and not drag it over weeks. Is it really 100 patches left??? :-(
I just created by first formatter patch, https://github.com/scylladb/scylladb/pull/17432. It's one of a bazillion operator<< that need to be translated into an ugly template. This is an incredibly wasteful and stupid chore. I can't believe the fmt guys actually went ahead and did this. The "operator<<" thing worked well for decades, why did they decide to axe it? And why replace it by a template that needs to sit in a header file? :-(
I have made the mistake of upgrading to Fedora 39, and was sad - and frankly shocked - that Scylla no longer compiles on it without dbuild. I am shocked because Fedora 39 is already 4 months old - nobody was bothered by this except you???
I build using dbuild happily on F39, so wasn't bothered that much.
@nyh there's a lazier but worse patch, see https://github.com/scylladb/scylladb/pull/15599/commits/4c6b0085e37d34d354a863cbcfbf8f81e99c0009. It requires one line per type.
I build using dbuild happily on F39, so wasn't bothered that much.
dbuild is a real pain in the @$@!, I have been avoiding it whenever I can and wan't planning to make a habit out of using it. It's makes things like running scripts, tests, etc., super complicated and annoying. It's amazing that Fedora 39 has been out in 4 months and nobody besides Kefu has been doing anything to fix this :-( I see I will need to work on this myself now to make the progress faster :-(
@nyh there's a lazier but worse patch, see 4c6b008. It requires one line per type.
In what sense is it worse? Why aren't we doing that, if it's possible (I thought they took out this possibility!)
guess it's just me who wanted to pretend to be a perfectionist before giving up. i will send a rebased change based on Avi's 4c6b008 if we are satisfied with fmt::ostream_formatter
. but please note, it creates a new fmt::memory_buffer
instance for every formatted variable, and copy this chunk of memory to the output context. we can do this in parallel though: on one hand to have the lazy change in master, and on the other hand go on with s/operator<</fmt::formatter/ odyssey.
@nyh there's a lazier but worse patch, see 4c6b008. It requires one line per type.
In what sense is it worse? Why aren't we doing that, if it's possible (I thought they took out this possibility!)
It's worse in that it keeps the dependency on two formatting systems. It's better in that it's a lot less work.
What was removed in fmt 10 is the ability to automatically fall back to ostream.
And yes it's much slower. But that's minor as non of this is on a fast path.
guess it's just me who wanted to pretend to be a perfectionist before giving up. i will send a rebased change based on Avi's 4c6b008 if we are satisfied with
fmt::ostream_formatter
. but please note, it creates a newfmt::memory_buffer
instance for every formatted variable, and copy this chunk of memory to the output context. we can do this in parallel though: on one hand to have the lazy change in master, and on the other hand go on with s/operator<</fmt::formatter/ odyssey.
I agree. I'll be happy to commit something which makes the project build on modern distros, even if later we can make it even better. The sooner the better ;-)
Fixes
to the PR or any of the commits in it. because i was afraid there were fall outs caused by this change. but after almost a week, it is relatively quiet. so i am closing this issue.please note, the tree does not compile with {fmt} v10. https://github.com/scylladb/seastar/pull/2203 was created to address this.
in Seastar, we have, for instance:
but, quote from the issue reported by Benny at https://github.com/scylladb/seastar/issues/1544
quote from Kefu's comment on the Seastar issue:
as put above, we are not likely to fix all of the
operator<<
formatter in a single PR. i am proposing a general steps to create a PR for addressing this issue here:FMT_DEPRECATED_OSTREAM
line inconfigure.py
, so we don't rely on the fallback ostream formatter created by fmtlibfmt::formatter
specialization for. in following steps, the type is namedPrintable
. in this case,Printable
isutils::tagged_uuid<tasks::task_id_tag>
fmt::formatter
forutils::tagged_uuid<tasks::task_id_tag>
or better off specializing forutils::tagged_uuid<>
either using thefmt::ostream_formatter
, or define a proper formatter using fmtlib.operator<<()
of this type. if theoperator<<()
only has a single caller, we can also usefmt::streamed
. see https://fmt.dev/dev/api.html#_CPPv4I0EN3fmt8streamedEN6detail13streamed_viewI1TEERK1T . but still, in the long run, we should have afmt::formatter<>
for this type. despite that this step is optional, it might be important, as it helps us to reduce the number of callers relying onoperator<<()
.ostream& operator<<(ostream& os, const Printable&)
to use the new formatter, if the formatters are complicated. so we have less repeatings. like,fmt::print(os, printable)
.FMT_DEPRECATED_OSTREAM
, but a fix should at least address a single error.FMT_DEPRECATED_OSTREAM
backsee also https://gist.github.com/tchaikov/9f4cb52487189f51aa87ca8fd56dfd4f for some recipes on how to fix the callers of existing operator<<.