target / lorri

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

Lorri shell refuses to build due to nix store unlink inability #484

Open estesb1 opened 3 years ago

estesb1 commented 3 years ago

Hi all,

I just cloned a GitHub project (with a shell.nix file present) and after running Lorri daemon in one terminal, opening up a new terminal, changing into the the GitHub project's directory and ultimately running lorri shell, I see the following error:

Dec 29 23:00:18.670 INFO build status, message: BuildEvent(Started { nix_file: NixFile("/Users/estesb1/code/DevOps/scm-zen-manager-feature-DEV-13485-template-support/shell.nix"), reason: ProjectAdded(NixFile("/Users/estesb1/code/DevOps/scm-zen-manager-feature-DEV-13485-template-support/shell.nix")) }) Dec 29 23:00:20.444 INFO build status, message: BuildEvent(Failure { nix_file: NixFile("/Users/estesb1/code/DevOps/scm-zen-manager-feature-DEV-13485-template-support/shell.nix"), failure: Exit { cmd: "\"nix-build\" \"--out-link\" \"/var/folders/1t/j3n5l5252g35qnzs0lcy44dc0000gn/T/.tmpPLZXyy/result\" \"--\" \"/var/folders/1t/j3n5l5252g35qnzs0lcy44dc0000gn/T/.tmpzGGR5i/result\"", status: Some(1), logs: [LogLine("these derivations will be built:"), LogLine(" /nix/store/syajcy90l6nbgq74039mz8fqyi56pjhw-lorri-keep-env-hack-nix-shell.drv"), LogLine("error: cannot unlink \'/nix/store/bxr5h3q1pr7afilx00yjbf3ih25jzbr3-lorri-keep-env-hack-nix-shell/varmap-v1\': Permission denied")] } })

Below are the version #'s of my nix, niv, direnv, and lorri installations.

When I ran this command, (nix-env --query --installed) I saw the following versions: Nix --> 2.3.9 Niv --> 0.2.18 direnv --> 2.25.1 lorri --> 1.2.0

To Reproduce Steps to reproduce the behavior:

  1. nix is installed
  2. direnv is installed
  3. Lorri is installed
  4. I installed niv as well (nix-env --install niv)
  5. cd'ed into my project directory
  6. Ran lorri init which created a .envrc file (bash is my terminal of choice)
  7. Ran direnv allow and I see this: direnv: loading ~/code/DevOps/scm-zen-manager-feature-DEV-13485-template-support/.envrc Dec 29 23:32:25.689 INFO lorri has not completed an evaluation for this project yet, expr: /Users/estesb1/code/DevOps/scm-zen-manager-feature-DEV-13485-template-support/shell.nix direnv: export +IN_NIX_SHELL
  8. Ran lorri daemon (Terminal 1)
  9. Opened a new terminal window (Terminal 2) and cd'ed into my project directory and after I ran lorri shell, I saw the above error in Terminal 1 (Permission denied error).

Expected behavior After running lorri daemon the build status should be completed successfully without any errors, and after running the lorri shell command, the lorri environment should build successfully.

$ lorri info

lorri version: 1.2 GC roots do not exist. Has the project been built with lorri yet?


<!-- Please run `uname -a` and paste its output here. -->
```console
$ uname -a
`Darwin Brittneys-MacBook-Pro.local 19.6.0 Darwin Kernel Version 19.6.0: Mon Aug 31 22:12:52 PDT 2020; root:xnu-6153.141.2~1/RELEASE_X86_64 x86_64`

Additional context Whenever I run nix-shell in the project directory, it builds just fine. Only when I run lorri shell is when I run into trouble. I am a nix newbie and absolutely find its concept beneficial. However, the setup is a bit of a pain. Can someone please help me with this issue? It would be greatly appreciated.