How to debug infinite recursion?

While developing a flake, I just got this error:

> nix run --show-trace
warning: Git tree '/var/home/yajo/prodevel/example' is dirty
error: stack overflow (possible infinite recursion)

Why I get no stack trace if I’m pasing --show-trace?

Any way to know where the recursion is happening?

1 Like

I’ve isolated a reproducible case with this infinite recursion. Could anybody help please? See Draft: test(poetry2nix): reproduce infinite recursion (!1) · Merge requests · Moduon / Mr. Chef · GitLab

I get an error:

$ nix flake check '.?dir=tests/test_poetry2nix/'
error: getting status of '/nix/store/5i2cy87rz4mch0f6ggfy9sk13y8vsn3r-source/tests/test_poetry2nix': No such file or directory

Yes, that’s because I got some feedback and simplified the flake and test structure before getting to the fix.

You can reproduce it with:

nix flake check 'gitlab:moduon/mrchef?rev=7f6177504daaa74d1b8dc64b256fbf15866efb3a' --show-trace

The next commit includes the fix and won’t fail:

nix flake check 'gitlab:moduon/mrchef?rev=6466f3e360d1e44f40dea04e376ec48745700007' --show-trace