Skip to content
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

nixpkgs-check-by-name reports IO error for Nix versions 2.21+ #78

Closed
philiptaron opened this issue Jul 8, 2024 · 2 comments · Fixed by #79
Closed

nixpkgs-check-by-name reports IO error for Nix versions 2.21+ #78

philiptaron opened this issue Jul 8, 2024 · 2 comments · Fixed by #79
Labels
bug Something isn't working

Comments

@philiptaron
Copy link
Contributor

When running nixpkgs-check-by-name with Nix versions greater than 2.20, it reports the following:

I/O error:  Failed to get the definition info for attribute acl: In pkgs/stdenv/linux/default.nix, attribute parent node is not an attribute path node: [email protected]
@philiptaron philiptaron added the bug Something isn't working label Jul 8, 2024
@philiptaron philiptaron changed the title nixpkgs-check-by-name reports IO error nixpkgs-check-by-name reports IO error for Nix versions 2.21+ Jul 8, 2024
@infinisil
Copy link
Member

infinisil commented Jul 12, 2024

Interesting, found the problem: builtins.unsafeGetAttrPos got smarter in Nix 2.21!

# test.nix
let
  attrs = {
    inherit ({ })
      abc def
      hij klm;
  };
in
builtins.mapAttrs (name: _value:
  let
    pos = builtins.unsafeGetAttrPos name attrs;
  in
  [ pos.line pos.column ]
) attrs
$ nix-build '<nixpkgs>' -A nixVersions.nix_2_20 && result/bin/nix-instantiate --eval test.nix --strict
{ abc = [ 3 18 ]; def = [ 3 18 ]; hij = [ 3 18 ]; klm = [ 3 18 ]; }

$ nix-build '<nixpkgs>' -A nixVersions.nix_2_21 && result/bin/nix-instantiate --eval test.nix --strict
{ abc = [ 4 7 ]; def = [ 4 11 ]; hij = [ 5 7 ]; klm = [ 5 11 ]; }

Looks like this isn't part of the test suite in https://github.com/NixOS/nixpkgs-check-by-name/blob/0c73cb7ad5d35f2bd67206bfbf114b580103e946/src/nix_file.rs#L422-L463, would be great to add it there

@philiptaron
Copy link
Contributor Author

philiptaron commented Jul 14, 2024

It might have been eldritch horrors in NixOS/nix@1edd6fa

infinisil added a commit that referenced this issue Jul 19, 2024
This makes the binary always use the same Nix version, instead of getting
it from PATH. This makes it more reproducible, because issues from
different Nix versions can't occur anymore,
e.g. #78
infinisil added a commit that referenced this issue Jul 19, 2024
This makes the binary always use the same Nix version, instead of getting
it from PATH. This makes it more reproducible, because issues from
different Nix versions can't occur anymore,
e.g. #78
infinisil added a commit to NixOS/nixpkgs that referenced this issue Jul 23, 2024
… to 27"

This partially reverts commit ab7becf.

The pkgs/by-name check doesn't work for newer Nix versions yet,
see NixOS/nixpkgs-vet#78
infinisil added a commit to infinixbot/nixpkgs that referenced this issue Jul 27, 2024
… from 26 to 27""

This reverts commit 9906947.

With the parent commit,
NixOS/nixpkgs-vet#78 is fixed, so
there's no problem related to the Nix version anymore.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants