mirror of
https://github.com/NixOS/nix.git
synced 2025-11-30 22:20:59 +01:00
Merge remote-tracking branch 'origin/master' into lazy-trees
This commit is contained in:
commit
934f317250
35 changed files with 510 additions and 115 deletions
|
|
@ -324,6 +324,39 @@ LockedFlake lockFlake(
|
|||
|
||||
std::vector<FlakeRef> parents;
|
||||
|
||||
std::function<void(
|
||||
const InputPath & inputPathPrefix,
|
||||
const FlakeInputs & flakeInputs
|
||||
)>
|
||||
checkFollowsDeclarations;
|
||||
|
||||
checkFollowsDeclarations = [&](
|
||||
const InputPath & inputPathPrefix,
|
||||
const FlakeInputs & flakeInputs
|
||||
) {
|
||||
for (auto [inputPath, inputOverride] : overrides) {
|
||||
auto inputPath2(inputPath);
|
||||
auto follow = inputPath2.back();
|
||||
inputPath2.pop_back();
|
||||
if (inputPath2 == inputPathPrefix
|
||||
&& flakeInputs.find(follow) == flakeInputs.end()
|
||||
) {
|
||||
std::string root;
|
||||
for (auto & element : inputPath2) {
|
||||
root.append(element);
|
||||
if (element != inputPath2.back()) {
|
||||
root.append(".inputs.");
|
||||
}
|
||||
}
|
||||
warn(
|
||||
"%s has a `follows'-declaration for a non-existent input %s!",
|
||||
root,
|
||||
follow
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
std::function<void(
|
||||
const FlakeInputs & flakeInputs,
|
||||
std::shared_ptr<Node> node,
|
||||
|
|
@ -356,6 +389,8 @@ LockedFlake lockFlake(
|
|||
{
|
||||
debug("computing lock file node '%s'", printInputPath(inputPathPrefix));
|
||||
|
||||
checkFollowsDeclarations(inputPathPrefix, flakeInputs);
|
||||
|
||||
/* Get the overrides (i.e. attributes of the form
|
||||
'inputs.nixops.inputs.nixpkgs.url = ...'). */
|
||||
for (auto & [id, input] : flakeInputs) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue