New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Evaluate <nixpkgs/lib> #348
Comments
Looking at the trace, it looks like its getting stuck on https://github.com/NixOS/nixpkgs/blob/master/lib/types.nix#L23 This is doing some recursive stuff that maybe interferes with strict? |
This is a great test case, I'm looking at now. The question is which piece of this puzzle are we being too strict about. |
@matthewbauer This demonstrates the problem:
For hnix it's an error to evaluate this into normal form, but apparently not for nix:
I will introduce an |
Or better, change
to
To indicate when cycles have been detected during normalization. Or an equivalent expressive data type to capture this possibility. This will keep representation of cycles out of the non-normalized representation. |
Sounds good! I think this is related to how Nix handles a lot of different things like the |
@matthewbauer I've finished changing |
This allows us to detect and report cycles during normalization. See #348
@matthewbauer This work is on the |
Yes HashMap sounds okay. Nix actually just uses a set of values it has visited: https://github.com/NixOS/nix/blob/bc65e02d9671ef6af2c25b4cc7a0a34944d98a2d/src/libexpr/eval.cc#L47 It might make sense to just use Data.Set then. |
Here is an implementation of this: https://github.com/obsidiansystems/hnix/tree/cycles @jwiegley It looks like the free stuff has broken a few tests though. Might be something with Eq instances? |
@matthewbauer I tried your branch and it never finishes evaluation for me (OOMs).
|
I believe this can be closed |
Yup, it evals correctly now. |
The text was updated successfully, but these errors were encountered: