forked from lix-project/hydra
Update to latest Lix main
This commit is contained in:
parent
cbe527a3ee
commit
e9d0a3a754
16
flake.lock
16
flake.lock
|
@ -27,11 +27,11 @@
|
|||
"pre-commit-hooks": "pre-commit-hooks"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1718081112,
|
||||
"narHash": "sha256-3cpIVHuyo6yz9n7U/7U/p2Lmwjj1xHdTJR2RkT5JntY=",
|
||||
"lastModified": 1719211568,
|
||||
"narHash": "sha256-oIgmvhe3CV/36LC0KXgqWnKXma39wabks8U9JBMDfO4=",
|
||||
"ref": "refs/heads/main",
|
||||
"rev": "8a3d063a494c4b8c767190a5ce3e4075a75f9d07",
|
||||
"revCount": 15756,
|
||||
"rev": "4c3d93611f2848c56ebc69c85f2b1e18001ed3c7",
|
||||
"revCount": 15877,
|
||||
"type": "git",
|
||||
"url": "https://git@git.lix.systems/lix-project/lix"
|
||||
},
|
||||
|
@ -58,16 +58,16 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1715218190,
|
||||
"narHash": "sha256-R98WOBHkk8wIi103JUVQF3ei3oui4HvoZcz9tYOAwlk=",
|
||||
"lastModified": 1719145550,
|
||||
"narHash": "sha256-K0i/coxxTEl30tgt4oALaylQfxqbotTSNb1/+g+mKMQ=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "9a9960b98418f8c385f52de3b09a63f9c561427a",
|
||||
"rev": "e4509b3a560c87a8d4cb6f9992b8915abf9e36d8",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-23.11",
|
||||
"ref": "nixos-24.05",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
description = "A Nix-based continuous build system";
|
||||
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
|
||||
inputs.nix.url = "git+https://git@git.lix.systems/lix-project/lix";
|
||||
inputs.nix.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
|
|
|
@ -349,14 +349,14 @@ int main(int argc, char * * argv)
|
|||
/* Start a handler thread per worker process. */
|
||||
auto handler = [&]()
|
||||
{
|
||||
pid_t pid = -1;
|
||||
Pid pid;
|
||||
try {
|
||||
AutoCloseFD from, to;
|
||||
|
||||
while (true) {
|
||||
|
||||
/* Start a new worker process if necessary. */
|
||||
if (pid == -1) {
|
||||
if (!pid) {
|
||||
Pipe toPipe, fromPipe;
|
||||
toPipe.create();
|
||||
fromPipe.create();
|
||||
|
@ -383,13 +383,13 @@ int main(int argc, char * * argv)
|
|||
});
|
||||
from = std::move(fromPipe.readSide);
|
||||
to = std::move(toPipe.writeSide);
|
||||
debug("created worker process %d", pid);
|
||||
debug("created worker process %d", pid.get());
|
||||
}
|
||||
|
||||
/* Check whether the existing worker process is still there. */
|
||||
auto s = readLine(from.get());
|
||||
if (s == "restart") {
|
||||
pid = -1;
|
||||
pid.wait();
|
||||
continue;
|
||||
} else if (s != "next") {
|
||||
auto json = nlohmann::json::parse(s);
|
||||
|
@ -455,7 +455,7 @@ int main(int argc, char * * argv)
|
|||
}
|
||||
}
|
||||
} catch (...) {
|
||||
check_pid_status_nonblocking(pid);
|
||||
check_pid_status_nonblocking(pid.release());
|
||||
auto state(state_.lock());
|
||||
state->exc = std::current_exception();
|
||||
wakeup.notify_all();
|
||||
|
|
|
@ -191,7 +191,7 @@ struct Evaluator
|
|||
txn.commit();
|
||||
}
|
||||
|
||||
assert(jobset.pid == -1);
|
||||
assert(jobset.pid);
|
||||
|
||||
jobset.pid = startProcess([&]() {
|
||||
Strings args = { "hydra-eval-jobset", jobset.name.project, jobset.name.jobset };
|
||||
|
@ -206,7 +206,7 @@ struct Evaluator
|
|||
|
||||
bool shouldEvaluate(Jobset & jobset)
|
||||
{
|
||||
if (jobset.pid != -1) {
|
||||
if (jobset.pid) {
|
||||
// Already running.
|
||||
debug("shouldEvaluate %s? no: already running",
|
||||
jobset.name.display());
|
||||
|
@ -330,7 +330,7 @@ struct Evaluator
|
|||
|
||||
if (state->runningEvals < maxEvals) {
|
||||
for (auto & i : state->jobsets)
|
||||
if (i.second.pid == -1 &&
|
||||
if (!i.second.pid &&
|
||||
i.second.checkInterval > 0)
|
||||
sleepTime = std::min(sleepTime, std::chrono::seconds(
|
||||
std::max((time_t) 1, i.second.lastCheckedTime - now + i.second.checkInterval)));
|
||||
|
@ -407,7 +407,7 @@ struct Evaluator
|
|||
for (auto & i : state->jobsets) {
|
||||
auto & jobset(i.second);
|
||||
|
||||
if (jobset.pid == pid) {
|
||||
if (jobset.pid.get() == pid) {
|
||||
printInfo("evaluation of jobset ‘%s’ %s",
|
||||
jobset.name.display(), statusToString(status));
|
||||
|
||||
|
|
|
@ -531,7 +531,7 @@ void State::buildRemote(ref<Store> destStore,
|
|||
{
|
||||
auto activeStepState(activeStep->state_.lock());
|
||||
if (activeStepState->cancelled) throw Error("step cancelled");
|
||||
activeStepState->pid = child.sshPid;
|
||||
activeStepState->pid = child.sshPid.get();
|
||||
}
|
||||
|
||||
Finally clearPid([&]() {
|
||||
|
|
Loading…
Reference in a new issue