diff options
author | eldritch horrors <pennae@lix.systems> | 2024-03-04 03:48:50 +0100 |
---|---|---|
committer | eldritch horrors <pennae@lix.systems> | 2024-03-04 04:36:23 +0100 |
commit | ea0008deea7769541fdbf7629bbeb8e9581d73a7 (patch) | |
tree | 603bf030b32f0bb9d39cae9ae345b20678850ecf /src | |
parent | 8867479b2712d244dc3fd3829ba6710a0c14ebab (diff) |
Merge pull request #9094 from obsidiansystems/test-proto
Test the rest of the worker protocol serializers
(cherry picked from commit 2f1c16dfa2378fd8616bff1b9b7cd0b4d42af69b)
Change-Id: Idfd72d32b21d14a260e02f65531d287cef7464d2
Diffstat (limited to 'src')
-rw-r--r-- | src/libstore/build-result.cc | 18 | ||||
-rw-r--r-- | src/libstore/build-result.hh | 3 | ||||
-rw-r--r-- | src/libstore/worker-protocol.hh | 4 |
3 files changed, 23 insertions, 2 deletions
diff --git a/src/libstore/build-result.cc b/src/libstore/build-result.cc new file mode 100644 index 000000000..18f519c5c --- /dev/null +++ b/src/libstore/build-result.cc @@ -0,0 +1,18 @@ +#include "build-result.hh" + +namespace nix { + +GENERATE_CMP_EXT( + , + BuildResult, + me->status, + me->errorMsg, + me->timesBuilt, + me->isNonDeterministic, + me->builtOutputs, + me->startTime, + me->stopTime, + me->cpuUser, + me->cpuSystem); + +} diff --git a/src/libstore/build-result.hh b/src/libstore/build-result.hh index b7a56e791..8840fa7e3 100644 --- a/src/libstore/build-result.hh +++ b/src/libstore/build-result.hh @@ -3,6 +3,7 @@ #include "realisation.hh" #include "derived-path.hh" +#include "comparator.hh" #include <string> #include <chrono> @@ -100,6 +101,8 @@ struct BuildResult */ std::optional<std::chrono::microseconds> cpuUser, cpuSystem; + DECLARE_CMP(BuildResult); + bool success() { return status == Built || status == Substituted || status == AlreadyValid || status == ResolvesToAlreadyValid; diff --git a/src/libstore/worker-protocol.hh b/src/libstore/worker-protocol.hh index 70a5bddb9..b7f42f24d 100644 --- a/src/libstore/worker-protocol.hh +++ b/src/libstore/worker-protocol.hh @@ -208,10 +208,10 @@ MAKE_WORKER_PROTO(ContentAddress); template<> MAKE_WORKER_PROTO(DerivedPath); template<> -MAKE_WORKER_PROTO(Realisation); -template<> MAKE_WORKER_PROTO(DrvOutput); template<> +MAKE_WORKER_PROTO(Realisation); +template<> MAKE_WORKER_PROTO(BuildResult); template<> MAKE_WORKER_PROTO(KeyedBuildResult); |