nix-community / nixpkgs-update

Updating nixpkgs packages since 2018
Creative Commons Zero v1.0 Universal
427 stars 70 forks source link

When an attr begins with a number, add a `_` #369

Open Artturin opened 1 year ago

Artturin commented 1 year ago

Attributes cannot begin with a number so in nixpkgs a _ is added to the beginning of them

For example 1password is _1password

https://r.ryantm.com/log/1password/2023-03-25.log

1password 8.10.1-19.BETA -> 8.10.3 https://repology.org/metapackage/1password/versions
attrpath: 1password
Received ExitFailure 1 when running
Raw command: /nix/store/3nqhcyc7vid1npgcd0m7arg5sn325nhz-nix-2.12.0/bin/nix eval .#1password --apply "p: builtins.hasAttr \"updateScript\" p"
Standard error:

error: flake 'git+file:///var/cache/nixpkgs-update/worker/worktree/1password' does not provide attribute 'packages.x86_64-linux.1password', 'legacyPackages.x86_64-linux.1password' or '1password'
       Did you mean _1password?
rhendric commented 1 year ago

Are there more recent occurrences of this? I think this was fixed in #345.

Artturin commented 1 year ago

Top 4 on https://r.ryantm.com/log/ are all old and there's no `.`

rhendric commented 1 year ago

These were all written to this month:

Artturin commented 1 year ago

Ahh then the ones at the top are old https://r.ryantm.com/log/1password/

Can they be removed?

rhendric commented 1 year ago

If we do something about those old paths, it would be consistent to do the same thing to all the python3.xx-foo paths that are now mostly python3xxPackages.foo; pretty sure there are more such patterns but other than an age heuristic I don't know how best to find them all.

(The literal answer to ‘can’ is yes, but the implied ‘should’ and ‘would’ are for @ryantm to answer/do.)

Edit: Actually, come to think of it, the ‘does not provide attribute’ message is pretty standard and easy to detect. I would endorse a plan to delete any log directory that only contains files satisfying all of the following: