Skip to content

meta.problems: Custom package problems [RFC127]#478539

Merged
infinisil merged 6 commits intoNixOS:masterfrom
tweag:rfc127
Feb 26, 2026
Merged

meta.problems: Custom package problems [RFC127]#478539
infinisil merged 6 commits intoNixOS:masterfrom
tweag:rfc127

Conversation

@infinisil
Copy link
Copy Markdown
Member

@infinisil infinisil commented Jan 9, 2026

This PR implements RFC127, originally based on @piegamesde's initial implementation in #177272 and @AkechiShiro's follow up to add some tests in #338267.

This PR improves over the above by:

  • Optimising performance, ending up with this difference, most notably:
    • gc.totalBytes: +0.3781%
    • nrFunctionCalls: +0.7062%
    • nrLookups: +3.8620%
    • nrPrimOpCalls: +1.0484%
    • nrThunks: +0.6940%
  • Adding more tests, achieving pretty much complete code coverage of what was added

Things done

  • Tests, runnable with nix-build -A tests.problems
  • Docs
  • Added myself as code owner to relevant files

Add a 👍 reaction to pull requests you find important.

@infinisil infinisil requested a review from adisbladis January 9, 2026 21:29
@infinisil infinisil added the 1.severity: significant Novel ideas, large API changes, notable refactorings, issues with RFC potential, etc. label Jan 9, 2026
@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 6.topic: stdenv Standard environment 8.has: documentation This PR adds or changes documentation labels Jan 9, 2026
Copy link
Copy Markdown
Member

@mdaniels5757 mdaniels5757 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooh, this looks great!

- "deprecated": The package relies on software which has reached its end of life.
- "maintainerless": Automatically generated for packages with `meta.maintainers == []`. Unique, not manually specifiable.

Each problem has a handler that deals with it, which can be one of "error", "warn" or "ignore".
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I think I'd prefer if this was called "severity".

Declaring what it is rather than what should be done with it feels more right to me.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Handler" also sort of implies that what's declared is an action or a command; perhaps even a custom one.

"Severity" OTOH is just a property of the problem itself.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea. It's a derivation from the RFC, but I don't think we need to follow it to the dot.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although, this also implies that we should change config.problems.handlers, and I'm not sure I want to go that far.

@infinisil
Copy link
Copy Markdown
Member Author

Ping, would be great to get this merged swiftly so that people can try it out

@ConnorBaker

This comment was marked as outdated.

@infinisil

This comment was marked as outdated.

Copy link
Copy Markdown
Contributor

@ConnorBaker ConnorBaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly nits/questions

Comment on lines 3 to 18
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty happy with this error message now tbh, but we can of course adjust this later if wanted

@infinisil infinisil force-pushed the rfc127 branch 2 times, most recently from a036cd4 to e382faf Compare February 20, 2026 14:18
@infinisil
Copy link
Copy Markdown
Member Author

I've addressed all feedback now and would like to merge this soon.

I'll also try to get follow-ups to this done, including migration of broken, unsupported, and an introduction of a generic assertion problem type, for CUDA and other use cases.

infinisil and others added 6 commits February 26, 2026 14:53
The attributes of the warning/invalid values are never used anywhere,
and maintaining these would make future changes harder
Not just used for errors anymore
See https://github.com/NixOS/rfcs/blob/master/rfcs/0127-issues-warnings.md

Co-Authored-By: piegames <git@piegames.de>
Co-Authored-By: AkechiShiro <14914796+AkechiShiro@users.noreply.github.com>
@infinisil
Copy link
Copy Markdown
Member Author

Pushed to fix conflict. I'll go ahead with the merge now, I hope nothing breaks from this!

@infinisil infinisil enabled auto-merge February 26, 2026 14:11
@infinisil infinisil added this pull request to the merge queue Feb 26, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 26, 2026
@infinisil infinisil added this pull request to the merge queue Feb 26, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 26, 2026
@infinisil
Copy link
Copy Markdown
Member Author

There's some spurious GitHub Actions failures, let's try again..

@infinisil infinisil added this pull request to the merge queue Feb 26, 2026
Merged via the queue into NixOS:master with commit 73c2995 Feb 26, 2026
53 of 70 checks passed
@github-project-automation github-project-automation bot moved this to Done in Stdenv Feb 26, 2026
@infinisil
Copy link
Copy Markdown
Member Author

Follow-up for meta.broken: #494416

infinisil added a commit to tweag/nixpkgs that referenced this pull request Mar 2, 2026
This was an oversight in NixOS#478539
that became apparent in NixOS#494416:

If there's a failing problem in Nixpkgs packages, CI will call
handleEvalIssue on it, but the problem error was missing a `.reason`.

Though even if it did have a reason, we need to do more to make sure
we don't break any code that uses it, so the new code uses the problem
kind as the reason, which happens to match with the reason for all
expected problem kinds.
infinisil added a commit to tweag/nixpkgs that referenced this pull request Mar 2, 2026
This was an oversight in NixOS#478539
that became apparent in NixOS#494416:

If there's a failing problem in Nixpkgs packages, CI will call
handleEvalIssue on it, but the problem error was missing a `.reason`.

Though even if it did have a reason, we need to do more to make sure
we don't break any code that uses it, so the new code uses the problem
kind as the reason, which happens to match with the reason for all
expected problem kinds.
@infinisil infinisil deleted the rfc127 branch March 3, 2026 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.severity: significant Novel ideas, large API changes, notable refactorings, issues with RFC potential, etc. 6.topic: stdenv Standard environment 8.has: documentation This PR adds or changes documentation 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

8 participants