repl :reload no longer reloads repl-overlays or :add'd expressions #1115

Open
opened 2026-02-02 11:44:05 +00:00 by qyriad · 3 comments
Owner

Describe the bug

Before, given some foo.nix file:

{
  bar = throw "baz";
}

Then adding it, either in a repl overlay or with :add:

nix-repl> :add { foo = import ./foo.nix; }
Added 1 variables

nix-repl> foo.bar
error: "baz"

Then modifying that file:

{
  bar = "baz";
}

And finally :reloading the repl:

nix-repl> :reload
Added 1 variables

nix-repl> foo.bar
"baz"

would propagate the changes in the file to the repl state. Now, however, the repl does nothing for these cases:

nix-repl> :reload
No file to reload, skipping

nix --version output

nix (Lix, like Nix) 2.95.0-pre20260131-dev_64d610f

Additional context

Presumably this is a logic error in our and @raito's changes, somewhere in the chain of 43434d675e, 7be72ca667, 0f1208c406, f4be01b4be, and 6cbbe19b5c

## Describe the bug Before, given some `foo.nix` file: ```nix { bar = throw "baz"; } ``` Then adding it, either in a repl overlay or with `:add`: ```nix nix-repl> :add { foo = import ./foo.nix; } Added 1 variables nix-repl> foo.bar error: "baz" ``` Then modifying that file: ```nix { bar = "baz"; } ``` And finally `:reload`ing the repl: ```nix nix-repl> :reload Added 1 variables nix-repl> foo.bar "baz" ``` would propagate the changes in the file to the repl state. Now, however, the repl does nothing for these cases: ```nix nix-repl> :reload No file to reload, skipping ``` ## `nix --version` output ``` nix (Lix, like Nix) 2.95.0-pre20260131-dev_64d610f ``` ## Additional context Presumably this is a logic error in our and @raito's changes, somewhere in the chain of 43434d675efa3b1f28555381ebf705a093fa17e1, 7be72ca667609ceb0124fd6f424f74f1171abc2c, 0f1208c4061f8580b2e964312c37f48379dec300, f4be01b4be4a509bec6d79cef0810da34b0e5128, and 6cbbe19b5c1ed73a509b8283b816545dcf2887c9
Owner

I wonder if this is really a logical error, how do we track the existence of that import to reload it? Should we reload the whole eval state all the time assuming there might be imports hidden? Tough…

I wonder if this is really a logical error, how do we track the existence of that `import` to reload it? Should we reload the whole eval state all the time assuming there might be imports hidden? Tough…
Author
Owner

Do we really lose anything by reloading the whole eval state?

Do we really lose anything by reloading the whole eval state?
Owner

@qyriad if the whole eval state reload fails, we have trashed the eval state, maybe if we can back up it…

@qyriad if the whole eval state reload fails, we have trashed the eval state, maybe if we can back up it…
Sign in to join this conversation.
No milestone
No project
No assignees
2 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#1115
No description provided.