From 803b8ee731bedc4c5114562e916e60e92f045518 Mon Sep 17 00:00:00 2001 From: leo60228 Date: Fri, 10 May 2024 14:35:46 -0400 Subject: [PATCH] Revert "Update to Nix 2.19" This reverts commit c922e73c11449759c8e1945ed01fb4cd120ef57d. --- src/hydra-eval-jobs/hydra-eval-jobs.cc | 6 ++---- src/hydra-evaluator/hydra-evaluator.cc | 1 - src/hydra-queue-runner/build-remote.cc | 2 -- src/hydra-queue-runner/build-result.cc | 12 ++++++------ src/hydra-queue-runner/hydra-queue-runner.cc | 3 +-- src/hydra-queue-runner/nar-extractor.cc | 12 +++--------- src/hydra-queue-runner/nar-extractor.hh | 4 ++-- src/libhydra/db.hh | 1 - src/libhydra/hydra-config.hh | 1 - 9 files changed, 14 insertions(+), 28 deletions(-) diff --git a/src/hydra-eval-jobs/hydra-eval-jobs.cc b/src/hydra-eval-jobs/hydra-eval-jobs.cc index 5cfc3a52..9cc1d50c 100644 --- a/src/hydra-eval-jobs/hydra-eval-jobs.cc +++ b/src/hydra-eval-jobs/hydra-eval-jobs.cc @@ -8,8 +8,6 @@ #include "eval.hh" #include "eval-inline.hh" #include "eval-settings.hh" -#include "signals.hh" -#include "terminal.hh" #include "util.hh" #include "get-drvs.hh" #include "globals.hh" @@ -97,7 +95,7 @@ static std::string queryMetaStrings(EvalState & state, DrvInfo & drv, const std: rec = [&](Value & v) { state.forceValue(v, noPos); if (v.type() == nString) - res.emplace_back(v.string_view()); + res.push_back(v.string.s); else if (v.isList()) for (unsigned int n = 0; n < v.listSize(); ++n) rec(*v.listElems()[n]); @@ -228,7 +226,7 @@ static void worker( auto v = a->value->listElems()[n]; state.forceValue(*v, noPos); if (v->type() == nString) - job["namedConstituents"].push_back(v->string_view()); + job["namedConstituents"].push_back(v->str()); } } diff --git a/src/hydra-evaluator/hydra-evaluator.cc b/src/hydra-evaluator/hydra-evaluator.cc index 75506ff8..a1ccf047 100644 --- a/src/hydra-evaluator/hydra-evaluator.cc +++ b/src/hydra-evaluator/hydra-evaluator.cc @@ -2,7 +2,6 @@ #include "hydra-config.hh" #include "pool.hh" #include "shared.hh" -#include "signals.hh" #include #include diff --git a/src/hydra-queue-runner/build-remote.cc b/src/hydra-queue-runner/build-remote.cc index 02b82d2b..f9e61df5 100644 --- a/src/hydra-queue-runner/build-remote.cc +++ b/src/hydra-queue-runner/build-remote.cc @@ -9,8 +9,6 @@ #include "path.hh" #include "serve-protocol.hh" #include "state.hh" -#include "current-process.hh" -#include "processes.hh" #include "util.hh" #include "serve-protocol.hh" #include "serve-protocol-impl.hh" diff --git a/src/hydra-queue-runner/build-result.cc b/src/hydra-queue-runner/build-result.cc index ffdc37b7..b5c99317 100644 --- a/src/hydra-queue-runner/build-result.cc +++ b/src/hydra-queue-runner/build-result.cc @@ -1,7 +1,7 @@ #include "hydra-build-result.hh" #include "store-api.hh" #include "util.hh" -#include "source-accessor.hh" +#include "fs-accessor.hh" #include @@ -63,7 +63,7 @@ BuildOutput getBuildOutput( auto productsFile = narMembers.find(outputS + "/nix-support/hydra-build-products"); if (productsFile == narMembers.end() || - productsFile->second.type != SourceAccessor::Type::tRegular) + productsFile->second.type != FSAccessor::Type::tRegular) continue; assert(productsFile->second.contents); @@ -94,7 +94,7 @@ BuildOutput getBuildOutput( product.name = product.path == store->printStorePath(output) ? "" : baseNameOf(product.path); - if (file->second.type == SourceAccessor::Type::tRegular) { + if (file->second.type == FSAccessor::Type::tRegular) { product.isRegular = true; product.fileSize = file->second.fileSize.value(); product.sha256hash = file->second.sha256.value(); @@ -116,7 +116,7 @@ BuildOutput getBuildOutput( auto file = narMembers.find(product.path); assert(file != narMembers.end()); - if (file->second.type == SourceAccessor::Type::tDirectory) + if (file->second.type == FSAccessor::Type::tDirectory) res.products.push_back(product); } } @@ -125,7 +125,7 @@ BuildOutput getBuildOutput( for (auto & output : outputs) { auto file = narMembers.find(store->printStorePath(output) + "/nix-support/hydra-release-name"); if (file == narMembers.end() || - file->second.type != SourceAccessor::Type::tRegular) + file->second.type != FSAccessor::Type::tRegular) continue; res.releaseName = trim(file->second.contents.value()); // FIXME: validate release name @@ -135,7 +135,7 @@ BuildOutput getBuildOutput( for (auto & output : outputs) { auto file = narMembers.find(store->printStorePath(output) + "/nix-support/hydra-metrics"); if (file == narMembers.end() || - file->second.type != SourceAccessor::Type::tRegular) + file->second.type != FSAccessor::Type::tRegular) continue; for (auto & line : tokenizeString(file->second.contents.value(), "\n")) { auto fields = tokenizeString>(line); diff --git a/src/hydra-queue-runner/hydra-queue-runner.cc b/src/hydra-queue-runner/hydra-queue-runner.cc index b6eca0d1..5f288dc7 100644 --- a/src/hydra-queue-runner/hydra-queue-runner.cc +++ b/src/hydra-queue-runner/hydra-queue-runner.cc @@ -11,7 +11,6 @@ #include -#include "signals.hh" #include "state.hh" #include "hydra-build-result.hh" #include "store-api.hh" @@ -535,7 +534,7 @@ void State::markSucceededBuild(pqxx::work & txn, Build::ptr build, product.type, product.subtype, product.fileSize ? std::make_optional(*product.fileSize) : std::nullopt, - product.sha256hash ? std::make_optional(product.sha256hash->to_string(HashFormat::Base16, false)) : std::nullopt, + product.sha256hash ? std::make_optional(product.sha256hash->to_string(Base16, false)) : std::nullopt, product.path, product.name, product.defaultPath); diff --git a/src/hydra-queue-runner/nar-extractor.cc b/src/hydra-queue-runner/nar-extractor.cc index 3c6857bf..9f0eb431 100644 --- a/src/hydra-queue-runner/nar-extractor.cc +++ b/src/hydra-queue-runner/nar-extractor.cc @@ -24,13 +24,13 @@ struct Extractor : ParseSink void createDirectory(const Path & path) override { - members.insert_or_assign(prefix + path, NarMemberData { .type = SourceAccessor::Type::tDirectory }); + members.insert_or_assign(prefix + path, NarMemberData { .type = FSAccessor::Type::tDirectory }); } void createRegularFile(const Path & path) override { curMember = &members.insert_or_assign(prefix + path, NarMemberData { - .type = SourceAccessor::Type::tRegular, + .type = FSAccessor::Type::tRegular, .fileSize = 0, .contents = filesToKeep.count(path) ? std::optional("") : std::nullopt, }).first->second; @@ -66,14 +66,8 @@ struct Extractor : ParseSink void createSymlink(const Path & path, const std::string & target) override { - members.insert_or_assign(prefix + path, NarMemberData { .type = SourceAccessor::Type::tSymlink }); + members.insert_or_assign(prefix + path, NarMemberData { .type = FSAccessor::Type::tSymlink }); } - - void isExecutable() override - { } - - void closeRegularFile() override - { } }; diff --git a/src/hydra-queue-runner/nar-extractor.hh b/src/hydra-queue-runner/nar-extractor.hh index 2634135b..45b2706c 100644 --- a/src/hydra-queue-runner/nar-extractor.hh +++ b/src/hydra-queue-runner/nar-extractor.hh @@ -1,13 +1,13 @@ #pragma once -#include "source-accessor.hh" +#include "fs-accessor.hh" #include "types.hh" #include "serialise.hh" #include "hash.hh" struct NarMemberData { - nix::SourceAccessor::Type type; + nix::FSAccessor::Type type; std::optional fileSize; std::optional contents; std::optional sha256; diff --git a/src/libhydra/db.hh b/src/libhydra/db.hh index 1e927573..00e8f406 100644 --- a/src/libhydra/db.hh +++ b/src/libhydra/db.hh @@ -2,7 +2,6 @@ #include -#include "environment-variables.hh" #include "util.hh" diff --git a/src/libhydra/hydra-config.hh b/src/libhydra/hydra-config.hh index b1275896..1688c278 100644 --- a/src/libhydra/hydra-config.hh +++ b/src/libhydra/hydra-config.hh @@ -2,7 +2,6 @@ #include -#include "file-system.hh" #include "util.hh" struct HydraConfig