mirror of
https://github.com/NixOS/nix
synced 2025-07-07 14:21:48 +02:00
Merge pull request #9594 from obsidiansystems/backport-9563-to-2.19-maintenance
[Backport 2.19-maintenance] [PARTIAL] Give `Derivation::tryResolve` an `evalStore` argument
This commit is contained in:
commit
0fad9ad5b7
2 changed files with 3 additions and 3 deletions
|
@ -1002,13 +1002,13 @@ static void rewriteDerivation(Store & store, BasicDerivation & drv, const String
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::optional<BasicDerivation> Derivation::tryResolve(Store & store) const
|
std::optional<BasicDerivation> Derivation::tryResolve(Store & store, Store * evalStore) const
|
||||||
{
|
{
|
||||||
std::map<std::pair<StorePath, std::string>, StorePath> inputDrvOutputs;
|
std::map<std::pair<StorePath, std::string>, StorePath> inputDrvOutputs;
|
||||||
|
|
||||||
std::function<void(const StorePath &, const DerivedPathMap<StringSet>::ChildNode &)> accum;
|
std::function<void(const StorePath &, const DerivedPathMap<StringSet>::ChildNode &)> accum;
|
||||||
accum = [&](auto & inputDrv, auto & node) {
|
accum = [&](auto & inputDrv, auto & node) {
|
||||||
for (auto & [outputName, outputPath] : store.queryPartialDerivationOutputMap(inputDrv)) {
|
for (auto & [outputName, outputPath] : store.queryPartialDerivationOutputMap(inputDrv, evalStore)) {
|
||||||
if (outputPath) {
|
if (outputPath) {
|
||||||
inputDrvOutputs.insert_or_assign({inputDrv, outputName}, *outputPath);
|
inputDrvOutputs.insert_or_assign({inputDrv, outputName}, *outputPath);
|
||||||
if (auto p = get(node.childMap, outputName))
|
if (auto p = get(node.childMap, outputName))
|
||||||
|
|
|
@ -340,7 +340,7 @@ struct Derivation : BasicDerivation
|
||||||
* 2. Input placeholders are replaced with realized input store
|
* 2. Input placeholders are replaced with realized input store
|
||||||
* paths.
|
* paths.
|
||||||
*/
|
*/
|
||||||
std::optional<BasicDerivation> tryResolve(Store & store) const;
|
std::optional<BasicDerivation> tryResolve(Store & store, Store * evalStore = nullptr) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Like the above, but instead of querying the Nix database for
|
* Like the above, but instead of querying the Nix database for
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue