The :use REPL command is broken #1178

Closed
opened 2026-04-07 08:46:10 +00:00 by blokyk · 2 comments

Describe the bug

Trying to use the :use REPL command in lix 2.95.1 complains about tokens-no-whitespace, and judging from the error message it might be because the original code is missing some sort of escaping:

nix-repl> :u pkgs.hello
error: whitespace between function arguments or list elements is required here. Use --extra-deprecated-features tokens-no-whitespace to disable this error
       at «string»:1:41:
            1| "drv: (import <nixpkgs> {}).runCommand "shell") ""
             |                                         ^
            2|                 R""({ buildInputs = [ drv ]; } ""

(notice that the "function" here is the drv: ... runCommand string, and the "argument" it's complaining about is shell)
((also the R"" which if i'm not mistaken is a c++ raw string marker, which... looks out of place for nix code x))

I quickly checked in a nix-shell, and it seems like :use still worked in 2.94.1, so this is a regression. Unfortunately, I can't do a bisect right now (laptop still broken :|)...

Steps To Reproduce

  1. open nix repl -f <nixpkgs>
  2. type :use pkgs.hello
  3. see the error
  4. get sad

Expected behavior

A nix-shell with hello available in it opens, like it used to in 2.94.1

nix --version output

nix (Lix, like Nix) 2.95.1
System type: x86_64-linux
Additional system types: i686-linux, x86_64-v1-linux, x86_64-v2-linux, x86_64-v3-linux
Features: gc, signed-caches
System configuration file: /etc/nix/nix.conf
User configuration files: /home/courvoie/.config/nix/nix.conf:/etc/xdg/xdg-ubuntu-xorg/nix/nix.conf:/etc/xdg/nix/nix.conf
Store directory: /nix/store
State directory: /nix/var/nix
Data directory: /nix/store/slkbw0cg08jhfsax6kc0bf6rvw7rkl26-lix-2.95.1/share

## Describe the bug Trying to use the `:use` REPL command in lix 2.95.1 complains about `tokens-no-whitespace`, and judging from the error message it might be because the original code is missing some sort of escaping: ``` nix-repl> :u pkgs.hello error: whitespace between function arguments or list elements is required here. Use --extra-deprecated-features tokens-no-whitespace to disable this error at «string»:1:41: 1| "drv: (import <nixpkgs> {}).runCommand "shell") "" | ^ 2| R""({ buildInputs = [ drv ]; } "" ``` (notice that the "function" here is the `drv: ... runCommand ` string, and the "argument" it's complaining about is `shell`) ((also the `R""` which if i'm not mistaken is a c++ raw string marker, which... looks out of place for nix code x)) I quickly checked in a `nix-shell`, and it seems like `:use` still worked in 2.94.1, so this is a regression. Unfortunately, I can't do a bisect right now (laptop still broken :|)... ## Steps To Reproduce 1. open `nix repl -f <nixpkgs>` 2. type `:use pkgs.hello` 3. see the error 4. get sad ## Expected behavior A `nix-shell` with `hello` available in it opens, like it used to in 2.94.1 ## `nix --version` output nix (Lix, like Nix) 2.95.1 System type: x86_64-linux Additional system types: i686-linux, x86_64-v1-linux, x86_64-v2-linux, x86_64-v3-linux Features: gc, signed-caches System configuration file: /etc/nix/nix.conf User configuration files: /home/courvoie/.config/nix/nix.conf:/etc/xdg/xdg-ubuntu-xorg/nix/nix.conf:/etc/xdg/nix/nix.conf Store directory: /nix/store State directory: /nix/var/nix Data directory: /nix/store/slkbw0cg08jhfsax6kc0bf6rvw7rkl26-lix-2.95.1/share
Member

This issue was mentioned on Gerrit on the following CLs:

  • commit message in cl/5443 ("repl: Fix the use command")
  • commit message in cl/5444 ("repl: Fix the use command")
<!-- GERRIT_LINKBOT: {"cls": [{"backlink": "https://gerrit.lix.systems/c/lix/+/5443", "number": 5443, "kind": "commit message"}, {"backlink": "https://gerrit.lix.systems/c/lix/+/5444", "number": 5444, "kind": "commit message"}], "cl_meta": {"5443": {"change_title": "repl: Fix the `use` command"}, "5444": {"change_title": "repl: Fix the `use` command"}}} --> This issue was mentioned on Gerrit on the following CLs: * commit message in [cl/5443](https://gerrit.lix.systems/c/lix/+/5443) ("repl: Fix the `use` command") * commit message in [cl/5444](https://gerrit.lix.systems/c/lix/+/5444) ("repl: Fix the `use` command")
Author

That was really quick, thanks @tom-hubrecht!

That was really quick, thanks @tom-hubrecht!
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#1178
No description provided.