Mic92 / nixpkgs-review

Review pull-requests on https://github.com/NixOS/nixpkgs
MIT License
380 stars 63 forks source link

Running `pr 187960` causes `undefined variable 'kdialog'` on buildable PR. #278

Open soupglasses opened 2 years ago

soupglasses commented 2 years ago

When running nixpkgs-review pr 187960 for NixOS/nixpkgs/pull/187960 it fails with an error:

Log output ``` …/nixpkgs master *1 % nixpkgs-review pr 187960 $ git -c fetch.prune=false fetch --no-tags --force https://github.com/NixOS/nixpkgs master:refs/nixpkgs-review/0 pull/187960/head:refs/nixpkgs-review/1 remote: Enumerating objects: 67841, done. remote: Counting objects: 100% (44650/44650), done. remote: Compressing objects: 100% (14262/14262), done. remote: Total 37516 (delta 25458), reused 32032 (delta 20708), pack-reused 0 Receiving objects: 100% (37516/37516), 19.62 MiB | 7.69 MiB/s, done. Resolving deltas: 100% (25458/25458), completed with 1016 local objects. From https://github.com/NixOS/nixpkgs 3b104056ffa..960e4e772bf master -> refs/nixpkgs-review/0 3fcf17c3484..1abe038db93 refs/pull/187960/head -> refs/nixpkgs-review/1 $ git worktree add /home/sofi/.cache/nixpkgs-review/pr-187960/nixpkgs 960e4e772bff4c1900e5730df1d1da9016c17aa5 Preparing worktree (detached HEAD 960e4e772bf) Updating files: 100% (32107/32107), done. HEAD is now at 960e4e772bf input-remapper: 1.4.2 -> 1.5.0 (#191967) $ git merge --no-commit --no-ff 1abe038db935f54db3669d705ebb3cd05a4651fd Auto-merging pkgs/top-level/all-packages.nix Automatic merge went well; stopped before committing as requested error: undefined variable 'kdialog' at /home/sofi/.cache/nixpkgs-review/pr-187960/nixpkgs/pkgs/games/heroic/fhsenv.nix:18:5: 17| gnome.zenity 18| kdialog | ^ 19| mangohud (use '--show-trace' to show detailed location information) nix --experimental-features nix-command --system x86_64-linux eval --json --impure --expr (import /nix/store/77glclqj7xxhk5x8iw25xy859h4p4a6j-nixpkgs-review-2.7.0/lib/python3.10/site-packages/nixpkgs_review/nix/evalAttrs.nix { allowAliases = false; attr-json = /tmp/tmppxi692hg; }) failed to run, /tmp/tmppxi692hg was stored inspection https://github.com/NixOS/nixpkgs/pull/187960 failed to build $ git worktree prune ```

But if you pull the same git hash 1abe038db935f54db3669d705ebb3cd05a4651fd manually and run nix build .#heroic. It builds correctly without error.

soupglasses commented 2 years ago

Likely related: #200

This is a specific issue with logs and a git hash however. This issue also seems to happen between multiple commits as well. 3a03707a34db94fbf8f32d097523fdea2561e714 also showed the same behaviour.

vcunat commented 1 year ago

That's bug in the PR and not in the tool. kdialog is a deprecated top-level alias and nixpkgs is strict about this. Right now that's blocking the nixos-unstable channel via https://hydra.nixos.org/build/195122787

vcunat commented 1 year ago

https://github.com/NixOS/nixpkgs/pull/195628

soupglasses commented 1 year ago

This might be an issue to put elsewhere, but what confuses me is how it was buildable on seemingly all systems without error, but nixpkgs-review complained about the exact same git hash.

Guessing it has to do with the evalAttrs.nix { allowAliases = false; ... } in nixpkgs-review. Maybe there should be some specification to the error message similar to undefined variable x (might be an alias?) to help debugging?

vcunat commented 1 year ago

I can't see how to do such a message, I'm afraid.

vcunat commented 1 year ago

Maybe this one will help in future: https://github.com/NixOS/rfcs/pull/127