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

[RFC 0127] Nixpkgs "problem" infrastructure #127

Merged
merged 25 commits into from
Jul 12, 2023
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
60cb23d
[RFC 0127] Nixpkgs issues and warnings (#127)
piegamesde Jun 11, 2022
ee72999
Add URLs as structured information
piegamesde Jun 15, 2022
c109c31
Update rfcs/0127-issues-warnings.md
piegamesde Sep 12, 2022
ff2e2d4
Update rfcs/0127-issues-warnings.md
piegamesde Sep 12, 2022
f83067a
Update rfcs/0127-issues-warnings.md
piegamesde Sep 13, 2022
2daf978
Update rfcs/0127-issues-warnings.md
piegamesde Sep 13, 2022
2b63424
Update rfcs/0127-issues-warnings.md
piegamesde Sep 13, 2022
e5c0e13
Update rfcs/0127-issues-warnings.md
piegamesde Sep 13, 2022
3212d31
RFC 127 update shepherds
piegamesde Sep 13, 2022
ecdbe2c
RFC 127 rework
piegamesde Sep 13, 2022
c907adb
Point out that the previous warnings system was not documented
piegamesde Sep 13, 2022
d232a2d
Rework ignore mechanism
piegamesde Sep 17, 2022
ff6e33d
Update rfcs/0127-issues-warnings.md
piegamesde Oct 14, 2022
6ffce6d
Update rfcs/0127-issues-warnings.md
piegamesde Oct 14, 2022
24a8985
Remove "resolved" attribute again
piegamesde Oct 15, 2022
1b1424e
Incorporate review feedback
piegamesde Oct 15, 2022
1e6725e
Rewrite (again)
piegamesde Dec 12, 2022
81564e6
Rename throw->error, trace->warn
piegamesde Jan 21, 2023
c5c64ec
Make meta.problems an attrset
piegamesde Jan 31, 2023
2a78241
Rewrite *again*, most change is in the configuration options
piegamesde Apr 28, 2023
4f311de
Review update (WIP)
piegamesde May 15, 2023
b253df1
Review update
piegamesde May 30, 2023
7939f49
Update shepherds list
piegamesde Jun 1, 2023
33ec9a6
Meeting update
piegamesde Jun 19, 2023
83319ec
Typos
piegamesde Jun 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
RFC 127 rework
  • Loading branch information
piegamesde committed Sep 13, 2022
commit ecdbe2c9b8feeb3cbc07b9e0a7ebf8fe8838cf78
36 changes: 29 additions & 7 deletions rfcs/0127-issues-warnings.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ related-issues: https://github.com/NixOS/nixpkgs/pull/177272
## Summary
[summary]: #summary

Introduce an issue system into Nixpkgs, similar to broken and insecure, but with a custom per-package message. This will then be used to warn users about packages that are in need of maintenance. Packages that have an open issue for a long time should eventually be removed.
Inspired by the derivation checks for broken and insecure packages, a new system called "warnings" is introduced. It is planned to eventually replace the previously mentioned systems, as well as the current "warnings" (which currently only prints a trace message for unmaintained packages). `meta.issues` is added to derivations, which can be used to let the evaluation of individual packages fail with a custom message. This will then be used to warn users about packages that are in need of maintenance. Packages that have an open issue for a long time should eventually be removed, although doing so is not part of the RFC.

## Motivation
[motivation]: #motivation
Expand All @@ -29,14 +29,14 @@ Apart from that, there is need for a general per-package warning mechanism in ni

### Package issues

A new attribute is added to the `meta` section of a package: `issues`. If present, it is a list of attrsets which each have the following fields:
A new attribute is added to the `meta` section of a package: `issues`. If present, it is a list of attrsets which each have at least the following fields:

- `message`: Required. A string message describing the issue with the package.
- `kind`: Optional but recommended. If present, the resulting warning will be printed as `kind: message`.
- `date`: Required. An ISO 8601 `yyyy-mm-dd`-formatted date from when the issue was added.
- `urls`: Optional, list of strings. Can be used to link issues, pull requests and other related items.

Other attributes are allowed. Their meanings may be kind-specific.
Other attributes are allowed. Some message kinds may specify additional required attributes.

Example values:

Expand All @@ -55,10 +55,25 @@ meta.issues = [{

### nixpkgs integration

Two new config options are added to nixpkgs, `ignoreWarningsPredicate` and `ignoreWarningsPackages`. A new environment variable is defined, `NIXPKGS_IGNORE_WARNINGS`. Their semantic and implementation directly parallel the existing "insecure" package handling.
The following new config options are added to nixpkgs: `ignoreWarningsPredicate`, `ignoreWarningsPackages`, `traceIgnoredWarnings`. The option `showDerivationWarnings` will be removed. A new environment variable is defined, `NIXPKGS_IGNORE_WARNINGS`.

The semantic and implementation of `ignoreWarningsPredicate` and `ignoreWarningsPackages` directly parallels the existing "insecure" package handling.

Similarly to broken, insecure and unfree packages, evaluating a package with an issue fails evaluation. Ignoring a package without issues (i.e. they have all been resolved) results in a warning at evaluation time.

The previous warnings system in `check-meta.nix` is removed, together with `showDerivationWarnings`. Instead, ignored warnings are printed with `builtins.trace` depending on the new option `traceIgnoredWarnings`.

### Warning kinds

At the moment, the following values for the `kind` field of a warning are known:

- `removal`: The package is scheduled for removal some time in the future.
Copy link
Member

Choose a reason for hiding this comment

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

I'd argue that scheduled removals should not cause an error like this RFC is seemingly proposing. Or why should they?

Copy link
Member Author

Choose a reason for hiding this comment

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

Think of it as removing a package by adding a removal problem, and then users get some grace period where the package is still available for some time.

- `deprecated`: The package has been abandoned upstream or has end of life dependencies.
- `maintainerless`: `meta.maintainers` is empty
- `insecure`: The package has some security vulnerabilities

Not all values make sense as issues (i.e. within `meta.issues`): Some warnings may be automatically generated from other `meta` attributes (for example `maintainerless`). New kinds may be added in the future.

## Examples and Interactions
[examples-and-interactions]: #examples-and-interactions

Expand All @@ -79,7 +94,7 @@ As an example, take `gksu` with the `gksu` → `libgksu` → `libglade` → `pyt

### Backporting

New issues generally should not be added to stable branches, and also not be backported to them, since this breaks evaluation.
New issues generally should not be added to stable branches if possible, and also not be backported to them, since this breaks evaluation. The same rule applies to other changes to a pacakge's `meta` which may generate a warning and thus lead to evaluation failure too. A notable exception are warnings of kind `insecure`, if there is no fix that can be backported.

## Drawbacks
[drawbacks]: #drawbacks
Expand Down Expand Up @@ -115,15 +130,22 @@ A few other sketches about how the declaration syntax might look like in differe
message = "deprecation: Python 2 is deprecated #12345";
};
};

# Proposal by @matthiasbeyer
meta.issues = [
{ transitive = pkgs.python2.issues }
];
}
```

## Unresolved questions
[unresolved]: #unresolved-questions

- From above: "Ignoring a package without issues (i.e. they have all been resolved) results in a warning at evaluation time". How could this be implemented, and efficiently?
- Should issues be a list or an attrset?
- A lot of bike shedding. (See below)
- ~~Should issues be a list or an attrset?~~
- We are using a list for now, there is always the possibility to also allow attrsets in the future.
- ~~A lot of bike shedding. (See below)~~
- Packages may have "issues" that generate "warnings" that have to be "ignored". Issues are explicitly added to packages in `meta.issues`, whereas warnings can be generated automatically from other sources, like other `meta` attributes.

## Future work
[future]: #future-work
Expand Down