Minor check-meta.nix optimisations and cleanups#466947
Merged
Merged
Conversation
6cf94a3 to
f3ff0bd
Compare
Member
Author
|
Performance stats are looking good, about a 1% improvement: https://github.com/NixOS/nixpkgs/actions/runs/19837639476?pr=466947#summary-56839009923 |
- Makes the code more clean and obvious - Allows remediations to depend on values computed during the check (useful for NixOS#338267)
Probably that's a historical artifact
Remove some clearly-unnecessary ones and add some direly-needed ones
- Avoid some attribute set accesses - Make a variable more local, avoiding a thunk - Avoid always checking config.checkMeta for every attribute
- Boolean operator short-circuit optimisation - Eta-reduction and make some allow/blocklist-dependend functions more cachable - Inline functions that are only used once - Make getEnv cached
- Remove the internal conditioning on the result of `valid`, we can know exactly when which value is produced - Faster success path for checkMeta, also avoiding an environment - Inline handlers
f3ff0bd to
660cecd
Compare
check-meta.nix optimisations and cleanupscheck-meta.nix optimisations and cleanups
Member
Author
|
I'll merge this soon myself unless I get a review. I don't think there's a reason not to have this :) |
Member
|
Looks great! |
Contributor
|
This broke release-checks. |
Contributor
Member
|
Thanks. I was just bisecting what broke it. |
Member
Author
|
Aw damn :/ |
1 task
Member
Author
|
Reapply with fix in #471029 |
infinisil
commented
Dec 15, 2025
| reason = "broken"; | ||
| errormsg = "is marked as broken"; | ||
| remediation = remediate_allowlist "Broken" (x: ""); |
Member
Author
There was a problem hiding this comment.
Suggested change
| remediation = remediate_allowlist "Broken" (x: ""); | |
| remediation = remediate_allowlist "Broken" (x: "") attrs; |
This was the problem/fix for reference
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Various minor performance optimisations and some refactorings. Motivated as preparation for #338267
Things done
Add a 👍 reaction to pull requests you find important.