Closed CorbanR closed 2 years ago
I think this is a nix 2.6.0 bug involving directory symlinks. I've commented on the nix issue about symlinks causing ambiguity (https://github.com/NixOS/nix/issues/1958#issuecomment-1040029485). As for why it only occurs on macOS, the problem requires a directory symlink, and on macOS, /tmp
is a link to private/tmp
.
I have the same issue after upgrading nix. nix-shell works fine but lorri chokes:
🐟 lorri shell --shell-file ../shell.nix oasys
lorri: building environment.... done
Feb 16 10:07:53.288 ERRO Build failed. No cached environment available.
Build error: Nix process returned exit code 1.
$ "nix-build" "--out-link" "/var/folders/s_/qdwr96yj3zv0vy21sdzzlx3m0000gn/T/.tmp0zAx9R/result" "--" "/var/folders/s_/qdwr96yj3zv0vy21sdzzlx3m0000gn/T/.tmpsVsKBI/result"
error: syntax error, unexpected ',', expecting ')'
at /nix/store/f0zbb12xlk0hhx3l44xz4gv98ynw31vk-lorri-keep-env-hack-nix-shell.drv:1:15:
🐟 head /nix/store/f0zbb12xlk0hhx3l44xz4gv98ynw31vk-lorri-keep-env-hack-nix-shell.drv:
Derive([("out","/nix/store/dabpckpi3wa5cd689pzkj3rshm92igca-lorri-keep-env-hack-nix-shell","","")],
………
I tried this on nix 2.6.1
and the issue appears to be resolved, albeit I'm seeing lorri crash occasionally, which hasn't been the norm for me.
Describe the bug
lorri shell --shell-file .shell.nix
failing to build with errorAdditionally the same error show up when I enter the directory as I use
direnv
The above error only started when I upgraded to nix
2.6.0
. I usedirenv
withlorri
, however I get the same error, even when trying alorri shell
To Reproduce My current setup is as follows
direnv
nix
version2.6.0
, experimental flake support is NOT enabled.(I use a separate wrapper nixFlakes for that`mkdir lorri_test
.envrc
with something like.shell.nix
with something likewith pkgs;
let inherit (darwin.apple_sdk.frameworks) CoreServices ApplicationServices Security; darwinPackages = [ CoreServices ApplicationServices Security ];
nodejs = nodejs-12_x;
in mkShell rec { name = "tapestry";
buildInputs = [ nodejs (yarn.override { inherit nodejs; }) ] ++ darwinPackages;
shellHook = ''
Add additional folders to to XDG_DATA_DIRS if they exists, which will get sourced by bash-completion
''; }
Additional context I've tried clearing out all lorri cache, nix cache, restarting etc. Running a
nix-shell .shell.nix
or even anix shell -f .shell.nix
I tested this same scenario inside a linux container running nix
2.6.0
and am NOT seeing the same issue. It appears to be specific toOSX