1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-10 20:46:01 +01:00

Require Boost 1.81.0 or higher

Note: this version of Boost was released in December 2022.
This commit is contained in:
Eelco Dolstra 2025-07-10 11:53:36 +02:00
parent 485cbfc7f1
commit 74a144ce98
3 changed files with 2 additions and 17 deletions

View file

@ -7,12 +7,7 @@
#include "nix/util/error.hh" #include "nix/util/error.hh"
#include <boost/version.hpp> #include <boost/version.hpp>
#define USE_FLAT_SYMBOL_SET (BOOST_VERSION >= 108100) #include <boost/unordered/unordered_flat_set.hpp>
#if USE_FLAT_SYMBOL_SET
# include <boost/unordered/unordered_flat_set.hpp>
#else
# include <boost/unordered/unordered_set.hpp>
#endif
namespace nix { namespace nix {
@ -214,12 +209,7 @@ private:
* Transparent lookup of string view for a pointer to a ChunkedVector entry -> return offset into the store. * Transparent lookup of string view for a pointer to a ChunkedVector entry -> return offset into the store.
* ChunkedVector references are never invalidated. * ChunkedVector references are never invalidated.
*/ */
#if USE_FLAT_SYMBOL_SET
boost::unordered_flat_set<SymbolStr, SymbolStr::Hash, SymbolStr::Equal> symbols{SymbolStr::chunkSize}; boost::unordered_flat_set<SymbolStr, SymbolStr::Hash, SymbolStr::Equal> symbols{SymbolStr::chunkSize};
#else
using SymbolValueAlloc = std::pmr::polymorphic_allocator<SymbolStr>;
boost::unordered_set<SymbolStr, SymbolStr::Hash, SymbolStr::Equal, SymbolValueAlloc> symbols{SymbolStr::chunkSize, {&buffer}};
#endif
public: public:
@ -287,5 +277,3 @@ struct std::hash<nix::Symbol>
return std::hash<decltype(s.id)>{}(s.id); return std::hash<decltype(s.id)>{}(s.id);
} }
}; };
#undef USE_FLAT_SYMBOL_SET

View file

@ -41,6 +41,7 @@ boost = dependency(
'boost', 'boost',
modules : ['container', 'context'], modules : ['container', 'context'],
include_type: 'system', include_type: 'system',
version: '>=1.81.0'
) )
# boost is a public dependency, but not a pkg-config dependency unfortunately, so we # boost is a public dependency, but not a pkg-config dependency unfortunately, so we
# put in `deps_other`. # put in `deps_other`.

View file

@ -194,10 +194,6 @@ size_t StringSource::read(char * data, size_t len)
} }
#if BOOST_VERSION >= 106300 && BOOST_VERSION < 106600
#error Coroutines are broken in this version of Boost!
#endif
std::unique_ptr<FinishSink> sourceToSink(std::function<void(Source &)> fun) std::unique_ptr<FinishSink> sourceToSink(std::function<void(Source &)> fun)
{ {
struct SourceToSink : FinishSink struct SourceToSink : FinishSink