Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lorry shell fails to find sudo #104

Open
p-alik opened this issue Feb 1, 2024 · 1 comment
Open

lorry shell fails to find sudo #104

p-alik opened this issue Feb 1, 2024 · 1 comment

Comments

@p-alik
Copy link

p-alik commented Feb 1, 2024

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

  • shell.nix to reproduce the issue
[user@ls03064 x]$ cat shell.nix 
{ pkgs ? import <nixpkgs> {} }:

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
  • lorry info
# lorry shell succeeded after removing of sudo
(lorri) [user@ls03064 x]$ lorri info --shell-file shell.nix 
GC roots exist, shell_gc_root: /home/user/.cache/lorri/gc_roots/50abadd53cffd8d330176cc639de1f26/gc_root/shell_gc_root
  • uname -a
(lorri) [user@ls03064 x]$ uname -a
Linux ls03064 6.1.68 #1-NixOS SMP PREEMPT_DYNAMIC Wed Dec 13 17:39:30 UTC 2023 x86_64 GNU/Linux
  • lorry installed by home-manager
(lorri) [apastuchov@ls03064 x]$ home-manager packages | grep lorri
lorri-1.6.0
lorri-1.6.0-man
  • nix-info
(lorri) [user@ls03064 x]$ nix-info --markdown
 - system: `"x86_64-linux"`
 - host os: `Linux 6.1.68, NixOS, 23.11 (Tapir), 23.11.2004.1e2e384c5b7c`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.1`
 - channels(root): `"nixos-23.11"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
@nyarly
Copy link
Collaborator

nyarly commented Feb 19, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants