13#define WORKER_MAGIC_1 0x6e697863
14#define WORKER_MAGIC_2 0x6478696f
18#define PROTOCOL_VERSION (1 << 8 | 39)
19#define MINIMUM_PROTOCOL_VERSION (1 << 8 | 18)
20#define GET_PROTOCOL_MAJOR(x) ((x) & 0xff00)
21#define GET_PROTOCOL_MINOR(x) ((x) & 0x00ff)
22#define STDERR_NEXT 0x6f6c6d67
23#define STDERR_READ 0x64617461
24#define STDERR_WRITE 0x64617416
25#define STDERR_LAST 0x616c7473
26#define STDERR_ERROR 0x63787470
27#define STDERR_START_ACTIVITY 0x53545254
28#define STDERR_STOP_ACTIVITY 0x53544f50
29#define STDERR_RESULT 0x52534c54
43enum BuildMode : uint8_t;
44enum TrustedFlag : bool;
58 enum struct Op : uint64_t;
76 constexpr auto operator<=>(
const Number &)
const =
default;
82 constexpr unsigned int toWire()
const
84 return (major << 8) | minor;
93 .major = (wire & 0xff00) >> 8,
94 .minor =
static_cast<uint8_t
>(wire & 0x00ff),
99 using Feature = std::string;
100 using FeatureSet = std::set<Feature, std::less<>>;
102 FeatureSet features = {};
104 bool operator==(
const Version &)
const =
default;
111 std::partial_ordering operator<=>(
const Version & other)
const;
157 static constexpr std::string_view featureAddTempRoots =
"addTempRoots";
231 WorkerProto::Serialise<T>::write(store, conn, t);
235enum struct WorkerProto::Op : uint64_t {
246 AddIndirectRoot = 12,
253 QuerySubstitutablePathInfo = 21,
254 QueryDerivationOutputs = 22,
255 QueryAllValidPaths = 23,
260 QueryDerivationOutputNames = 28,
261 QueryPathFromHashPart = 29,
262 QuerySubstitutablePathInfos = 30,
263 QueryValidPaths = 31,
264 QuerySubstitutablePaths = 32,
265 QueryValidDerivers = 33,
268 BuildDerivation = 36,
273 QueryDerivationOutputMap = 41,
274 RegisterDrvOutput = 42,
275 QueryRealisation = 43,
276 AddMultipleToStore = 44,
278 BuildPathsWithResults = 46,
284 AddToStoreScanning = 1001,
319inline Sink & operator<<(
Sink & sink, WorkerProto::Op op)
321 return sink << static_cast<uint64_t>(op);
329inline std::ostream & operator<<(std::ostream & s, WorkerProto::Op op)
331 return s << static_cast<uint64_t>(op);
344#define DECLARE_WORKER_SERIALISER(T) \
345 struct WorkerProto::Serialise<T> \
347 static T read(const StoreDirConfig & store, WorkerProto::ReadConn conn); \
348 static void write(const StoreDirConfig & store, WorkerProto::WriteConn conn, const T & t); \
391template<
typename T,
typename Compare>
393template<
typename... Ts>
396template<
typename K,
typename V,
typename Compare>
size_t read(Descriptor fd, std::span< std::byte > buffer)
Definition file-descriptor.cc:30
GCAction
Definition gc-store.hh:30
Definition build-result.hh:123
Definition derived-path.hh:238
Definition realisation.hh:26
Definition gc-store.hh:46
std::variant< WholeStore, SpecificPaths > GCPaths
Definition gc-store.hh:68
Definition build-result.hh:204
Definition realisation.hh:103
Definition derived-path.hh:105
Definition serialise.hh:18
Definition serialise.hh:95
Definition store-dir-config.hh:29
Definition realisation.hh:62
Definition path-info.hh:58
Definition path-info.hh:159
Definition worker-protocol-connection.hh:60
Definition worker-protocol-connection.hh:10
Definition worker-protocol-connection.hh:126
Definition worker-protocol.hh:288
std::optional< std::string > daemonNixVersion
Definition worker-protocol.hh:295
std::optional< TrustedFlag > remoteTrustsUs
Definition worker-protocol.hh:308
Definition worker-protocol.hh:164
Definition worker-protocol-impl.hh:47
Definition worker-protocol.hh:72
static constexpr Number fromWire(unsigned int wire)
Definition worker-protocol.hh:90
constexpr unsigned int toWire() const
Definition worker-protocol.hh:82
Definition worker-protocol.hh:70
Definition worker-protocol.hh:174
Definition worker-protocol.hh:54
static const Version builderRpcV0
Definition worker-protocol.hh:126
static const Version latest
Definition worker-protocol.hh:118
static constexpr std::string_view featureRealisationWithPath
Definition worker-protocol.hh:132
static constexpr std::string_view featureSubmitOutput
Definition worker-protocol.hh:152
static constexpr std::string_view featureAddToStoreScanning
Definition worker-protocol.hh:147
static constexpr std::string_view featureDisableSetOptions
Definition worker-protocol.hh:142
static constexpr std::string_view featureDeleteDeadSpecificReferrers
Definition worker-protocol.hh:137
static void write(const StoreDirConfig &store, WriteConn conn, const T &t)
Definition worker-protocol.hh:229
#define DECLARE_WORKER_SERIALISER(T)
Definition worker-protocol.hh:344