mirror of
https://github.com/NixOS/nix.git
synced 2024-11-26 08:42:30 +00:00
Check LockedInput::computeStorePath()
This commit is contained in:
parent
b9fb372075
commit
b9f93e7386
@ -584,6 +584,8 @@ static void prim_callFlake(EvalState & state, const Pos & pos, Value * * args, V
|
||||
throw Error("the content hash of flake '%s' doesn't match the hash recorded in the referring lockfile",
|
||||
lazyInput->lockedInput.ref);
|
||||
|
||||
assert(flake.sourceInfo->storePath == lazyInput->lockedInput.computeStorePath(*state.store));
|
||||
|
||||
callFlake(state, flake, lazyInput->lockedInput, v);
|
||||
} else {
|
||||
FlakeCache flakeCache;
|
||||
@ -593,6 +595,8 @@ static void prim_callFlake(EvalState & state, const Pos & pos, Value * * args, V
|
||||
throw Error("the content hash of repository '%s' doesn't match the hash recorded in the referring lockfile",
|
||||
lazyInput->lockedInput.ref);
|
||||
|
||||
assert(sourceInfo.storePath == lazyInput->lockedInput.computeStorePath(*state.store));
|
||||
|
||||
state.mkAttrs(v, 8);
|
||||
|
||||
assert(state.store->isValidPath(sourceInfo.storePath));
|
||||
|
@ -25,9 +25,9 @@ nlohmann::json LockedInput::toJson() const
|
||||
return json;
|
||||
}
|
||||
|
||||
Path LockedInput::computeStorePath(Store & store) const
|
||||
StorePath LockedInput::computeStorePath(Store & store) const
|
||||
{
|
||||
return store.printStorePath(store.makeFixedOutputPath(true, narHash, "source"));
|
||||
return store.makeFixedOutputPath(true, narHash, "source");
|
||||
}
|
||||
|
||||
LockedInputs::LockedInputs(const nlohmann::json & json)
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
namespace nix {
|
||||
class Store;
|
||||
struct StorePath;
|
||||
}
|
||||
|
||||
namespace nix::flake {
|
||||
@ -53,7 +54,7 @@ struct LockedInput : LockedInputs
|
||||
|
||||
nlohmann::json toJson() const;
|
||||
|
||||
Path computeStorePath(Store & store) const;
|
||||
StorePath computeStorePath(Store & store) const;
|
||||
};
|
||||
|
||||
/* An entire lock file. Note that this cannot be a FlakeInput for the
|
||||
|
Loading…
Reference in New Issue
Block a user