From 0231453cc5d21a802a630ca0e0ebaab5738f7b82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 20 Sep 2024 08:49:46 +0200 Subject: [PATCH] hydra-eval-jobs: fix build against nix 2.24 --- src/hydra-eval-jobs/Makefile.am | 2 +- src/hydra-eval-jobs/hydra-eval-jobs.cc | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/hydra-eval-jobs/Makefile.am b/src/hydra-eval-jobs/Makefile.am index 90742a307..fb67f89b3 100644 --- a/src/hydra-eval-jobs/Makefile.am +++ b/src/hydra-eval-jobs/Makefile.am @@ -1,5 +1,5 @@ bin_PROGRAMS = hydra-eval-jobs hydra_eval_jobs_SOURCES = hydra-eval-jobs.cc -hydra_eval_jobs_LDADD = $(NIX_LIBS) -lnixcmd +hydra_eval_jobs_LDADD = $(NIX_LIBS) -lnixcmd -lnixflake hydra_eval_jobs_CXXFLAGS = $(NIX_CFLAGS) -I ../libhydra diff --git a/src/hydra-eval-jobs/hydra-eval-jobs.cc b/src/hydra-eval-jobs/hydra-eval-jobs.cc index 5adea42b5..b83cae916 100644 --- a/src/hydra-eval-jobs/hydra-eval-jobs.cc +++ b/src/hydra-eval-jobs/hydra-eval-jobs.cc @@ -6,6 +6,7 @@ #include "shared.hh" #include "store-api.hh" #include "eval.hh" +#include "eval-gc.hh" #include "eval-inline.hh" #include "eval-settings.hh" #include "signals.hh" @@ -125,11 +126,14 @@ static void worker( if (myArgs.flake) { using namespace flake; - auto flakeRef = parseFlakeRef(myArgs.releaseExpr); + auto [flakeRef, fragment, outputSpec] = parseFlakeRefWithFragmentAndExtendedOutputsSpec(fetchSettings, myArgs.releaseExpr, absPath(".")); auto vFlake = state.allocValue(); - auto lockedFlake = lockFlake(state, flakeRef, + auto lockedFlake = lockFlake( + flakeSettings, + state, + flakeRef, LockFlags { .updateLockFile = false, .useRegistries = false, @@ -368,7 +372,11 @@ int main(int argc, char * * argv) ]() { try { - EvalState state(myArgs.lookupPath, openStore()); + auto evalStore = myArgs.evalStoreUrl + ? openStore(*myArgs.evalStoreUrl) + : openStore(); + EvalState state(myArgs.lookupPath, + evalStore, fetchSettings, evalSettings); Bindings & autoArgs = *myArgs.getAutoArgs(state); worker(state, autoArgs, *to, *from); } catch (Error & e) {