-
-
Notifications
You must be signed in to change notification settings - Fork 15.5k
common-updater-scripts: add mark-broken script #85337
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
Conversation
|
||
nixFile=$(nix-instantiate --eval --json -E "with import ./. {}; (builtins.unsafeGetAttrPos \"description\" $attr.meta).file" | jq -r .) | ||
if [[ ! -f "$nixFile" ]]; then | ||
die "Couldn't evaluate 'builtins.unsafeGetAttrPos \"meta\" $attr' to locate the .nix file!" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hope you're not sick of me yet... ;)
die "Couldn't evaluate 'builtins.unsafeGetAttrPos \"meta\" $attr' to locate the .nix file!" | |
die "Couldn't evaluate 'builtins.unsafeGetAttrPos \"description\" $attr' to locate the .nix file!" |
Somewhat unfortunate that meta
points to pkgs/stdenv/generic/make-derivation.nix
for the rare cases (if any) where a package doesn't have a description
, but what can ya do...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I thought about what meta attribute is set for almost all packages. If there is a better way to find the file containing the meta section for a nixpkgs attribute, it would be great to know it.
Otherwise we can try to improve the checks to detect if it found the wrong file, for example a specific check for make-derivation.nix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I committed something similar to your suggested change, but I will still leave this conversation open, because I think there should be more improvements in this regard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is <pkg>.meta.position
, but that doesn't work for things like cargo-download
which returns pkgs/build-support/rust/build-rust-crate/default.nix:224
(and includes the line number, which would need to be stripped out).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something to keep in mind with your new wording here: trying to evaluate builtins.unsafeGetAttrPos \"meta.description\" claws
(as displayed) returns null
, while builtins.unsafeGetAttrPos \"description\" claws.meta
(which is what is actually evaluated) returns the desired information.
Works for me, and that would probably be just enough for me 😄 |
Thank you @petabyteboy ✨ |
Motivation for this change
https://twitter.com/grhmc/status/1250541029180280833
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)