target / lorri

Your project's nix-env
Apache License 2.0
992 stars 69 forks source link

shellHook fails when sourcing bash completions #492

Open haslersn opened 3 years ago

haslersn commented 3 years ago

The following shell.nix works with nix-shell but fails with Lorri:

with import <nixpkgs> {};

mkShell {
  nativeBuildInputs = [
    kubectl
  ];
  shellHook = ''
    source <(kubectl completion bash)
  '';
}

Metadata

Jan 26 21:03:02.550 INFO build message, message: BuildEvent(Started { nix_file: NixFile("/home/haslersn/shelltest/shell.nix"), reason: ProjectAdded(NixFile("/home/haslersn/shelltest/shell.nix")) }), expr: /home/haslersn/shelltest/shell.nix
Jan 26 21:03:03.969 INFO build message, message: BuildEvent(Failure { nix_file: NixFile("/home/haslersn/shelltest/shell.nix"), failure: Exit { cmd: "\"nix-build\" \"--out-link\" \"/tmp/.tmpTn7wKi/result\" \"--\" \"/tmp/.tmpObKCvv/result\"", status: Some(100), logs: [LogLine("these derivations will be built:"), LogLine("  /nix/store/hwrxhq6rnabcypfnpfczq9ayn2lpaydb-lorri-keep-env-hack-nix-shell.drv"), LogLine("building \'/nix/store/hwrxhq6rnabcypfnpfczq9ayn2lpaydb-lorri-keep-env-hack-nix-shell.drv\'..."), LogLine("/dev/fd/63: line 12982: complete: command not found"), LogLine("builder for \'/nix/store/hwrxhq6rnabcypfnpfczq9ayn2lpaydb-lorri-keep-env-hack-nix-shell.drv\' failed with exit code 127"), LogLine("error: build of \'/nix/store/hwrxhq6rnabcypfnpfczq9ayn2lpaydb-lorri-keep-env-hack-nix-shell.drv\' failed")] } }), expr: /home/haslersn/shelltest/shell.nix
$ uname -a
Linux beaver 5.4.91 #1-NixOS SMP Tue Jan 19 17:26:19 UTC 2021 x86_64 GNU/Linux
neumantm commented 3 years ago

I guess the cause is, that a non interactive bash is used by lorri. Therefore this issue is relaeted to #488