1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-24 18:01:16 +02:00

Merge pull request #12663 from obsidiansystems/local-derivation-goal-encapsulation

Separate derivation building from the scheduler
This commit is contained in:
mergify[bot] 2025-04-16 22:33:25 +00:00 committed by GitHub
commit b509502bd5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 472 additions and 207 deletions

View file

@ -5,31 +5,17 @@
#include "nix/util/processes.hh"
#include "nix/util/config-global.hh"
#include "nix/store/build/worker.hh"
#include "nix/store/builtins.hh"
#include "nix/store/builtins/buildenv.hh"
#include "nix/util/references.hh"
#include "nix/util/finally.hh"
#include "nix/util/util.hh"
#include "nix/util/archive.hh"
#include "nix/util/compression.hh"
#include "nix/store/common-protocol.hh"
#include "nix/store/common-protocol-impl.hh"
#include "nix/util/topo-sort.hh"
#include "nix/util/callback.hh"
#include "nix/store/local-store.hh" // TODO remove, along with remaining downcasts
#include <regex>
#include <queue>
#include <fstream>
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
#ifndef _WIN32 // TODO abstract over proc exit status
# include <sys/wait.h>
#endif
#include <nlohmann/json.hpp>
#include "nix/util/strings.hh"
@ -879,11 +865,7 @@ void runPostBuildHook(
}
void appendLogTailErrorMsg(
const Store & store,
const StorePath & drvPath,
const std::list<std::string> & logTail,
std::string & msg)
void DerivationGoal::appendLogTailErrorMsg(std::string & msg)
{
if (!logger->isVerbose() && !logTail.empty()) {
msg += fmt(";\nlast %d log lines:\n", logTail.size());
@ -900,7 +882,7 @@ void appendLogTailErrorMsg(
// command will not put it at the start of the line unfortunately.
msg += fmt("For full logs, run:\n " ANSI_BOLD "%s %s" ANSI_NORMAL,
nixLogCommand,
store.printStorePath(drvPath));
worker.store.printStorePath(drvPath));
}
}
@ -947,7 +929,7 @@ Goal::Co DerivationGoal::hookDone()
Magenta(worker.store.printStorePath(drvPath)),
statusToString(status));
appendLogTailErrorMsg(worker.store, drvPath, logTail, msg);
appendLogTailErrorMsg(msg);
outputLocks.unlock();

View file

@ -63,13 +63,6 @@ void runPostBuildHook(
const StorePath & drvPath,
const StorePathSet & outputPaths);
/** Used internally */
void appendLogTailErrorMsg(
const Store & store,
const StorePath & drvPath,
const std::list<std::string> & logTail,
std::string & msg);
/**
* A goal for building some or all of the outputs of a derivation.
*/
@ -306,6 +299,8 @@ struct DerivationGoal : public Goal
SingleDrvOutputs builtOutputs = {},
std::optional<Error> ex = {});
void appendLogTailErrorMsg(std::string & msg);
StorePathSet exportReferences(const StorePathSet & storePaths);
JobCategory jobCategory() const override {

File diff suppressed because it is too large Load diff