From c40c887e503bda855a12484902a62984f4b30f01 Mon Sep 17 00:00:00 2001 From: Hamish Mackenzie Date: Tue, 7 Jan 2020 12:38:06 +1300 Subject: [PATCH] Fixes for macOS Building on macOS with the latest nixpkgs master and NixOS/nixpkgs#77147 fails. It seems some `std::experimental` (optional) for instance are not available as `experimental`, but are in `std`. Also `toJSON` is missing for `atomic< unsigned long long >`. --- src/hydra-evaluator/hydra-evaluator.cc | 4 ++-- src/hydra-queue-runner/hydra-queue-runner.cc | 1 + src/libhydra/db.hh | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/hydra-evaluator/hydra-evaluator.cc b/src/hydra-evaluator/hydra-evaluator.cc index 86ac5c39..091a4e9c 100644 --- a/src/hydra-evaluator/hydra-evaluator.cc +++ b/src/hydra-evaluator/hydra-evaluator.cc @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include #include @@ -31,7 +31,7 @@ struct Evaluator typedef std::map Jobsets; - std::experimental::optional evalOne; + std::optional evalOne; const size_t maxEvals; diff --git a/src/hydra-queue-runner/hydra-queue-runner.cc b/src/hydra-queue-runner/hydra-queue-runner.cc index fa7515d3..f97a1c95 100644 --- a/src/hydra-queue-runner/hydra-queue-runner.cc +++ b/src/hydra-queue-runner/hydra-queue-runner.cc @@ -23,6 +23,7 @@ namespace nix { template<> void toJSON>(std::ostream & str, const std::atomic & n) { str << n; } template<> void toJSON>(std::ostream & str, const std::atomic & n) { str << n; } +template<> void toJSON>(std::ostream & str, const std::atomic & n) { str << n; } template<> void toJSON(std::ostream & str, const double & n) { str << n; } } diff --git a/src/libhydra/db.hh b/src/libhydra/db.hh index 5bb5aac5..29af7cc2 100644 --- a/src/libhydra/db.hh +++ b/src/libhydra/db.hh @@ -23,7 +23,7 @@ struct Connection : pqxx::connection class receiver : public pqxx::notification_receiver { - std::experimental::optional status; + std::optional status; public: @@ -35,9 +35,9 @@ public: status = payload; }; - std::experimental::optional get() { + std::optional get() { auto s = status; - status = std::experimental::nullopt; + status = std::nullopt; return s; } };