nmattia / sorri

Just Add Water direnv support for the nix-shell

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sorri triggers infinite shell recursion

DavHau opened this issue · comments

I'm using direnv with fish and whenever sorri detects a change and decides to re-evaluate, I'm getting:

~/p/g/mach-nix ❯❯❯ 
direnv: loading ~/synced/projects/github/mach-nix/.envrc
sorri: looking for matching cached shell in /home/grmpf/.cache/sorri/mach-nix/v2
sorri: no candidate accepted, creating manifest
sorri: building shell, this may take a while
direnv: ([/nix/store/086y8hv6ayv0y90690xbff0lxgrpi6k8-direnv-2.21.2-bin/bin/direnv export fish]) is taking a while to execute. Use CTRL-C to give up.
bash: warning: shell level (1000) too high, resetting to 1
bash: warning: shell level (1000) too high, resetting to 1
bash: warning: shell level (1000) too high, resetting to 1
... (goes on forever)

Could this be related to the fact that I'm using nix-direnv?

It could be. Can you export SORRI_DEBUG=yes in your shell?

The log is very long. here the last lines:

querying info about '/nix/store/mc62q7hhsasb7n25574j989xyrq1fris-python3.7-aiohttp-3.6.2' on 'https://cache.nixos.org'... downloading 'https://cache.nixos.org/mc62q7hhsasb7n25574j989xyrq1fris.narinfo'... querying info about '/nix/store/v23h06v49jrqbhswg2xvpdzdwdqmjhrk-python3.7-async-timeout-3.0.1' on 'https://cache.nixos.org'... downloading 'https://cache.nixos.org/v23h06v49jrqbhswg2xvpdzdwdqmjhrk.narinfo'... querying info about '/nix/store/scz988asazi9cfl0cwszzv7gh3fj2ri5-python3.7-typing_extensions-3.7.4.3' on 'https://cache.nixos.org'... downloading 'https://cache.nixos.org/scz988asazi9cfl0cwszzv7gh3fj2ri5.narinfo'... these 2 derivations will be built: /nix/store/msabp12ij13nahy97jalzd4b1yx2rcn0-python3-3.7.9-env.drv /nix/store/7ghi73wbczd91fmpdz7jlrcl57wfbhw6-nix-shell.drv these 5 paths will be fetched (0.70 MiB download, 4.97 MiB unpacked): /nix/store/fbkaspjlzsyzdwp73mxvlcrgsqckv36n-python3.7-yarl-1.5.1 /nix/store/mc62q7hhsasb7n25574j989xyrq1fris-python3.7-aiohttp-3.6.2 /nix/store/qkfls9nppvi3vdlfx6dhdvmi5yic366r-python3.7-multidict-4.7.6 /nix/store/scz988asazi9cfl0cwszzv7gh3fj2ri5-python3.7-typing_extensions-3.7.4.3 /nix/store/v23h06v49jrqbhswg2xvpdzdwdqmjhrk-python3.7-async-timeout-3.0.1 copying path '/nix/store/qkfls9nppvi3vdlfx6dhdvmi5yic366r-python3.7-multidict-4.7.6' from 'https://cache.nixos.org'... copying path '/nix/store/scz988asazi9cfl0cwszzv7gh3fj2ri5-python3.7-typing_extensions-3.7.4.3' from 'https://cache.nixos.org'... copying path '/nix/store/v23h06v49jrqbhswg2xvpdzdwdqmjhrk-python3.7-async-timeout-3.0.1' from 'https://cache.nixos.org'... downloading 'https://cache.nixos.org/nar/02668v5vmdzh43ppcadccdhr4i2c6dn263icdfxplpwysz5p2hn3.nar.xz'... downloading 'https://cache.nixos.org/nar/0ii0vmwb1macy65hqsayvy0nrrkp5y2vgs5r4il2xi79xlmxag64.nar.xz'... downloading 'https://cache.nixos.org/nar/0ph8cf0243khzzifdbzdpiiz1j5kwsdcv9smc7bvv8xfw51ah707.nar.xz'... direnv: ([/nix/store/086y8hv6ayv0y90690xbff0lxgrpi6k8-direnv-2.21.2-bin/bin/direnv export fish]) is taking a while to execute. Use CTRL-C to give up. substitution of path '/nix/store/v23h06v49jrqbhswg2xvpdzdwdqmjhrk-python3.7-async-timeout-3.0.1' succeeded substitution of path '/nix/store/scz988asazi9cfl0cwszzv7gh3fj2ri5-python3.7-typing_extensions-3.7.4.3' succeeded substitution of path '/nix/store/qkfls9nppvi3vdlfx6dhdvmi5yic366r-python3.7-multidict-4.7.6' succeeded copying path '/nix/store/fbkaspjlzsyzdwp73mxvlcrgsqckv36n-python3.7-yarl-1.5.1' from 'https://cache.nixos.org'... downloading 'https://cache.nixos.org/nar/0s0h26h1xdwl4h1yqq4xgxqrf0sffdhwspv98wjgf5726pnrfwky.nar.xz'... substitution of path '/nix/store/fbkaspjlzsyzdwp73mxvlcrgsqckv36n-python3.7-yarl-1.5.1' succeeded copying path '/nix/store/mc62q7hhsasb7n25574j989xyrq1fris-python3.7-aiohttp-3.6.2' from 'https://cache.nixos.org'... downloading 'https://cache.nixos.org/nar/0dj9jvn97lhqbaqjw5haqdxhavhv2v3ldblp9iwg63ln4fzwvgl5.nar.xz'... substitution of path '/nix/store/mc62q7hhsasb7n25574j989xyrq1fris-python3.7-aiohttp-3.6.2' succeeded setting up chroot environment in '/nix/store/msabp12ij13nahy97jalzd4b1yx2rcn0-python3-3.7.9-env.drv.chroot' executing builder '/nix/store/2jysm3dfsgby5sw5jgj43qjrb5v79ms9-bash-4.4-p23/bin/bash' building '/nix/store/msabp12ij13nahy97jalzd4b1yx2rcn0-python3-3.7.9-env.drv'... created 424 symlinks in user environment setting up chroot environment in '/nix/store/7ghi73wbczd91fmpdz7jlrcl57wfbhw6-nix-shell.drv.chroot' executing builder '/nix/store/2jysm3dfsgby5sw5jgj43qjrb5v79ms9-bash-4.4-p23/bin/bash' building '/nix/store/7ghi73wbczd91fmpdz7jlrcl57wfbhw6-nix-shell.drv'... /nix/store/8g0nnj0ddkamn4vz9aw01yk4nv3a10x2-nix-shell debug: build finished /tmp/tmp.LM1SmIbUxf/result debug: found evaluated /home/grmpf/synced/projects/github/mach-nix/shell.nix debug: found evaluated /home/grmpf/synced/projects/github/mach-nix/mach_nix/nix/nixpkgs-src.nix debug: found trace /home/grmpf/synced/projects/github/mach-nix/mach_nix/nix/NIXPKGS.json debug: found evaluated /home/grmpf/synced/projects/github/mach-nix/mach_nix/nix/python-deps.nix bash: warning: shell level (1000) too high, resetting to 1 bash: warning: shell level (1000) too high, resetting to 1 bash: warning: shell level (1000) too high, resetting to 1

This only happens when a reevaluation is triggered by changing something in the nix code. Slight changes like adding a space in a file, triggers a reevaluation by direnv, but doesn't trigger the error.

Also, the error seems to happen after the build is completed. Interrupting it during this state will still bring me into the desired environment, after hitting enter one more time.