[WIP] Deprecation warnings for maintainerless leaf packages#531180
[WIP] Deprecation warnings for maintainerless leaf packages#531180infinisil wants to merge 14 commits into
Conversation
|
Before further progress on this, can you please review |
677425c to
97c31c3
Compare
97c31c3 to
3a14a53
Compare
With a dependency chain like
a -> b -> c
it was not possible to e.g. add a `meta.problems.removal` to b, because that would cause b to be entirely unavailable as a dependency.
This PR slightly lifts that restriction by allowing both a and b to be marked with such a problem without causing a CI failure.
This is useful for:
- Having a problem on a package that needs to be removed but still has dependents (which then also need a problem)
- Having a problem on a package that is aliased under another attribute, which counts as a dependency
This enforces that any packages that are evaluated can't depend on other evaluated attributes that have problems
3a14a53 to
8e6e01f
Compare
Before, something like
nativeBuildInputs = [
(runCommand "dep" { meta.description = "Dep"; } "")
];
would cause an eval warning without failing CI
After this change, CI ensures that when evaluating the set of packages
that don't have internally disallowed problem kinds, no such problem
kinds are present.
Entirely guided by nixpkgs-vet and `nix-build ci -A eval.singleSystem` (on x86_64-linux)
70f574f to
77b04e1
Compare
|
While this PR is not entirely done just yet, the fundamentals are looking really good right now. After #533376 and #537051 (which this PR includes as the first commit right now), as well as some commits in here, all treewide changes needed are fully checked by CI. While some errors aren't ideal just yet, they can be improved still. Since I'm leaving Tweag after today, I won't have as much time to work on this anymore. In case I'm not able to finish this myself, here's the main bits of context to know:
Furthermore, the PR description has a lot of general info and the remaining TODOs. |
This implements part of the approved NixOS/rfcs#180 (rendered): Adding warnings to packages that both have no maintainers and are (definitely) leaf packages.
The goal of this is to either prompt users of packages to become maintainers, or to drop the packages if that doesn't happen.
With this PR, I invite you to try out this branch in your own NixOS configuration and report how well it works. Note that the branch is outdated by about a month, so don't actually deploy your machines with this :)
How it works
meta.hasNoMaintainersButDependentsfor accessible packages is set only if the package has no maintainers and the package attribute is referenced anywhere in Nixpkgs outside of the package definition itselfmeta.hasNoMaintainersButDependentsis not set.Some consequences are:
{}.helloappears somewhere andpkgs.hellois maintainerless, CI requirespkgs.hello.meta.hasNoMaintainersButDependentsto be set. Imo this is fine because it's only annoying for maintainerless packages.hellois a maintainerless leaf package and a PR adds it as a dependency to another package, that PR will also have to sethello.meta.hasNoMaintainersButDependents. Similarly it needs to be unset again if the dependency is removed again.Most notably this approach causes effectively no additional burden for committers, and instead pushes all the continuous maintenance to package maintainers via CI.
FAQ
meta.hasNoMaintainersNorDependents? Becausemeta.hasNoDependents/meta.isLeaf? Because:environment.systemPackages? This would be much easier to implement, because there's no need to check whether packages are leafs. Because:nix-build -Aand co.meta.problems-> need another separate mechanism for triggering warnings and changing severitiesnix-eval-jobs --show-input-drvsand checking which derivations are notinputDrvsof any other derivations? Because:TODO
meta.hasNoMaintainersButDependents = truewhere needed. This was assistent with ast-grep to satisfy the below two pointshasNoMaintainerButDependentsand co. should be named, as well as error messagesNo AI tools were used to create this PR.