hercules-ci-agent 0.10.6 → 0.10.7
raw patch · 16 files changed
+20/−451 lines, 16 files
Files
- CHANGELOG.md +7/−1
- cbits/hercules-aliases.h +0/−4
- cbits/hercules-error.hh +0/−8
- cbits/hercules-logger.cxx +0/−12
- cbits/hercules-logger.hh +0/−12
- cbits/nix-2.4/hercules-store.cxx +0/−175
- cbits/nix-2.4/hercules-store.hh +0/−110
- hercules-ci-agent-worker/Hercules/Agent/Worker.hs +0/−2
- hercules-ci-agent-worker/Hercules/Agent/Worker/Build/Logger.hs +0/−16
- hercules-ci-agent-worker/Hercules/Agent/Worker/Build/Prefetched.hs +0/−22
- hercules-ci-agent-worker/Hercules/Agent/Worker/Error.hs +0/−7
- hercules-ci-agent-worker/Hercules/Agent/Worker/HerculesStore.hs +0/−16
- hercules-ci-agent.cabal +11/−22
- hercules-ci-agent/Data/Functor/Partitioner.hs +2/−1
- hercules-ci-agent/Hercules/Agent/Init.hs +0/−2
- hercules-ci-nix-daemon/daemon.cc +0/−41
CHANGELOG.md view
@@ -5,7 +5,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [0.10.6] - 2024-05-05+## [0.10.7] - 2025-07-18++### Fixed++- Interrupt signal handling is now more robust++## [0.10.6] - 2025-05-05 ### Added
cbits/hercules-aliases.h view
@@ -4,11 +4,7 @@ #include "hercules-logger.hh" #include <hercules-ci-cnix/store.hxx> #include <hercules-ci-cnix/expr.hxx>-#if NIX_IS_AT_LEAST(2,28,0) #include <nix/store/derivations.hh>-#else-#include "derivations.hh"-#endif // inline-c-cpp doesn't seem to handle namespace operator or template // syntax so we help it a bit for now. This definition can be inlined
cbits/hercules-error.hh view
@@ -1,12 +1,4 @@-#if NIX_IS_AT_LEAST(2, 28, 0)- #include <nix/store/store-api.hh>--#else-#include <nix/config.h>-#include <nix/store-api.hh>-#endif- #include <string> namespace hercules {
cbits/hercules-logger.cxx view
@@ -6,7 +6,6 @@ wakeup.notify_one(); } -#if NIX_IS_AT_LEAST(2, 15, 0) void HerculesLogger::log(nix::Verbosity lvl, std::string_view s) { push(std::make_unique<LogEntry>(LogEntry { .entryType = 1,@@ -14,17 +13,6 @@ .text = std::string(s) })); }-#else-void HerculesLogger::log(nix::Verbosity lvl, const nix::FormatOrString & fs) {- push(std::make_unique<LogEntry>(LogEntry {- .entryType = 1,- .level = lvl,- .text = fs.s- }));-}-#endif-- // TODO structured void HerculesLogger::logEI(const nix::ErrorInfo & ei) {
cbits/hercules-logger.hh view
@@ -1,17 +1,9 @@ #pragma once -#if NIX_IS_AT_LEAST(2, 28, 0) #include <nix/util/error.hh> #include <nix/util/logging.hh> #include <nix/util/sync.hh> #include <nix/main/shared.hh>-#else-#include <nix/config.h>-#include <nix/error.hh>-#include <nix/shared.hh>-#include <nix/sync.hh>-#include <nix/logging.hh>-#endif #include <queue>@@ -45,11 +37,7 @@ Fields fields; }; -#if NIX_IS_AT_LEAST(2, 15, 0) void log(nix::Verbosity lvl, const std::string_view s) override;-#else- void log(nix::Verbosity lvl, const nix::FormatOrString & fs) override;-#endif void startActivity(nix::ActivityId act, nix::Verbosity lvl, nix::ActivityType type, const std::string & s, const Fields & fields, nix::ActivityId parent) override; void stopActivity(nix::ActivityId act) override;
cbits/nix-2.4/hercules-store.cxx view
@@ -3,8 +3,6 @@ #include <memory> #include <math.h> -#if NIX_IS_AT_LEAST(2,28,0)- #include <nix/store/build-result.hh> #include <nix/store/derivations.hh> #include <nix/store/globals.hh>@@ -14,22 +12,6 @@ #include <nix/expr/get-drvs.hh> #include <nix/main/shared.hh> -#else-#include <nix/config.h>-#include <nix/shared.hh>-#include <nix/store-api.hh>-#include <nix/common-eval-args.hh>-#include <nix/get-drvs.hh>-#include <nix/derivations.hh>-#include <nix/globals.hh>-#include <nix/callback.hh>-#if NIX_IS_AT_LEAST(2,7,0)-#include <nix/build-result.hh>-#include <nix/gc-store.hh>-#endif-#include <nix/path-with-outputs.hh>-#endif- #include "hercules-store.hh" using namespace nix;@@ -98,8 +80,6 @@ wrappedStore->addToStore(info, narSource, repair, checkSigs); } -#if NIX_IS_AT_LEAST(2,24,0)- StorePath WrappingStore::addToStore( std::string_view name, const SourcePath & path,@@ -124,89 +104,6 @@ return wrappedStore->addToStoreFromDump(dump, name, dumpMethod, method, hashAlgo, references, repair); } -#elif NIX_IS_AT_LEAST(2,20,0)--StorePath WrappingStore::addToStore(- std::string_view name,- SourceAccessor & accessor,- const CanonPath & path,- ContentAddressMethod method,- HashAlgorithm hashAlgo,- const StorePathSet & references,- PathFilter & filter,- RepairFlag repair)-{- return wrappedStore->addToStore(name, accessor, path, method, hashAlgo, references, filter, repair);-}--StorePath WrappingStore::addToStoreFromDump(- Source & dump,- std::string_view name,- ContentAddressMethod method,- HashAlgorithm hashAlgo,- const StorePathSet & references,- RepairFlag repair)-{- return wrappedStore->addToStoreFromDump(dump, name, method, hashAlgo, references, repair);-}--#else // < 2.20--StorePath WrappingStore::addToStore(-#if NIX_IS_AT_LEAST(2,7,0)- std::string_view name,-#else- const std::string & name,-#endif- const Path & srcPath,- FileIngestionMethod method, HashType hashAlgo,- PathFilter & filter, RepairFlag repair-#if NIX_IS_AT_LEAST(2,5,0)- , const StorePathSet & references-#endif- ) {-- return wrappedStore->addToStore(name, srcPath, method, hashAlgo, filter, repair-#if NIX_IS_AT_LEAST(2,5,0)- , references-#endif- );--}--StorePath WrappingStore::addToStoreFromDump(- Source & dump,-#if NIX_IS_AT_LEAST(2,7,0)- std::string_view name,-#else- const std::string & name,-#endif- FileIngestionMethod method,- HashType hashAlgo,- RepairFlag repair-#if NIX_IS_AT_LEAST(2,5,0)- , const StorePathSet & references-#endif- ) {-- return wrappedStore->addToStoreFromDump(dump, name, method, hashAlgo, repair-#if NIX_IS_AT_LEAST(2,5,0)- , references-#endif- );-}--StorePath WrappingStore::addTextToStore(-#if NIX_IS_AT_LEAST(2,7,0)- std::string_view name, std::string_view s,-#else- const std::string & name, const std::string & s,-#endif- const StorePathSet & references, RepairFlag repair) {- return wrappedStore->addTextToStore(name, s, references, repair);-}-#endif // < 2.20- void WrappingStore::narFromPath(const StorePath& path, Sink& sink) { wrappedStore->narFromPath(path, sink); }@@ -231,44 +128,17 @@ wrappedStore->addTempRoot(path); } -#if !NIX_IS_AT_LEAST(2,5,0)-void WrappingStore::syncWithGC() {- wrappedStore->syncWithGC();-}-#endif- void WrappingStore::optimiseStore() { wrappedStore->optimiseStore(); }; -#if !NIX_IS_AT_LEAST(2,7,0)-void WrappingStore::collectGarbage(const GCOptions& options,- GCResults& results) {- wrappedStore->collectGarbage(options, results);-}--void WrappingStore::addIndirectRoot(const Path& path) {- wrappedStore->addIndirectRoot(path);-}--Roots WrappingStore::findRoots(bool censor) {- return wrappedStore->findRoots(censor);-}-#endif- bool WrappingStore::verifyStore(bool checkContents, RepairFlag repair) { return wrappedStore->verifyStore(checkContents, repair); }; -#if NIX_IS_AT_LEAST(2,19,0) ref<FSAccessor> WrappingStore::getFSAccessor(bool requireValidPath) { return wrappedStore->getFSAccessor(requireValidPath); }-#else-ref<FSAccessor> WrappingStore::getFSAccessor() {- return wrappedStore->getFSAccessor();-}-#endif void WrappingStore::addSignatures(const StorePath& storePath, const StringSet& sigs) {@@ -291,16 +161,6 @@ downloadSize, narSize); } -#if !NIX_IS_AT_LEAST(2,8,0)-# if NIX_IS_AT_LEAST(2,6,0)-std::optional<std::string>-# else-std::shared_ptr<std::string>-# endif-WrappingStore::getBuildLog(const StorePath& path) {- return wrappedStore->getBuildLog(path);-}-#endif void WrappingStore::connect() { wrappedStore->connect();@@ -314,17 +174,10 @@ return wrappedStore->getProtocol(); } -#if ! NIX_IS_AT_LEAST(2,14,0)-void WrappingStore::createUser(const std::string & userName, uid_t userId) {- wrappedStore->createUser(userName, userId);-}-#endif -#if NIX_IS_AT_LEAST(2,15,0) std::optional<TrustedFlag> WrappingStore::isTrustedClient() { return wrappedStore->isTrustedClient(); }-#endif ///// @@ -336,16 +189,10 @@ return "wrapped " + wrappedStore->name(); } -#if NIX_IS_AT_LEAST(2,5,0) void HerculesStore::queryRealisationUncached(const DrvOutput &drvOutput, Callback<std::shared_ptr<const Realisation>> callback) noexcept { wrappedStore->queryRealisation(drvOutput, std::move(callback)); }-#else-std::optional<const Realisation> HerculesStore::queryRealisation(const DrvOutput &drvOut) {- return wrappedStore->queryRealisation(drvOut);-}-#endif void HerculesStore::ensurePath(const StorePath& path) { /* We avoid asking substituters for paths, since@@ -383,7 +230,6 @@ // TODO: don't ignore the Opaques for (auto & derivedPath : derivedPaths) {-#if NIX_IS_AT_LEAST(2,18,0) std::visit(overloaded { [&](const DerivedPathBuilt & b) { // TODO (RFC 92)@@ -414,27 +260,6 @@ // should this be substituted? }, }, derivedPath);-#elif NIX_IS_AT_LEAST(2,13,0)- auto sOrDrvPath = StorePathWithOutputs::tryFromDerivedPath(derivedPath);- std::visit(overloaded {- [&](const StorePathWithOutputs & s) {- // paths.push_back(StorePathWithOutputs { built.drvPath, built.outputs });- paths.push_back(s);- },- [&](const StorePath & drvPath) {- // should this be substituted?- },- }, sOrDrvPath);-#else- std::visit(overloaded {- [&](DerivedPath::Built built) {- paths.push_back(StorePathWithOutputs { built.drvPath, built.outputs });- },- [&](DerivedPath::Opaque opaque) {- // TODO: pass this to the callback as well- },- }, derivedPath.raw());-#endif } builderCallback(pathsPtr, &exceptionToThrow);
cbits/nix-2.4/hercules-store.hh view
@@ -2,31 +2,15 @@ #include <cstring> #include <math.h> -#if NIX_IS_AT_LEAST(2,28,0) #include <nix/util/util.hh> #include <nix/store/derivations.hh> #include <nix/store/path-with-outputs.hh> #include <nix/store/store-api.hh> #include <nix/main/shared.hh> -#else-#include <nix/config.h>-#include <nix/shared.hh>-#include <nix/store-api.hh>-#include <nix/common-eval-args.hh>-#include <nix/get-drvs.hh>-#include <nix/derivations.hh>-#include <nix/globals.hh>-# if NIX_IS_AT_LEAST(2,13,0)-# include <nix/path-with-outputs.hh>-# endif-#endif- #include "HsFFI.h" -#if NIX_IS_AT_LEAST(2,19,0) using FSAccessor = nix::SourceAccessor;-#endif using namespace nix; @@ -74,8 +58,6 @@ virtual void addToStore(const ValidPathInfo & info, Source & narSource, RepairFlag repair = NoRepair, CheckSigsFlag checkSigs = CheckSigs) override; -#if NIX_IS_AT_LEAST(2,24,0)- virtual StorePath addToStore( std::string_view name, const SourcePath & path,@@ -94,67 +76,6 @@ const StorePathSet & references, RepairFlag repair) override; -#elif NIX_IS_AT_LEAST(2,20,0)-- virtual StorePath addToStore(- std::string_view name,- SourceAccessor & accessor,- const CanonPath & path,- ContentAddressMethod method = FileIngestionMethod::Recursive,- HashAlgorithm hashAlgo = HashAlgorithm::SHA256,- const StorePathSet & references = StorePathSet(),- PathFilter & filter = defaultPathFilter,- RepairFlag repair = NoRepair) override;-- virtual StorePath addToStoreFromDump(- Source & dump,- std::string_view name,- ContentAddressMethod method = FileIngestionMethod::Recursive,- HashAlgorithm hashAlgo = HashAlgorithm::SHA256,- const StorePathSet & references = StorePathSet(),- RepairFlag repair = NoRepair) override;---#else // < 2.20- virtual StorePath addToStore(-#if NIX_IS_AT_LEAST(2,7,0)- std::string_view name,-#else- const std::string & name,-#endif- const Path & srcPath,- FileIngestionMethod method = FileIngestionMethod::Recursive, HashType hashAlgo = htSHA256,- PathFilter & filter = defaultPathFilter, RepairFlag repair = NoRepair-#if NIX_IS_AT_LEAST(2,5,0)- , const StorePathSet & references = StorePathSet()-#endif- ) override;-- virtual StorePath addToStoreFromDump(- Source & dump, -#if NIX_IS_AT_LEAST(2,7,0)- std::string_view name,-#else- const std::string & name,-#endif- FileIngestionMethod method = FileIngestionMethod::Recursive,- HashType hashAlgo = htSHA256,- RepairFlag repair = NoRepair-#if NIX_IS_AT_LEAST(2,5,0)- , const StorePathSet & references = StorePathSet()-#endif- ) override;-- virtual StorePath addTextToStore(-#if NIX_IS_AT_LEAST(2,7,0)- std::string_view name, std::string_view s,-#else- const std::string & name, const std::string & s,-#endif- const StorePathSet & references, RepairFlag repair = NoRepair) override;--#endif // < 2.20- virtual void narFromPath(const StorePath & path, Sink & sink) override; virtual void buildPaths(@@ -169,27 +90,13 @@ virtual void addTempRoot(const StorePath & path) override; -#if !NIX_IS_AT_LEAST(2,5,0)- virtual void syncWithGC() override;-#endif -#if !NIX_IS_AT_LEAST(2,7,0)- virtual Roots findRoots(bool censor) override; - virtual void collectGarbage(const GCOptions & options, GCResults & results) override;-- virtual void addIndirectRoot(const Path & path) override;-#endif- virtual void optimiseStore() override; virtual bool verifyStore(bool checkContents, RepairFlag repair = NoRepair) override; -#if NIX_IS_AT_LEAST(2,19,0) virtual ref<FSAccessor> getFSAccessor(bool requireValidPath) override;-#else- virtual ref<FSAccessor> getFSAccessor() override;-#endif virtual void addSignatures(const StorePath & storePath, const StringSet & sigs) override; @@ -201,14 +108,6 @@ StorePathSet & willBuild, StorePathSet & willSubstitute, StorePathSet & unknown, uint64_t & downloadSize, uint64_t & narSize) override; -#if !NIX_IS_AT_LEAST(2,8,0)-# if NIX_IS_AT_LEAST(2,6,0)- virtual std::optional<std::string>-# else- virtual std::shared_ptr<std::string>-# endif- getBuildLog(const StorePath & path) override;-#endif virtual unsigned int getProtocol() override; @@ -216,13 +115,8 @@ virtual Path toRealPath(const Path & storePath) override; -#if ! NIX_IS_AT_LEAST(2,14,0)- virtual void createUser(const std::string & userName, uid_t userId) override;-#endif -#if NIX_IS_AT_LEAST(2,15,0) virtual std::optional<TrustedFlag> isTrustedClient() override;-#endif }; @@ -237,12 +131,8 @@ // Overrides -#if NIX_IS_AT_LEAST(2,5,0) virtual void queryRealisationUncached(const DrvOutput &, Callback<std::shared_ptr<const Realisation>> callback) noexcept override;-#else- virtual std::optional<const Realisation> queryRealisation(const DrvOutput &) override;-#endif virtual void ensurePath(const StorePath & path) override;
hercules-ci-agent-worker/Hercules/Agent/Worker.hs view
@@ -53,7 +53,6 @@ import Hercules.Agent.WorkerProtocol.WorkerConfig qualified import Hercules.CNix as CNix import Hercules.CNix.Expr (allowThreads, init, runGcRegisteredThread, setExtraStackOverflowHandlerToSleep)-import Hercules.CNix.Util (installDefaultSigINTHandler) import Hercules.CNix.Verbosity (setShowTrace, setVerbosity) import Hercules.CNix.Verbosity qualified as CNix.Verbosity import Hercules.Error@@ -72,7 +71,6 @@ Hercules.CNix.Expr.allowThreads setShowTrace True _ <- installHandler sigTERM (Catch $ raiseSignal sigINT) Nothing- installDefaultSigINTHandler setExtraStackOverflowHandlerToSleep workerConfigBytes <- BSC.hGetLine parentHandles.commands workerConfig <- case A.eitherDecode (toS workerConfigBytes) of
hercules-ci-agent-worker/Hercules/Agent/Worker/Build/Logger.hs view
@@ -35,16 +35,7 @@ C.include "<cstring>" -#if NIX_IS_AT_LEAST(2, 28, 0) --- C.include --#else-C.include "<nix/config.h>"-C.include "<nix/shared.hh>"-C.include "<nix/globals.hh>"-#endif- C.include "<hercules-ci-cnix/string.hxx>" C.include "hercules-aliases.h"@@ -57,7 +48,6 @@ initLogger :: IO () initLogger =-#if NIX_IS_AT_LEAST(2, 28, 0) [C.throwBlock| void { nix::logger = std::make_unique<HerculesLogger>(); herculesLogger = dynamic_cast<HerculesLogger *>(nix::logger.get());@@ -65,12 +55,6 @@ throw std::runtime_error("Failed to cast logger to HerculesLogger"); } }|]-#else- [C.throwBlock| void {- herculesLogger = new HerculesLogger();- nix::logger = herculesLogger;- }|]-#endif popMany :: IO (Vector LogEntry) popMany =
hercules-ci-agent-worker/Hercules/Agent/Worker/Build/Prefetched.hs view
@@ -31,33 +31,11 @@ C.include "<cstring>" -#if NIX_IS_AT_LEAST(2, 28, 0)- C.include "<nix/store/build-result.hh>" C.include "<nix/store/derivations.hh>" C.include "<nix/store/path-with-outputs.hh>" C.include "<nix/store/store-api.hh>" C.include "<nix/util/signals.hh>"--#else-C.include "<nix/config.h>"-C.include "<nix/shared.hh>"-C.include "<nix/store-api.hh>"-C.include "<nix/get-drvs.hh>"-C.include "<nix/derivations.hh>"-C.include "<nix/globals.hh>"-# if NIX_IS_AT_LEAST(2,19,0)-C.include "<nix/signals.hh>"-# else--- redundant?-C.include "<nix/fs-accessor.hh>"-# endif-# if NIX_IS_AT_LEAST(2,7,0)-C.include "<nix/build-result.hh>"-# endif--C.include "<nix/path-with-outputs.hh>"-#endif C.include "<hercules-ci-cnix/store.hxx>"
hercules-ci-agent-worker/Hercules/Agent/Worker/Error.hs view
@@ -19,14 +19,7 @@ C.include "<hercules-error.hh>" -#if NIX_IS_AT_LEAST(2, 28, 0)- C.include "<nix/util/error.hh>"--#else-C.include "<nix/error.hh>"-C.include "<nix/util.hh>"-#endif C.include "<iostream>" C.include "<sstream>"
hercules-ci-agent-worker/Hercules/Agent/Worker/HerculesStore.hs view
@@ -36,23 +36,7 @@ C.include "<cstring>" -#if NIX_IS_AT_LEAST(2, 28, 0)- C.include "<nix/main/shared.hh>"--#else-C.include "<nix/config.h>"--C.include "<nix/shared.hh>"--C.include "<nix/store-api.hh>"--C.include "<nix/get-drvs.hh>"--C.include "<nix/derivations.hh>"--C.include "<nix/globals.hh>"-#endif C.include "hercules-aliases.h"
hercules-ci-agent.cabal view
@@ -1,7 +1,7 @@ cabal-version: 2.4 name: hercules-ci-agent-version: 0.10.6+version: 0.10.7 synopsis: Runs Continuous Integration tasks on your machines category: Nix, CI, Testing, DevOps homepage: https://docs.hercules-ci.com@@ -20,9 +20,6 @@ data/default-herculesCI-for-flake.nix testdata/vm-test-run-agent-test.drv -flag nix-2_15- description: Build for Nix >=2.15.0- default: False flag ide description: Whether to enable IDE workarounds. You shouldn't need this.@@ -59,12 +56,8 @@ -- match the C++ language standard Nix is using common cxx-opts- if flag(nix-2_15)- cxx-options:- -std=c++2a- else- cxx-options:- -std=c++17+ cxx-options:+ -std=c++2a cxx-options: -Wall@@ -77,16 +70,11 @@ if impl(ghc >= 8.10) ghc-options: -optcxx-Wall- if flag(nix-2_15)- ghc-options:- -optcxx-std=c++2a- else- ghc-options:- -optcxx-std=c++17+ -optcxx-std=c++2a else -- Remove soon ghc-options:- -optc-std=c++17+ -optc-std=c++2a -optc-Wall if os(darwin) ghc-options: -pgmc=clang++@@ -389,9 +377,10 @@ , uuid , vector pkgconfig-depends:- nix-store >= 2.0- , nix-expr >= 2.0- , nix-main >= 2.0+ nix-store >= 2.28+ , nix-expr >= 2.28+ -- TODO: replace stack overflow detection and remove nix-main+ , nix-main >= 2.28 default-language: Haskell2010 test-suite hercules-ci-agent-unit-tests@@ -484,5 +473,5 @@ default-language: Haskell2010 hs-source-dirs: hercules-ci-nix-daemon pkgconfig-depends:- nix-store >= 2.0- , nix-main >= 2.0+ nix-store >= 2.28+ , nix-main >= 2.28
hercules-ci-agent/Data/Functor/Partitioner.hs view
@@ -20,7 +20,8 @@ import Protolude -- TODO: Profunctor-data Partitioner a b = forall m.+data Partitioner a b+ = forall m. (Monoid m) => Partitioner { ingest :: a -> Maybe m,
hercules-ci-agent/Hercules/Agent/Init.hs view
@@ -15,7 +15,6 @@ import Hercules.Agent.ServiceInfo qualified as ServiceInfo import Hercules.Agent.Token qualified as Token import Hercules.CNix qualified-import Hercules.CNix.Util qualified import Hercules.CNix.Verbosity qualified import Katip qualified as K import Network.HTTP.Client.TLS qualified@@ -78,4 +77,3 @@ initCNix cfg = do Hercules.CNix.init Hercules.CNix.Verbosity.setVerbosity $ Config.nixVerbosity cfg- Hercules.CNix.Util.installDefaultSigINTHandler
hercules-ci-nix-daemon/daemon.cc view
@@ -5,8 +5,6 @@ #include <string_view> -#if NIX_IS_AT_LEAST(2,28,0)- #include <nix/util/error.hh> #include <nix/util/fmt.hh> #include <nix/util/config-global.hh>@@ -15,34 +13,10 @@ #include <nix/store/daemon.hh> #include <nix/main/shared.hh> -#else-#include <nix/config.h>-#include <nix/shared.hh>-#include <nix/error.hh>-#include <nix/util.hh>-#include <nix/globals.hh>-#include <nix/store-api.hh>-#include <nix/daemon.hh>--# if NIX_IS_AT_LEAST(2,19,0)-# include <nix/signals.hh>-# endif--# if NIX_IS_AT_LEAST(2,24,0)-# include <nix/config-global.hh>-# endif-#endif- using namespace nix; -#if NIX_IS_AT_LEAST(2,24,0) using nix::unix::closeOnExec;-#endif -#if ! NIX_IS_AT_LEAST(2,15,0)-using nix::daemon::TrustedFlag;-using nix::daemon::NotTrusted;-#endif static void sigChldHandler(int sigNo) {@@ -119,34 +93,19 @@ ref<Store> store = openStore(); TrustedFlag trusted = NotTrusted; daemon::RecursiveFlag recursive = daemon::NotRecursive;-#if ! NIX_IS_AT_LEAST(2,14,0)- std::function<void(Store &)> authHook = [](Store &){};-#endif daemon::processConnection( store-#if NIX_IS_AT_LEAST(2,24,0) , std::move(from) , std::move(to)-#else- , from- , to-#endif , trusted , recursive-#if ! NIX_IS_AT_LEAST(2,14,0)- , authHook-#endif ); }); } catch (Interrupted & e) { return 0; } catch (Error & error) { ErrorInfo ei = error.info();-#if NIX_IS_AT_LEAST(2,24,0) ei.msg = HintFmt("hercules-ci-nix-daemon: error processing connection: %1%", ei.msg.str());-#else- ei.msg = hintfmt("hercules-ci-nix-daemon: error processing connection: %1%", ei.msg.str());-#endif logError(ei); } }