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 0180] Remove broken and unmaintained leaf packages #180

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
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
92 changes: 92 additions & 0 deletions rfcs/0180-broken-package-removal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
---
feature: broken-package-removal
start-date: 2024-07-14
author: Jörg "Mic92" Thalheim
co-authors:
shepherd-team: @emilazy @preisi @jopejoe1
shepherd-leader: @jopejoe1
related-issues:
---

# Summary

[summary]: #summary

This RFC defines the conditions under which we remove broken and unmaintained leaf packages.
The RFC does not aim to define all possible reasons for removing a package but instead focuses on simple, automatable rules.
Since this document serves as a guideline for automatic package removal, it also allows for the possibility of removing a package earlier for other reasons.

# Motivation

[motivation]: #motivation

Broken and unmaintained packages still consume valuable time.
Broken packages need to be evaluated to some extent, and unmaintained packages might still need to be rebuilt when one of their dependencies changes.
Removing unmaintained or unused code should improve overall package quality and help save resources.
Since adding packages is easy, removing them should also be simple, ideally automated.

# Detailed Design

[design]: #detailed-design

All packages marked as broken or unmaintained will be removed after a full NixOS release cycle.
For example, if `hello-unmaintained` is marked as unmaintained in 23.11, it can be removed from master after the 24.05 release.

## Broken Packages
Mic92 marked this conversation as resolved.
Show resolved Hide resolved

Packages that are unconditionally marked as broken on all platforms are candidates for removal.
If a package has dependent packages, those dependent packages will also be marked as indirectly broken.
If the dependent packages cannot function without the broken package, they should also be removed.
For example, if a library is broken and an application depends on it, the application will also be removed.

## Unmaintained Packages

We will add an "unmaintained" warning for all packages with an empty maintainer field that do not have any dependent packages.
Ideally, we will have automation or semi-automation in place to create pull requests for this process (see future work).

If a NixOS module depends on any removed package and is non-functional without it, the module will be removed as well.
In `pkgs/top-level/aliases.nix`, we can link to the pull request that removed the package, making it easier for users to recover the nix expression if needed.

In the pull request that removes a package, we will also ping the people who have modified or updated the package, excluding those who only touched the package as part of a tree-wide update.

# Examples and Interactions

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

- A release manager or another contributor marks `packageA` as broken in 23.11, notifying the maintainer.
- They have one full release cycle, as described, to fix `packageA`.
- After the 24.05 release, `packageA` can be automatically removed from the nixpkgs master branch, as outlined in this RFC.

# Drawbacks

[drawbacks]: #drawbacks

Some unmaintained packages may still have users who will no longer be able to use them, but the hope is that removing unmaintained packages will encourage these users to step up as maintainers.
In such cases, recovering the package from the git history should be relatively easy.

# Alternatives

[alternatives]: #alternatives

- Keep all packages.
- Archive removed nix expressions. Note that this RFC does not prevent this effort from being implemented in addition.

# Prior Art

[prior-art]: #prior-art

- Most Linux distributions have rules for removing unmaintained packages, e.g., [Debian](https://www.debian.org/doc/manuals/developers-reference/developers-reference.en.html#orphaning-a-package).
- [Nixpkgs eval time is increasing too fast](https://github.com/NixOS/nixpkgs/issues/320528): This issue discusses ways to improve evaluation time.

# Unresolved Questions

[unresolved]: #unresolved-questions

None.

# Future Work

[future]: #future-work

- Develop automation that opens pull requests to remove packages.
- Add deprecation warnings for packages scheduled for removal to notify potential users.