diff --git a/lix/legacy/nix-store.cc b/lix/legacy/nix-store.cc index f3e5c1b25..5d80b7c65 100644 --- a/lix/legacy/nix-store.cc +++ b/lix/legacy/nix-store.cc @@ -534,11 +534,14 @@ static void opDumpDB(AsyncIoRoot & aio, Strings opFlags, Strings opArgs) { if (!opFlags.empty()) throw UsageError("unknown flag"); if (!opArgs.empty()) { - for (auto & i : opArgs) - cout << store->makeValidityRegistration({store->followLinksToStorePath(i)}, true, true); + for (auto & i : opArgs) { + cout << aio.blockOn( + store->makeValidityRegistration({store->followLinksToStorePath(i)}, true, true) + ); + } } else { for (auto & i : store->queryAllValidPaths()) - cout << store->makeValidityRegistration({i}, true, true); + cout << aio.blockOn(store->makeValidityRegistration({i}, true, true)); } } diff --git a/lix/libstore/build/local-derivation-goal.cc b/lix/libstore/build/local-derivation-goal.cc index 803c1b5cf..a9a4437b7 100644 --- a/lix/libstore/build/local-derivation-goal.cc +++ b/lix/libstore/build/local-derivation-goal.cc @@ -574,9 +574,9 @@ try { /* Write closure info to . */ writeFile( tmpDir + "/" + fileName, - worker.store.makeValidityRegistration( + TRY_AWAIT(worker.store.makeValidityRegistration( TRY_AWAIT(worker.store.exportReferences({storePath}, inputPaths)), false, false - ) + )) ); } } diff --git a/lix/libstore/store-api.cc b/lix/libstore/store-api.cc index cc29985b8..082700a39 100644 --- a/lix/libstore/store-api.cc +++ b/lix/libstore/store-api.cc @@ -909,9 +909,9 @@ try { /* Return a string accepted by decodeValidPathInfo() that registers the specified paths as valid. Note: it's the responsibility of the caller to provide a closure. */ -std::string Store::makeValidityRegistration(const StorePathSet & paths, +kj::Promise> Store::makeValidityRegistration(const StorePathSet & paths, bool showDerivers, bool showHash) -{ +try { std::string s = ""; for (auto & i : paths) { @@ -933,7 +933,9 @@ std::string Store::makeValidityRegistration(const StorePathSet & paths, s += printStorePath(j) + "\n"; } - return s; + co_return s; +} catch (...) { + co_return result::current_exception(); } diff --git a/lix/libstore/store-api.hh b/lix/libstore/store-api.hh index 6ef474e30..be0a48c19 100644 --- a/lix/libstore/store-api.hh +++ b/lix/libstore/store-api.hh @@ -682,7 +682,7 @@ public: * can be loaded into the database using `nix-store --load-db` or * `nix-store --register-validity`. */ - std::string makeValidityRegistration(const StorePathSet & paths, + kj::Promise> makeValidityRegistration(const StorePathSet & paths, bool showDerivers, bool showHash); /**