FEX icon indicating copy to clipboard operation
FEX copied to clipboard

Switch tools depending on FEXCore to use fextl::fmt

Open marysaka opened this issue 1 year ago • 2 comments

~~This contribute a little bit to #3677 (I explicitly left fextl::fmt internals out this PR for now)~~ Ubuntu 22.04 currently doesn't ship a version of libstdc++ new enough to support std::fmt, those changes were removed from that PR.

This make tools that directly depends on FEXCore to use fextl::fmt when possible.

marysaka avatar Jun 16 '24 09:06 marysaka

I think the build failures are coming from the c++ standard being set to gnu++20 rather than c++20? Might need to add set(CMAKE_CXX_EXTENSIONS OFF) at https://github.com/FEX-Emu/FEX/blob/main/CMakeLists.txt#L97 to get that fixed. Hopefully won't introduce other problems.

Sonicadvance1 avatar Jun 16 '24 09:06 Sonicadvance1

I'm -0 on the latest iteration of this PR.

fextl was explicitly added to deal with FEXLoader's esoteric allocator requirements (i.e. keeping allocations within the guest-accessible 32-bit address space). This is not needed for other tools, and I would prefer those continued to live outside the fextl:: world to reduce overall code weirdness and surprises. (Granted, existing code is already a bit mixed here due to involving FEXCore APIs.)

As for the general goal of reducing the number of external dependencies, I'm not sure fmt is a good place to start. fmt is self-contained and fairly well-packaged among various distributions.

Meanwhile, C++20 (even if Ubuntu 22.04 did have a recent-enough libstdc++) does not provide a full replacement, since useful utilities like fmt::print and fmt::join are missing (the latter of which I'm not sure we can provide a replacement for). If fmt were our last remaining external dependency it would make sense to push for a compromise, but currently I don't see a big value-gain to justify the transition.

neobrain avatar Jun 18 '24 09:06 neobrain

Closing for now - let's pick this up again once Externals is slimmed down more generally and/or std::format is more feature-complete.

neobrain avatar Aug 15 '24 08:08 neobrain

Oh yeah forgot to close it, sorry about that :+1:

marysaka avatar Aug 15 '24 08:08 marysaka