summaryrefslogtreecommitdiff
path: root/nix/local.mk
diff options
context:
space:
mode:
authorCongcong Kuo <congcong.kuo@gmail.com>2025-07-21 11:02:40 +0800
committerLudovic Courtès <ludo@gnu.org>2025-10-19 21:29:39 +0200
commit3af52f845fe2ceb448416ac7b9f48925673c594e (patch)
treec8623599d15363a8e760adf1ad9dd01477ceabd7 /nix/local.mk
parentcbda925613b2962db8c6dbb2ea3dda7e3b433611 (diff)
daemon: Bump to C++20 and use ‘std::format’ instead of ‘boost::format’.
* nix/boost: This directory and all files inside it are removed. * nix/libstore/build.cc (Goal::trace): Use ‘std::string’ instead of ‘const format &’. (DerivationGoal::startBuilder, ...): Use ‘std::format’ or ‘std::vformat’ instead of ‘boost::format’. * nix/libstore/builtins.cc (builtinDownload): Same. * nix/libstore/derivations.cc (DerivationOutput::parseHashInfo, ...): Same. * nix/libstore/gc.cc (LocalStore::openGCLock, ...): Same. * nix/libstore/globals.cc (Settings::_get): Same. * nix/libstore/local-store.cc: (checkStoreNotSymlink, ...): Same. * nix/libstore/misc.cc (dfsVisit, showBytes): Same * nix/libstore/optimise-store.cc (makeWritable, ...): Same. * nix/libstore/pathlocks.cc (openLockFile, ...): Same. * nix/libstore/references.cc (search, scanForReferences): Same. * nix/libstore/sqlite.hh (throwSQLiteError): Use ‘std::string’ instead of ‘const format &’. * nix/libstore/sqlite.cc (throwSQLiteError): Use ‘std::string’ instead of ‘const format &’. * nix/libstore/store-api.cc (assertStorePath, ...): Use ‘std::format’ instead of ‘boost::format’. * nix/libutil/affinity.cc (setAffinityTo): Same. * nix/libutil/archive.cc (dumpContents, ...): Same. * nix/libutil/hash.cc (parseHash, parseHash32, parseHash16or32, hashFile): Same. * nix/libutil/hash.hh (parseHash, parseHash32, parseHash16or32, isHash): Same. * nix/libutil/serialise.cc : Add ‘<cassert>’ header file. * nix/libutil/spawn.cc (addPhaseAfter, ...): Use ‘std::format’ instead of ‘boost::format’. * nix/libutil/types.hh (FormatOrString): Removed. (BaseError, BaseError::addPrefix, SysError, MakeError): Use ‘std::string or std::string_view’ instead of ‘FormatOrString’. * nix/libutil/util.hh (Nest::open, printMsg_, warnOnce, expect): Same. * nix/libutil/util.cc (BaseError::BaseError, ...): Same. (writeToStderr, _interrupted): Use std::uncaught_exceptions() instead of std::uncaught_exception() * nix/nix-daemon/nix-daemon.cc (performOp, ...): Same. * nix/nix-daemon/guix-daemon.cc (string_to_bool, ...): Same. * nix/local.mk: Remove ‘libformat.a’ from ‘noinst_LIBRARIES’, remove ‘libformat_a_SOURCES’ and ‘libformat_headers’, remove ‘libformat_a_CPPFLAGS’ from ‘libutil_a_CPPFLAGS’ and ‘guix_daemon_LDADD’, update ‘AM_CXXFLAGS’ to ‘-std=c++20’. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'nix/local.mk')
-rw-r--r--nix/local.mk34
1 files changed, 6 insertions, 28 deletions
diff --git a/nix/local.mk b/nix/local.mk
index 7c1b81e9a65..819131b5d44 100644
--- a/nix/local.mk
+++ b/nix/local.mk
@@ -25,31 +25,10 @@
25BUILT_SOURCES += %D%/libstore/schema.sql.hh 25BUILT_SOURCES += %D%/libstore/schema.sql.hh
26CLEANFILES += %D%/libstore/schema.sql.hh 26CLEANFILES += %D%/libstore/schema.sql.hh
27 27
28noinst_LIBRARIES = libformat.a libutil.a libstore.a 28noinst_LIBRARIES = libutil.a libstore.a
29 29
30# Use '-std=c++11' for 'std::shared_ptr', 'auto', lambdas, and more. 30# Use '-std=c++20' for 'std::shared_ptr', 'auto', lambdas, and more.
31AM_CXXFLAGS = -Wall -std=c++11 31AM_CXXFLAGS = -Wall -std=c++20
32
33libformat_a_SOURCES = \
34 %D%/boost/format/free_funcs.cc \
35 %D%/boost/format/parsing.cc \
36 %D%/boost/format/format_implementation.cc
37
38libformat_headers = \
39 %D%/boost/throw_exception.hpp \
40 %D%/boost/format.hpp \
41 %D%/boost/assert.hpp \
42 %D%/boost/format/macros_default.hpp \
43 %D%/boost/format/format_fwd.hpp \
44 %D%/boost/format/format_class.hpp \
45 %D%/boost/format/exceptions.hpp \
46 %D%/boost/format/group.hpp \
47 %D%/boost/format/feed_args.hpp \
48 %D%/boost/format/internals_fwd.hpp \
49 %D%/boost/format/internals.hpp
50
51libformat_a_CPPFLAGS = \
52 -I$(top_srcdir)/nix
53 32
54libutil_a_SOURCES = \ 33libutil_a_SOURCES = \
55 %D%/libutil/archive.cc \ 34 %D%/libutil/archive.cc \
@@ -73,7 +52,6 @@ libutil_headers = \
73libutil_a_CPPFLAGS = \ 52libutil_a_CPPFLAGS = \
74 -I$(top_builddir)/nix \ 53 -I$(top_builddir)/nix \
75 -I$(top_srcdir)/%D%/libutil \ 54 -I$(top_srcdir)/%D%/libutil \
76 $(libformat_a_CPPFLAGS) \
77 $(LIBGCRYPT_CPPFLAGS) 55 $(LIBGCRYPT_CPPFLAGS)
78 56
79libstore_a_SOURCES = \ 57libstore_a_SOURCES = \
@@ -131,7 +109,7 @@ guix_daemon_LDFLAGS = \
131 $(LIBGCRYPT_LDFLAGS) 109 $(LIBGCRYPT_LDFLAGS)
132 110
133guix_daemon_LDADD = \ 111guix_daemon_LDADD = \
134 libstore.a libutil.a libformat.a -lz \ 112 libstore.a libutil.a -lz \
135 $(SQLITE3_LIBS) $(LIBGCRYPT_LIBS) 113 $(SQLITE3_LIBS) $(LIBGCRYPT_LIBS)
136 114
137guix_daemon_headers = \ 115guix_daemon_headers = \
@@ -144,7 +122,7 @@ guix_daemon_LDADD += -lbz2
144endif HAVE_LIBBZ2 122endif HAVE_LIBBZ2
145 123
146noinst_HEADERS = \ 124noinst_HEADERS = \
147 $(libformat_headers) $(libutil_headers) $(libstore_headers) \ 125 $(libutil_headers) $(libstore_headers) \
148 $(guix_daemon_headers) 126 $(guix_daemon_headers)
149 127
150%D%/libstore/schema.sql.hh: guix/store/schema.sql 128%D%/libstore/schema.sql.hh: guix/store/schema.sql