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

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

Open
Artturin opened this issue Oct 24, 2023 · 5 comments
Open

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

Artturin opened this issue Oct 24, 2023 · 5 comments

Comments

@Artturin
Copy link
Member

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
Copy link
Member

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

@Artturin
Copy link
Member Author

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

@Artturin
Copy link
Member Author

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

Can they be removed?

@rhendric
Copy link
Member

rhendric commented Oct 24, 2023

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:

  • less than 1kB
  • older than 2023 May 1
  • contains a line matching /^error: flake '[^']*' does not provide attribute/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants