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

Cleanup all-packages.nix #40047

Closed
wants to merge 4 commits into from
Closed

Cleanup all-packages.nix #40047

wants to merge 4 commits into from

Conversation

matthewbauer
Copy link
Member

Motivation for this change

This is another go at cleaning up all-packages.nix. This adds a few more sections to the top for `special' attributes to help us with organization.

Here is the full list:

  • Standard environment tools - common tools provided by stdenv
  • Toolchains - compilers provided by different stdenvs
    • GCC
    • LLVM
  • Standard C libraries - libc used by different stdenvs
    • Glibc
    • Musl
  • Operating systems - OS specific packages (each now has their own file)
  • Compatibility layers - ‘meta’ packages that depend on the host platform

Note that there are a bunch of changes waiting in staging. I will wait on those merging back into master before merging this because of the many conflicts it will cause.

@oxij
Copy link
Member

oxij commented May 7, 2018 via email

@edolstra
Copy link
Member

edolstra commented May 7, 2018

This is hard to review because it removes ~100 files, which as far as I can tell is not really related to all-packages.nix cleanup.

@matthewbauer
Copy link
Member Author

Yes there might be some stuff in there worth keeping. It’s horribly out of date right now though. The ones I can find unavailable in *ELPA are ProofGeneral & Drew Adams’ packages. Are there any others?

On autogenerated packages, I think we should wait until it becomes clear all-packages.nix is unmaintainable. Right now there are still lots of simple org stuff we can do. For instance I’d like to move all of the Linux kernels & Linux specific packages to their own attribute set. That alone could save us hundreds of lines. Other ideas like banning anything that’s not a derivation or attribute set from the all-packages.nix (there are a weirdly large number of functions that definitely should go somewhere else.) could help.

My main concern with autogenerating is that it’s not always clear initially what is a simple packages vs. a complicated package. Most packages start off straightforward but then something like gtk3 comes along and we set gtk=gtk3 as a package argument. all-packages.nix is the place where we sort out all of the dependency conflicts between packages & autogenerated data would not have an easy way to do that.

we don’t need to use recurseIntoAttrs twice
specifically what should go in unix-tools.nix
meta handles this for us
This adds some sections to the top of all-packages.nix. Here is the
full list:

- Standard environment tools - common tools provided by stdenv
- Toolchains - compilers provided by different stdenvs
  - GCC
  - LLVM
- Standard C libraries - libc used by different stdenvs
  - Glibc
  - Musl
- Operating systems - OS specific packages (each now has their own file)
- Compatibility layers - ‘meta’ packages that depend on the host platform

Some things have been reworked to fit into the above framework, but
hopefully this is not a mass rebuild.
@matthewbauer
Copy link
Member Author

Ok split off the Emacs stuff into #40132.

@oxij
Copy link
Member

oxij commented May 7, 2018 via email

@matthewbauer
Copy link
Member Author

I see no benefit in { gtk, ...}: ... that has to be immediately overriden with gtk = gtk3 in all-packages.nix.

I think in practice we do use versioned arguments a lot in Nixpkgs. I still think the original policy is good, just hard to enforce. The point is that we don't want new packages to use old dependencies & when they do it should be extremely obvious. For instance, if someone added a package that needs gtk2, it would be very easy to hide within the Nixpkgs tree if it just did {gtk2, ...}: ... vs. actually having to pass callPackage { gtk = gtk2; } where it can be very easily found when we end up removing gtk2. It's more useful for maintainers than the initial package author.

Or, worse, but very common, { supportWhatever ? false } immediately overriden with supportWhatever = true in all-packages.nix. The former just wastes space, the latter is also super-confusing.

Those are definitely bad & confusing. Ideally we would just have one or the other- either provide the default argument in callPackage or provide it as a default in the package's Nix expression. I prefer the former but also realize it would make all-packages.nix even bigger without any obvious benefit (besides maybe discoverability).

@oxij
Copy link
Member

oxij commented May 7, 2018 via email

@matthewbauer
Copy link
Member Author

Closing in favor of small PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants