mirror of
https://github.com/NixOS/nix.git
synced 2025-11-27 12:41:00 +01:00
DummyStore build trace holds UnkeyedRealisation by value
Otherwise the equality instance we need to add will be messed up.
This commit is contained in:
parent
f78e88c973
commit
b0c016ae7d
3 changed files with 5 additions and 6 deletions
|
|
@ -27,7 +27,7 @@ TEST(DummyStore, realisation_read)
|
|||
.outPath = StorePath{"g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo.drv"},
|
||||
};
|
||||
|
||||
store->buildTrace.insert({drvHash, {{outputName, make_ref<UnkeyedRealisation>(value)}}});
|
||||
store->buildTrace.insert({drvHash, {{outputName, value}}});
|
||||
|
||||
auto value2 = store->queryRealisation({drvHash, outputName});
|
||||
|
||||
|
|
|
|||
|
|
@ -320,9 +320,8 @@ struct DummyStoreImpl : DummyStore
|
|||
|
||||
void registerDrvOutput(const Realisation & output) override
|
||||
{
|
||||
auto ref = make_ref<UnkeyedRealisation>(output);
|
||||
buildTrace.insert_or_visit({output.id.drvHash, {{output.id.outputName, ref}}}, [&](auto & kv) {
|
||||
kv.second.insert_or_assign(output.id.outputName, make_ref<UnkeyedRealisation>(output));
|
||||
buildTrace.insert_or_visit({output.id.drvHash, {{output.id.outputName, output}}}, [&](auto & kv) {
|
||||
kv.second.insert_or_assign(output.id.outputName, output);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -333,7 +332,7 @@ struct DummyStoreImpl : DummyStore
|
|||
buildTrace.cvisit(drvOutput.drvHash, [&](const auto & kv) {
|
||||
if (auto it = kv.second.find(drvOutput.outputName); it != kv.second.end()) {
|
||||
visited = true;
|
||||
callback(it->second.get_ptr());
|
||||
callback(std::make_shared<UnkeyedRealisation>(it->second));
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ struct DummyStore : virtual Store
|
|||
* outer map for the derivation, and inner maps for the outputs of a
|
||||
* given derivation.
|
||||
*/
|
||||
boost::concurrent_flat_map<Hash, std::map<std::string, ref<UnkeyedRealisation>>> buildTrace;
|
||||
boost::concurrent_flat_map<Hash, std::map<std::string, UnkeyedRealisation>> buildTrace;
|
||||
|
||||
DummyStore(ref<const Config> config)
|
||||
: Store{*config}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue