nix-community / lorri

Your project’s nix-env [maintainer=@Profpatsch,@nyarly]
Apache License 2.0
639 stars 24 forks source link

lorry shell fails to find sudo #104

Open p-alik opened 5 months ago

p-alik commented 5 months ago

Describe the bug

lorry shell fails to find sudo, which is indeed in $PATH

[user@ls03064 x]$ which sudo
/run/wrappers/bin/sudo
[user@ls03064 x]$ echo $PATH | grep -c `dirname $(which sudo)` 
1

To Reproduce

pkgs.mkShell { shellHook = '' sudo ls ''; }


* `lorry shell` fails

[user@ls03064 x]$ lorri shell lorri: building environment... done Feb 01 14:07:28.915 ERRO Build failed. No cached environment available. Build error: Nix process returned exit code 1. $ "nix-build" "--out-link" "/tmp/.tmpZh7L98/result" "--" "/tmp/.tmp4NHQym/result" this derivation will be built: /nix/store/sb28qinzrk8qq9v7i78zv9q6nrk53fph-lorri-keep-env-hack-nix-shell.drv building '/nix/store/sb28qinzrk8qq9v7i78zv9q6nrk53fph-lorri-keep-env-hack-nix-shell.drv'... /nix/store/wr08yanv2bjrphhi5aai12hf2qz5kvic-stdenv-linux/setup: line 114: sudo: command not found /nix/store/wr08yanv2bjrphhi5aai12hf2qz5kvic-stdenv-linux/setup: line 131: pop_var_context: head of shell_variables not a function context error: builder for '/nix/store/sb28qinzrk8qq9v7i78zv9q6nrk53fph-lorri-keep-env-hack-nix-shell.drv' failed with exit code 127; last 2 log lines:

/nix/store/wr08yanv2bjrphhi5aai12hf2qz5kvic-stdenv-linux/setup: line 114: sudo: command not found /nix/store/wr08yanv2bjrphhi5aai12hf2qz5kvic-stdenv-linux/setup: line 131: pop_var_context: head of shell_variables not a function context For full logs, run 'nix-store -l /nix/store/sb28qinzrk8qq9v7i78zv9q6nrk53fph-lorri-keep-env-hack-nix-shell.drv'.

Expected behavior

Metadata

Expects lorri shell succeeds like nix-shell

[user@ls03064 x]$ nix-shell 
shell.nix
nyarly commented 4 months ago

Interesting; I'll need to try to reproduce this. Thanks for the report.