1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-29 14:53:16 +02:00

Merge remote-tracking branch 'origin/master' into lazy-trees

This commit is contained in:
Eelco Dolstra 2022-12-12 17:53:06 +01:00
commit 12c554acd4
19 changed files with 90 additions and 82 deletions

View file

@ -1764,7 +1764,7 @@ void EvalState::autoCallFunction(Bindings & args, Value & fun, Value & res)
Nix attempted to evaluate a function as a top level expression; in
this case it must have its arguments supplied either by default
values, or passed explicitly with '--arg' or '--argstr'. See
https://nixos.org/manual/nix/stable/expressions/language-constructs.html#functions.)", symbols[i.name],
https://nixos.org/manual/nix/stable/language/constructs.html#functions.)", symbols[i.name],
*fun.lambda.env, *fun.lambda.fun);
}
}

View file

@ -333,7 +333,7 @@ LockedFlake lockFlake(
computeLocks = [&](
/* The inputs of this node, either from flake.nix or
flake.lock */
flake.lock. */
const FlakeInputs & flakeInputs,
/* The node whose locks are to be updated.*/
ref<Node> node,
@ -568,7 +568,7 @@ LockedFlake lockFlake(
inputFlake.inputs, childNode, inputPath,
oldLock
? std::dynamic_pointer_cast<const Node>(oldLock)
: (std::shared_ptr<Node>) readLockFile(inputFlake).root,
: readLockFile(inputFlake).root.get_ptr(),
oldLock ? followsPrefix : inputPath,
inputFlake.path,
false);
@ -600,7 +600,7 @@ LockedFlake lockFlake(
flake->inputs,
newLockFile.root,
{},
lockFlags.recreateLockFile ? nullptr : (std::shared_ptr<Node>) oldLockFile.root,
lockFlags.recreateLockFile ? nullptr : oldLockFile.root.get_ptr(),
{},
flake->path,
false);

View file

@ -45,15 +45,15 @@ std::shared_ptr<Node> LockFile::findInput(const InputPath & path)
{
std::shared_ptr<Node> pos = root;
if (!pos) return {};
for (auto & elem : path) {
if (auto i = get(pos->inputs, elem)) {
if (auto node = std::get_if<0>(&*i))
pos = (std::shared_ptr<LockedNode>) *node;
else if (auto follows = std::get_if<1>(&*i)) {
pos = findInput(*follows);
if (!pos) return {};
if (auto p = findInput(*follows))
pos = ref(p);
else
return {};
}
} else
return {};