NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
16.52k stars 13k forks source link

`nix-instantiate --strict --eval` not terminating #21309

Open pGarlick opened 7 years ago

pGarlick commented 7 years ago

In recent versions of Nixpkgs the 'nix-instantiate --strict' command does not terminate. For example, using commit b02e6cc of nixpkgs, the following command:

$ nix-instantiate --strict --eval --xml -A opencascade_oce /data/paul/sourceCode/nixpkgs | wc -c

produces:

trace: lib.zip is deprecated, use lib.zipAttrsWith instead trace: mkStrict' is obsolete; usemkOverride 0' instead. error: stack overflow (possible infinite recursion) 701463173

So, approximately 700 MB of xml is generated before the process crashes. This also occurs with all the other packages I have tried (-A gmsh, for example, instead of -A opencascade_oce).

However, if I rewind to a previous commit (f22817d is the commit for the 16.09 tag):

$ git checkout f22817d

Then the same command produces:

trace: lib.zip is deprecated, use lib.zipAttrsWith instead trace: mkStrict' is obsolete; usemkOverride 0' instead. trace: types.list' is deprecated; usetypes.listOf' instead 18727208

This time only 19MB of xml is produced and the process terminates.

It appears that the 'infinite recursion' problem has been introduced between the earlier version, 16.09, and the current version. Is this a bug? Is it possible to predict whether 'nix-instantiate --strict' will terminate or not?

Technical details

Ekleog commented 5 years ago

(triage) This still happens as of 604b0f34c96

stale[bot] commented 4 years ago

Thank you for your contributions.

This has been automatically marked as stale because it has had no activity for 180 days.

If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.

Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse.
  3. Ask on the #nixos channel on irc.freenode.net.
Atemu commented 1 year ago

This still happens as of e4902f2eb0c2e03a02bc2eb4df7f5585d5c54b95

pennae commented 1 year ago

this is going to be fundamentally unresolvable as long as packages include themselves in passthru like perl does (https://github.com/NixOS/nixpkgs/blob/5d447a9e7009a116ab1e62dd5599b9272206067f/pkgs/development/interpreters/perl/default.nix#L154-L157)