diff options
author | Ben Burdette <bburdette@gmail.com> | 2020-05-13 15:56:39 -0600 |
---|---|---|
committer | Ben Burdette <bburdette@gmail.com> | 2020-05-13 15:56:39 -0600 |
commit | ef9dd9f9bc18abc9761812e30a26008c99a26166 (patch) | |
tree | 2e5827206456f2a0f7a94c2e3bf8c9ad5ca39254 /src/libstore | |
parent | d44bac1d9232374bf823ed24f5a5ae693f89fb7d (diff) |
formatting and a few minor changes
Diffstat (limited to 'src/libstore')
-rw-r--r-- | src/libstore/build.cc | 40 | ||||
-rw-r--r-- | src/libstore/gc.cc | 1 | ||||
-rw-r--r-- | src/libstore/local-store.cc | 2 | ||||
-rw-r--r-- | src/libstore/sqlite.cc | 2 | ||||
-rw-r--r-- | src/libstore/sqlite.hh | 2 |
5 files changed, 19 insertions, 28 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc index 961110d58..64bc9c4b8 100644 --- a/src/libstore/build.cc +++ b/src/libstore/build.cc @@ -497,8 +497,8 @@ void handleDiffHook( printError(chomp(diffRes.second)); } catch (Error & error) { ErrorInfo ei = error.info(); - string prevhint = (error.info().hint.has_value() ? error.info().hint->str() : ""); - ei.hint = std::optional(hintfmt("diff hook execution failed: %s", prevhint)); + ei.hint = hintfmt("diff hook execution failed: %s", + (error.info().hint.has_value() ? error.info().hint->str() : "")); logError(ei); } } @@ -1151,7 +1151,7 @@ void DerivationGoal::loadDerivation() if (nrFailed != 0) { logError( - ErrorInfo { + ErrorInfo { .name = "missing derivation during build", .hint = hintfmt("cannot build missing derivation '%s'", worker.store.printStorePath(drvPath)) }); @@ -1306,13 +1306,12 @@ void DerivationGoal::repairClosure() for (auto & i : outputClosure) { if (worker.pathContentsGood(i)) continue; logError( - ErrorInfo { + ErrorInfo { .name = "Corrupt path in closure", .hint = hintfmt( "found corrupted or missing path '%s' in the output closure of '%s'", worker.store.printStorePath(i), worker.store.printStorePath(drvPath)) }); - auto drvPath2 = outputsToDrv.find(i); if (drvPath2 == outputsToDrv.end()) addWaitee(worker.makeSubstitutionGoal(i, Repair)); @@ -1347,7 +1346,7 @@ void DerivationGoal::inputsRealised() if (!useDerivation) throw Error("some dependencies of '%s' are missing", worker.store.printStorePath(drvPath)); logError( - ErrorInfo { + ErrorInfo { .name = "Dependencies could not be built", .hint = hintfmt( "cannot build derivation '%s': %s dependencies couldn't be built", @@ -1811,7 +1810,7 @@ HookReply DerivationGoal::tryBuildHook() } catch (SysError & e) { if (e.errNo == EPIPE) { logError( - ErrorInfo { + ErrorInfo { .name = "Build hook died", .hint = hintfmt( "build hook died unexpectedly: %s", @@ -3676,7 +3675,7 @@ void DerivationGoal::registerOutputs() if (!outputRewrites.empty()) { logWarning( ErrorInfo { - .name = "Rewriting hashes", + .name = "Rewriting hashes", .hint = hintfmt("rewriting hashes in '%1%'; cross fingers", path) }); @@ -3856,7 +3855,7 @@ void DerivationGoal::registerOutputs() throw NotDeterministic(hint); logError( - ErrorInfo { + ErrorInfo { .name = "Output determinism error", .hint = hint }); @@ -4124,7 +4123,7 @@ void DerivationGoal::handleChildOutput(int fd, const string & data) logSize += data.size(); if (settings.maxLogSize && logSize > settings.maxLogSize) { logError( - ErrorInfo { + ErrorInfo { .name = "Max log size exceeded", .hint = hintfmt( "%1% killed after writing more than %2% bytes of log output", @@ -4447,9 +4446,9 @@ void SubstitutionGoal::tryNext() { logWarning( ErrorInfo { - .name = "Invalid path signature", + .name = "Invalid path signature", .hint = hintfmt("substituter '%s' does not have a valid signature for path '%s'", - sub->getUri(), worker.store.printStorePath(storePath)) + sub->getUri(), worker.store.printStorePath(storePath)) }); tryNext(); return; @@ -4809,7 +4808,7 @@ void Worker::run(const Goals & _topGoals) if (!children.empty() || !waitingForAWhile.empty()) waitForInput(); else { - if (awake.empty() && 0 == settings.maxBuildJobs) + if (awake.empty() && 0 == settings.maxBuildJobs) throw Error("unable to start any build; either increase '--max-jobs' " "or enable remote builds"); assert(!awake.empty()); @@ -4933,7 +4932,7 @@ void Worker::waitForInput() after - j->lastOutput >= std::chrono::seconds(settings.maxSilentTime)) { logError( - ErrorInfo { + ErrorInfo { .name = "Silent build timeout", .hint = hintfmt( "%1% timed out after %2% seconds of silence", @@ -4948,7 +4947,7 @@ void Worker::waitForInput() after - j->timeStarted >= std::chrono::seconds(settings.buildTimeout)) { logError( - ErrorInfo { + ErrorInfo { .name = "Build timeout", .hint = hintfmt( "%1% timed out after %2% seconds", @@ -4969,9 +4968,6 @@ void Worker::waitForInput() } - - - unsigned int Worker::exitStatus() { /* @@ -5015,9 +5011,9 @@ bool Worker::pathContentsGood(const StorePath & path) res = info->narHash == nullHash || info->narHash == current.first; } pathContentsGoodCache.insert_or_assign(path.clone(), res); - if (!res) + if (!res) logError( - ErrorInfo { + ErrorInfo { .name = "Corrupted path", .hint = hintfmt("path '%s' is corrupted or missing!", store.printStorePath(path)) }); @@ -5136,8 +5132,4 @@ void LocalStore::repairPath(const StorePath & path) } - } - - - diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc index d53d458e9..92f9328c3 100644 --- a/src/libstore/gc.cc +++ b/src/libstore/gc.cc @@ -129,7 +129,6 @@ Path LocalFSStore::addPermRoot(const StorePath & storePath, if (settings.checkRootReachability) { auto roots = findRoots(false); if (roots[storePath.clone()].count(gcRoot) == 0) - logWarning( ErrorInfo { .name = "GC root", diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc index 194eefc78..6f88a3e32 100644 --- a/src/libstore/local-store.cc +++ b/src/libstore/local-store.cc @@ -504,7 +504,7 @@ static void canonicalisePathMetaData_(const Path & path, uid_t fromUid, InodesSe chown(path.c_str(), geteuid(), getegid()) == -1) #endif throw SysError("changing owner of '%1%' to %2%", - path, geteuid()); + path, geteuid()); } if (S_ISDIR(st.st_mode)) { diff --git a/src/libstore/sqlite.cc b/src/libstore/sqlite.cc index 34ef5e57b..16cdb6619 100644 --- a/src/libstore/sqlite.cc +++ b/src/libstore/sqlite.cc @@ -196,7 +196,7 @@ SQLiteTxn::~SQLiteTxn() } } -void handleSQLiteBusy(SQLiteBusy & e) +void handleSQLiteBusy(const SQLiteBusy & e) { static std::atomic<time_t> lastWarned{0}; diff --git a/src/libstore/sqlite.hh b/src/libstore/sqlite.hh index ccfac48d8..dd81ab051 100644 --- a/src/libstore/sqlite.hh +++ b/src/libstore/sqlite.hh @@ -99,7 +99,7 @@ MakeError(SQLiteBusy, SQLiteError); [[noreturn]] void throwSQLiteError(sqlite3 * db, const FormatOrString & fs); -void handleSQLiteBusy(SQLiteBusy & e); +void handleSQLiteBusy(const SQLiteBusy & e); /* Convenience function for retrying a SQLite transaction when the database is busy. */ |