update flake locks, fix compile errors

This commit is contained in:
eldritch horrors 2024-08-12 21:55:36 +02:00
parent db8c2cc4a8
commit f1b552ecbf
7 changed files with 44 additions and 31 deletions

View file

@ -48,11 +48,11 @@
"pre-commit-hooks": "pre-commit-hooks" "pre-commit-hooks": "pre-commit-hooks"
}, },
"locked": { "locked": {
"lastModified": 1721091462, "lastModified": 1723331518,
"narHash": "sha256-0cmEeoOiB91BviTJHzIyxkY+Gxv3O8ZnnExVAoXEFGI=", "narHash": "sha256-JVnQ3OLbXQAlkOluFc3gWhZMbhared1Rg5YvNEc92m0=",
"ref": "refs/heads/main", "ref": "refs/heads/main",
"rev": "6b4d46e9e0e1dd80e0977684ab20d14bcd1a6bc3", "rev": "5137cea99044d54337e439510a647743110b2d7d",
"revCount": 15967, "revCount": 16128,
"type": "git", "type": "git",
"url": "https://git.lix.systems/lix-project/lix" "url": "https://git.lix.systems/lix-project/lix"
}, },
@ -111,11 +111,11 @@
"nix2container": { "nix2container": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1712990762, "lastModified": 1720642556,
"narHash": "sha256-hO9W3w7NcnYeX8u8cleHiSpK2YJo7ecarFTUlbybl7k=", "narHash": "sha256-qsnqk13UmREKmRT7c8hEnz26X3GFFyIQrqx4EaRc1Is=",
"owner": "nlewo", "owner": "nlewo",
"repo": "nix2container", "repo": "nix2container",
"rev": "20aad300c925639d5d6cbe30013c8357ce9f2a2e", "rev": "3853e5caf9ad24103b13aa6e0e8bcebb47649fe4",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -126,11 +126,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1720691131, "lastModified": 1723282977,
"narHash": "sha256-CWT+KN8aTPyMIx8P303gsVxUnkinIz0a/Cmasz1jyIM=", "narHash": "sha256-oTK91aOlA/4IsjNAZGMEBz7Sq1zBS0Ltu4/nIQdYDOg=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "a046c1202e11b62cbede5385ba64908feb7bfac4", "rev": "a781ff33ae258bbcfd4ed6e673860c3e923bf2cc",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -159,11 +159,11 @@
"pre-commit-hooks": { "pre-commit-hooks": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1712055707, "lastModified": 1721042469,
"narHash": "sha256-4XLvuSIDZJGS17xEwSrNuJLL7UjDYKGJSbK1WWX2AK8=", "narHash": "sha256-6FPUl7HVtvRHCCBQne7Ylp4p+dpP3P/OYuzjztZ4s70=",
"owner": "cachix", "owner": "cachix",
"repo": "git-hooks.nix", "repo": "git-hooks.nix",
"rev": "e35aed5fda3cc79f88ed7f1795021e559582093a", "rev": "f451c19376071a90d8c58ab1a953c6e9840527fd",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -368,7 +368,7 @@ static std::map<StorePath, ValidPathInfo> queryPathInfos(
auto references = ServeProto::Serialise<StorePathSet>::read(localStore, conn); auto references = ServeProto::Serialise<StorePathSet>::read(localStore, conn);
readLongLong(conn.from); // download size readLongLong(conn.from); // download size
auto narSize = readLongLong(conn.from); auto narSize = readLongLong(conn.from);
auto narHash = Hash::parseAny(readString(conn.from), htSHA256); auto narHash = Hash::parseAny(readString(conn.from), HashType::SHA256);
auto ca = ContentAddress::parseOpt(readString(conn.from)); auto ca = ContentAddress::parseOpt(readString(conn.from));
readStrings<StringSet>(conn.from); // sigs readStrings<StringSet>(conn.from); // sigs
ValidPathInfo info(localStore.parseStorePath(storePathS), narHash); ValidPathInfo info(localStore.parseStorePath(storePathS), narHash);
@ -397,8 +397,7 @@ static void copyPathFromRemote(
/* Receive the NAR from the remote and add it to the /* Receive the NAR from the remote and add it to the
destination store. Meanwhile, extract all the info from the destination store. Meanwhile, extract all the info from the
NAR that getBuildOutput() needs. */ NAR that getBuildOutput() needs. */
auto source2 = sinkToSource([&](Sink & sink) auto coro = [&]() -> WireFormatGenerator {
{
/* Note: we should only send the command to dump the store /* Note: we should only send the command to dump the store
path to the remote if the NAR is actually going to get read path to the remote if the NAR is actually going to get read
by the destination store, which won't happen if this path by the destination store, which won't happen if this path
@ -409,11 +408,11 @@ static void copyPathFromRemote(
conn.to << ServeProto::Command::DumpStorePath << localStore.printStorePath(info.path); conn.to << ServeProto::Command::DumpStorePath << localStore.printStorePath(info.path);
conn.to.flush(); conn.to.flush();
TeeSource tee(conn.from, sink); co_yield extractNarDataFilter(conn.from, localStore.printStorePath(info.path), narMembers);
extractNarData(tee, localStore.printStorePath(info.path), narMembers); };
}); GeneratorSource source2{coro()};
destStore.addToStore(info, *source2, NoRepair, NoCheckSigs); destStore.addToStore(info, source2, NoRepair, NoCheckSigs);
} }
static void copyPathsFromRemote( static void copyPathsFromRemote(

View file

@ -34,11 +34,8 @@ BuildOutput getBuildOutput(
auto outputS = store->printStorePath(output); auto outputS = store->printStorePath(output);
if (!narMembers.count(outputS)) { if (!narMembers.count(outputS)) {
printInfo("fetching NAR contents of '%s'...", outputS); printInfo("fetching NAR contents of '%s'...", outputS);
auto source = sinkToSource([&](Sink & sink) GeneratorSource source{store->narFromPath(output)};
{ extractNarData(source, outputS, narMembers);
sink << store->narFromPath(output);
});
extractNarData(*source, outputS, narMembers);
} }
} }

View file

@ -534,7 +534,7 @@ void State::markSucceededBuild(pqxx::work & txn, Build::ptr build,
product.type, product.type,
product.subtype, product.subtype,
product.fileSize ? std::make_optional(*product.fileSize) : std::nullopt, product.fileSize ? std::make_optional(*product.fileSize) : std::nullopt,
product.sha256hash ? std::make_optional(product.sha256hash->to_string(Base16, false)) : std::nullopt, product.sha256hash ? std::make_optional(product.sha256hash->to_string(Base::Base16, false)) : std::nullopt,
product.path, product.path,
product.name, product.name,
product.defaultPath); product.defaultPath);

View file

@ -42,7 +42,7 @@ struct Extractor : ParseSink
void preallocateContents(uint64_t size) override void preallocateContents(uint64_t size) override
{ {
expectedSize = size; expectedSize = size;
hashSink = std::make_unique<HashSink>(htSHA256); hashSink = std::make_unique<HashSink>(HashType::SHA256);
} }
void receiveContents(std::string_view data) override void receiveContents(std::string_view data) override
@ -76,7 +76,19 @@ void extractNarData(
const Path & prefix, const Path & prefix,
NarMemberDatas & members) NarMemberDatas & members)
{ {
Extractor extractor(members, prefix); auto parser = extractNarDataFilter(source, prefix, members);
parseDump(extractor, source); while (parser.next()) {
// Note: this point may not be reached if we're in a coroutine. // ignore raw data
}
}
nix::WireFormatGenerator extractNarDataFilter(
Source & source,
const Path & prefix,
NarMemberDatas & members)
{
return [](Source & source, const Path & prefix, NarMemberDatas & members) -> WireFormatGenerator {
Extractor extractor(members, prefix);
co_yield parseAndCopyDump(extractor, source);
}(source, prefix, members);
} }

View file

@ -21,3 +21,8 @@ void extractNarData(
nix::Source & source, nix::Source & source,
const nix::Path & prefix, const nix::Path & prefix,
NarMemberDatas & members); NarMemberDatas & members);
nix::WireFormatGenerator extractNarDataFilter(
nix::Source & source,
const nix::Path & prefix,
NarMemberDatas & members);

View file

@ -727,7 +727,7 @@ BuildOutput State::getBuildOutputCached(Connection & conn, nix::ref<nix::Store>
product.fileSize = row[2].as<off_t>(); product.fileSize = row[2].as<off_t>();
} }
if (!row[3].is_null()) if (!row[3].is_null())
product.sha256hash = Hash::parseAny(row[3].as<std::string>(), htSHA256); product.sha256hash = Hash::parseAny(row[3].as<std::string>(), HashType::SHA256);
if (!row[4].is_null()) if (!row[4].is_null())
product.path = row[4].as<std::string>(); product.path = row[4].as<std::string>();
product.name = row[5].as<std::string>(); product.name = row[5].as<std::string>();