nix icon indicating copy to clipboard operation
nix copied to clipboard

__appendContext crashed repl

Open sivizius opened this issue 4 years ago • 0 comments

Describe the bug

$ nix repl
Welcome to Nix 2.7.0pre20220201_73d5f38. Type :? for help.

nix-repl> __appendContext "Hello" { "" = null; }
nix: src/libutil/util.cc:112: nix::Path nix::canonPath(const Path&, bool): Assertion `path != ""' failed.
[1]    1292835 abort (core dumped)  /run/current-system/sw/bin/nix --extra-experimental-features nix-command
$ 

Expected behavior

Not crashing, the usual error-message instead.

Additional context

  • __appendContext and __getContext could have some more documentation.
  • There is no unsafeGetContext: https://github.com/NixOS/nix/blob/6d7844695bf14c1fc68f051df0b98db442863fc9/src/libexpr/primops/context.cc#L130-L134

sivizius avatar Jan 29 '22 18:01 sivizius