mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-23 22:46:16 +02:00
Merge branch 'path-info' into ca-drv-exotic
This commit is contained in:
commit
848b0832b5
13 changed files with 38 additions and 30 deletions
|
@ -299,7 +299,7 @@ SV * makeFixedOutputPath(int recursive, char * algo, char * hash, char * name)
|
||||||
.method = method,
|
.method = method,
|
||||||
.hash = h,
|
.hash = h,
|
||||||
},
|
},
|
||||||
{},
|
.references = {},
|
||||||
});
|
});
|
||||||
XPUSHs(sv_2mortal(newSVpv(store()->printStorePath(path).c_str(), 0)));
|
XPUSHs(sv_2mortal(newSVpv(store()->printStorePath(path).c_str(), 0)));
|
||||||
} catch (Error & e) {
|
} catch (Error & e) {
|
||||||
|
|
|
@ -235,7 +235,7 @@ static void fetch(EvalState & state, const PosIdx pos, Value * * args, Value & v
|
||||||
.method = unpack ? FileIngestionMethod::Recursive : FileIngestionMethod::Flat,
|
.method = unpack ? FileIngestionMethod::Recursive : FileIngestionMethod::Flat,
|
||||||
.hash = *expectedHash,
|
.hash = *expectedHash,
|
||||||
},
|
},
|
||||||
{}
|
.references = {}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (state.store->isValidPath(expectedPath)) {
|
if (state.store->isValidPath(expectedPath)) {
|
||||||
|
|
|
@ -215,7 +215,7 @@ StorePath Input::computeStorePath(Store & store) const
|
||||||
.method = FileIngestionMethod::Recursive,
|
.method = FileIngestionMethod::Recursive,
|
||||||
.hash = *narHash,
|
.hash = *narHash,
|
||||||
},
|
},
|
||||||
{},
|
.references = {},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,7 @@ DownloadFileResult downloadFile(
|
||||||
.method = FileIngestionMethod::Flat,
|
.method = FileIngestionMethod::Flat,
|
||||||
.hash = hash,
|
.hash = hash,
|
||||||
},
|
},
|
||||||
{},
|
.references = {},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
hashString(htSHA256, sink.s),
|
hashString(htSHA256, sink.s),
|
||||||
|
|
|
@ -313,7 +313,7 @@ StorePath BinaryCacheStore::addToStoreFromDump(Source & dump, std::string_view n
|
||||||
.method = method,
|
.method = method,
|
||||||
.hash = nar.first,
|
.hash = nar.first,
|
||||||
},
|
},
|
||||||
{
|
.references = {
|
||||||
.references = references,
|
.references = references,
|
||||||
.hasSelfReference = false,
|
.hasSelfReference = false,
|
||||||
},
|
},
|
||||||
|
@ -433,7 +433,7 @@ StorePath BinaryCacheStore::addToStore(
|
||||||
.method = method,
|
.method = method,
|
||||||
.hash = h,
|
.hash = h,
|
||||||
},
|
},
|
||||||
{
|
.references = {
|
||||||
.references = references,
|
.references = references,
|
||||||
.hasSelfReference = false,
|
.hasSelfReference = false,
|
||||||
},
|
},
|
||||||
|
|
|
@ -211,10 +211,16 @@ Hash getContentAddressHash(const ContentAddress & ca)
|
||||||
ContentAddressWithReferences caWithoutRefs(const ContentAddress & ca) {
|
ContentAddressWithReferences caWithoutRefs(const ContentAddress & ca) {
|
||||||
return std::visit(overloaded {
|
return std::visit(overloaded {
|
||||||
[&](const TextHash & h) -> ContentAddressWithReferences {
|
[&](const TextHash & h) -> ContentAddressWithReferences {
|
||||||
return TextInfo { h, {}};
|
return TextInfo {
|
||||||
|
h,
|
||||||
|
.references = {},
|
||||||
|
};
|
||||||
},
|
},
|
||||||
[&](const FixedOutputHash & h) -> ContentAddressWithReferences {
|
[&](const FixedOutputHash & h) -> ContentAddressWithReferences {
|
||||||
return FixedOutputInfo { h, {}};
|
return FixedOutputInfo {
|
||||||
|
h,
|
||||||
|
.references = {},
|
||||||
|
};
|
||||||
},
|
},
|
||||||
}, ca);
|
}, ca);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1426,7 +1426,7 @@ StorePath LocalStore::addToStoreFromDump(Source & source0, std::string_view name
|
||||||
.method = method,
|
.method = method,
|
||||||
.hash = hash,
|
.hash = hash,
|
||||||
},
|
},
|
||||||
{
|
.references = {
|
||||||
.references = references,
|
.references = references,
|
||||||
.hasSelfReference = false,
|
.hasSelfReference = false,
|
||||||
},
|
},
|
||||||
|
|
|
@ -55,7 +55,7 @@ std::map<StorePath, StorePath> makeContentAddressed(
|
||||||
.method = FileIngestionMethod::Recursive,
|
.method = FileIngestionMethod::Recursive,
|
||||||
.hash = narModuloHash,
|
.hash = narModuloHash,
|
||||||
},
|
},
|
||||||
std::move(refs),
|
.references = std::move(refs),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Hash::dummy,
|
Hash::dummy,
|
||||||
|
|
|
@ -232,7 +232,7 @@ std::pair<StorePath, Hash> Store::computeStorePathForPath(std::string_view name,
|
||||||
.method = method,
|
.method = method,
|
||||||
.hash = h,
|
.hash = h,
|
||||||
},
|
},
|
||||||
{},
|
.references = {},
|
||||||
};
|
};
|
||||||
return std::make_pair(makeFixedOutputPath(name, caInfo), h);
|
return std::make_pair(makeFixedOutputPath(name, caInfo), h);
|
||||||
}
|
}
|
||||||
|
@ -442,7 +442,7 @@ ValidPathInfo Store::addToStoreSlow(std::string_view name, const Path & srcPath,
|
||||||
.method = method,
|
.method = method,
|
||||||
.hash = hash,
|
.hash = hash,
|
||||||
},
|
},
|
||||||
{},
|
.references = {},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
narHash,
|
narHash,
|
||||||
|
@ -1270,16 +1270,18 @@ std::optional<StorePathDescriptor> ValidPathInfo::fullStorePathDescriptorOpt() c
|
||||||
return StorePathDescriptor {
|
return StorePathDescriptor {
|
||||||
.name = std::string { path.name() },
|
.name = std::string { path.name() },
|
||||||
.info = std::visit(overloaded {
|
.info = std::visit(overloaded {
|
||||||
[&](const TextHash & th) {
|
[&](const TextHash & th) -> ContentAddressWithReferences {
|
||||||
TextInfo info { th };
|
|
||||||
assert(!hasSelfReference);
|
assert(!hasSelfReference);
|
||||||
info.references = references;
|
return TextInfo {
|
||||||
return ContentAddressWithReferences { info };
|
th,
|
||||||
|
.references = references,
|
||||||
|
};
|
||||||
},
|
},
|
||||||
[&](const FixedOutputHash & foh) {
|
[&](const FixedOutputHash & foh) -> ContentAddressWithReferences {
|
||||||
FixedOutputInfo info { foh };
|
return FixedOutputInfo {
|
||||||
info.references = static_cast<PathReferences<StorePath>>(*this);
|
foh,
|
||||||
return ContentAddressWithReferences { info };
|
.references = static_cast<PathReferences<StorePath>>(*this),
|
||||||
|
};
|
||||||
},
|
},
|
||||||
}, *ca),
|
}, *ca),
|
||||||
};
|
};
|
||||||
|
@ -1338,13 +1340,13 @@ ValidPathInfo::ValidPathInfo(
|
||||||
, narHash(narHash)
|
, narHash(narHash)
|
||||||
{
|
{
|
||||||
std::visit(overloaded {
|
std::visit(overloaded {
|
||||||
[this](const TextInfo & ti) {
|
[this](TextInfo && ti) {
|
||||||
this->references = ti.references;
|
this->references = std::move(ti.references);
|
||||||
this->ca = TextHash { std::move(ti) };
|
this->ca = std::move((TextHash &&) ti);
|
||||||
},
|
},
|
||||||
[this](const FixedOutputInfo & foi) {
|
[this](FixedOutputInfo && foi) {
|
||||||
*(static_cast<PathReferences<StorePath> *>(this)) = foi.references;
|
*(static_cast<PathReferences<StorePath> *>(this)) = std::move(foi.references);
|
||||||
this->ca = FixedOutputHash { (FixedOutputHash) std::move(foi) };
|
this->ca = std::move((FixedOutputHash &&) foi);
|
||||||
},
|
},
|
||||||
}, std::move(info.info));
|
}, std::move(info.info));
|
||||||
}
|
}
|
||||||
|
|
|
@ -220,7 +220,7 @@ static void opPrintFixedPath(Strings opFlags, Strings opArgs)
|
||||||
.method = method,
|
.method = method,
|
||||||
.hash = Hash::parseAny(hash, hashAlgo),
|
.hash = Hash::parseAny(hash, hashAlgo),
|
||||||
},
|
},
|
||||||
{},
|
.references = {},
|
||||||
})));
|
})));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ struct CmdAddToStore : MixDryRun, StoreCommand
|
||||||
.method = std::move(ingestionMethod),
|
.method = std::move(ingestionMethod),
|
||||||
.hash = std::move(hash),
|
.hash = std::move(hash),
|
||||||
},
|
},
|
||||||
{},
|
.references = {},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
narHash,
|
narHash,
|
||||||
|
|
|
@ -72,7 +72,7 @@ std::tuple<StorePath, Hash> prefetchFile(
|
||||||
.method = ingestionMethod,
|
.method = ingestionMethod,
|
||||||
.hash = *expectedHash,
|
.hash = *expectedHash,
|
||||||
},
|
},
|
||||||
{},
|
.references = {},
|
||||||
});
|
});
|
||||||
if (store->isValidPath(*storePath))
|
if (store->isValidPath(*storePath))
|
||||||
hash = expectedHash;
|
hash = expectedHash;
|
||||||
|
|
|
@ -205,7 +205,7 @@ struct ProfileManifest
|
||||||
.method = FileIngestionMethod::Recursive,
|
.method = FileIngestionMethod::Recursive,
|
||||||
.hash = narHash,
|
.hash = narHash,
|
||||||
},
|
},
|
||||||
{ references },
|
.references = { references },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
narHash,
|
narHash,
|
||||||
|
|
Loading…
Reference in a new issue