On Mon, Jun 16, 2025 at 02:34:20PM +0200, Simon Tournier wrote: > Hi, > > On Thu, 15 May 2025 at 18:10, minung...@gmail.com wrote: > > > Currently guix-daemon is built using GCC 11 with -std=c++11. We are > > waiting for guile-daemon [1], but we can have improvements on > > guix-daemon right now. > > > > In nix/libutil/util.cc there are lots of functions related to > > copy/delete files and manipulate file paths. In C++ 17 the standard > > library’s <filesystem> provides the same functionality which is more > > reliable. > > > > guix-daemon uses Boost.Format to generate formatted string. These code > > are copied into nix/libformat directly and I think it is not a good > > practice. With C++ 20 we can use <format> from C++’s standard > > library. I have done some experiments on it [2]. In my code repo I > > replace all boost::format with std::format in nix/libutil. > > > > We can use <filesystem> if we upgrade from —std=c++11 to > > -std=c++17. For <format> we need GCC 13 with -std=c++20. > > Oh cool! Do you see differences? > > I guess one concern could be to take into account “downstream“. For > instance, Guix is packaged by Debian or else.
Most Linux distributions use a newer GCC version than we do. I figure that if we can build the daemon using our default GCC then we're doing fine. We can also set the CFLAGS specifically for the daemon to use whichever c++ standard we need. -- Efraim Flashner <efr...@flashner.co.il> אפרים פלשנר GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted
signature.asc
Description: PGP signature