diff --git a/lix/libstore/build/derivation-goal.cc b/lix/libstore/build/derivation-goal.cc index bd5bd9461..2fcfb36d1 100644 --- a/lix/libstore/build/derivation-goal.cc +++ b/lix/libstore/build/derivation-goal.cc @@ -1159,7 +1159,9 @@ try { auto & drvStore = worker.evalStore.isValidPath(drvPath) ? worker.evalStore : worker.store; - newRealisation.dependentRealisations = drvOutputReferences(worker.store, *drv, realisation.outPath, &drvStore); + newRealisation.dependentRealisations = TRY_AWAIT( + drvOutputReferences(worker.store, *drv, realisation.outPath, &drvStore) + ); } signRealisation(newRealisation); worker.store.registerDrvOutput(newRealisation); @@ -1180,9 +1182,9 @@ try { if (status == BuildResult::AlreadyValid) status = BuildResult::ResolvesToAlreadyValid; - return {done(status, std::move(builtOutputs))}; + co_return done(status, std::move(builtOutputs)); } catch (...) { - return {result::current_exception()}; + co_return result::current_exception(); } HookReply DerivationGoal::tryBuildHook() diff --git a/lix/libstore/misc.cc b/lix/libstore/misc.cc index 368d3d106..627bba0e6 100644 --- a/lix/libstore/misc.cc +++ b/lix/libstore/misc.cc @@ -352,10 +352,10 @@ StorePaths Store::topoSortPaths(const StorePathSet & paths) }}); } -std::map drvOutputReferences( +static kj::Promise>> drvOutputReferences( const std::set & inputRealisations, const StorePathSet & pathReferences) -{ +try { std::map res; for (const auto & input : inputRealisations) { @@ -364,15 +364,17 @@ std::map drvOutputReferences( } } - return res; + co_return res; +} catch (...) { + co_return result::current_exception(); } -std::map drvOutputReferences( +kj::Promise>> drvOutputReferences( Store & store, const Derivation & drv, const StorePath & outputPath, Store * evalStore_) -{ +try { auto & evalStore = evalStore_ ? *evalStore_ : store; std::set inputRealisations; @@ -415,7 +417,11 @@ std::map drvOutputReferences( auto info = store.queryPathInfo(outputPath); - return drvOutputReferences(Realisation::closure(store, inputRealisations), info->references); + co_return TRY_AWAIT( + drvOutputReferences(Realisation::closure(store, inputRealisations), info->references) + ); +} catch (...) { + co_return result::current_exception(); } OutputPathMap resolveDerivedPath(Store & store, const DerivedPath::Built & bfd, Store * evalStore_) diff --git a/lix/libstore/store-api.hh b/lix/libstore/store-api.hh index 14b7bb98c..363735ae7 100644 --- a/lix/libstore/store-api.hh +++ b/lix/libstore/store-api.hh @@ -1074,7 +1074,7 @@ std::pair splitUriAndParams(const std::string const ContentAddress * getDerivationCA(const BasicDerivation & drv); -std::map drvOutputReferences( +kj::Promise>> drvOutputReferences( Store & store, const Derivation & drv, const StorePath & outputPath,