Nested follows cause flake interactions to update the nested input #460

Closed
opened 2024-08-04 20:50:18 +00:00 by diniamo · 2 comments

Describe the bug

The title sums it up pretty well: let's say a flake contains inputs.a.inputs.b.inputs.c.follows = "...", doing any sort of interaction with the flake (for example nix --verbose flake show) causes it to update input b.

Steps To Reproduce

  1. Paste this into a file named flake.nix
{
  inputs = {
    nixpkgs.url = "nixpkgs/nixos-unstable";

    nvf = {
      url = "github:NotAShelf/nvf";
      inputs.nixpkgs.follows = "nixpkgs";
      inputs.zig.inputs.nixpkgs.follows = "nixpkgs";
    };
  };

  outputs = _: {};
}
  1. Run nix --verbose flake show twice
  2. Notice that it still tries to fetch the zig-overlay input on the second run, and if you were to manually lock the input to an older commit, it would update it.

Expected behavior

The random fetch and update don't happen.

nix --version output

nix (Lix, like Nix) 2.90.0

## Describe the bug The title sums it up pretty well: let's say a flake contains `inputs.a.inputs.b.inputs.c.follows = "..."`, doing any sort of interaction with the flake (for example `nix --verbose flake show`) causes it to update input `b`. ## Steps To Reproduce 1. Paste this into a file named `flake.nix` ```nix { inputs = { nixpkgs.url = "nixpkgs/nixos-unstable"; nvf = { url = "github:NotAShelf/nvf"; inputs.nixpkgs.follows = "nixpkgs"; inputs.zig.inputs.nixpkgs.follows = "nixpkgs"; }; }; outputs = _: {}; } ``` 2. Run `nix --verbose flake show` twice 3. Notice that it still tries to fetch the zig-overlay input on the second run, and if you were to manually lock the input to an older commit, it would update it. ## Expected behavior The random fetch and update don't happen. ## `nix --version` output `nix (Lix, like Nix) 2.90.0`
diniamo added the
bug
label 2024-08-04 20:50:18 +00:00
ma27 self-assigned this 2024-08-18 19:52:51 +00:00
Owner

This bug's evil twin: #465

This bug's evil twin: https://git.lix.systems/lix-project/lix/issues/465
jade added the
Area/flakes
label 2024-08-18 21:48:56 +00:00
Member

This issue was mentioned on Gerrit on the following CLs:

  • commit message in cl/1802 ("flake: don't refetch unmodified inputs by recursive follows")
<!-- GERRIT_LINKBOT: {"cls": [{"backlink": "https://gerrit.lix.systems/c/lix/+/1802", "number": 1802, "kind": "commit message"}], "cl_meta": {"1802": {"change_title": "flake: don't refetch unmodified inputs by recursive follows"}}} --> This issue was mentioned on Gerrit on the following CLs: * commit message in [cl/1802](https://gerrit.lix.systems/c/lix/+/1802) ("flake: don't refetch unmodified inputs by recursive follows")
Sign in to join this conversation.
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/lix#460
No description provided.