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

Proposal: Split the all-packages.nix file #8801

Closed
matthiasbeyer opened this issue Jul 13, 2015 · 11 comments
Closed

Proposal: Split the all-packages.nix file #8801

matthiasbeyer opened this issue Jul 13, 2015 · 11 comments

Comments

@matthiasbeyer
Copy link
Contributor

The all-packages.nix file is currently 15.1k lines long. This is too mach IMHO.

As far as I can tell, there are several sections, one for the environment, one for normal packages, one for libraries.

I think it would be a good idea to split this enormous file. While doing this, one could also sort the packages, as they are not entirely sorted as far as I can tell.

Any objections? Maybe I can try to do this in the next few days.

@copumpkin
Copy link
Member

I think there was already a branch attempting mostly eliminate the big list via readDir and friends. I'd love it if it worked. Main thing to watch out for is being as lazy as possible so you don't accidentally traverse the entire filesystem with every evaluation, and providing a sensible overrides mechanism when you don't just want to pass in the default values in the callPackage scope.

I feel a bit more torn about just splitting it into smaller files, since I then no longer have an easy place to search for everything, and still have to manually maintain a big list o' stuff.

@matthiasbeyer
Copy link
Contributor Author

@copumpkin I'd simply split them files and not try to invent something. Searching would still be possible via grep -r or ack or ag.

@vcunat
Copy link
Member

vcunat commented Jul 13, 2015

Recently we had a long discussion about the manual(s) – whether they should be single-page or split. And that was just about readability of the result. There are subsets already not in that single file (haskell, python, etc.), but it still simplifies some things. Another problem is that the categories are rather ad-hoc, and recently we had a serious proposal to abandon them and just sort the whole file alphabetically. (Note that e.g. large fraction of packages contain some library used by another package.)

BTW, that Eelco's attempt wasn't much about splitting, IIRC, but mainly about getting rid of most of the lines completely. If we just split it up, we would need to read all the parts always, but that would be about the same speed as now, as long as it's only several files.

I don't yet see a solution that would be decisively and significantly better than what we have now.

@copumpkin
Copy link
Member

@vcunat do you have a link to Eelco's attempt and some explanation (for posterity) of what was wrong with it?

@vcunat
Copy link
Member

vcunat commented Jul 13, 2015

No, sadly, I can't find it ATM and I'm not even sure why it wasn't used in the end.

@vcunat
Copy link
Member

vcunat commented Jul 13, 2015

Here, I found some ML reference http://comments.gmane.org/gmane.linux.distributions.nixos/16928 to ece61b7.

@matthiasbeyer
Copy link
Contributor Author

@vcunat I like the approach the commit introduces, actually.

@matthiasbeyer
Copy link
Contributor Author

Closing due to no progress anymore.

@fgaz
Copy link
Member

fgaz commented Jan 9, 2021

That commit was reverted shortly after: e729559

What was the reason for that?

@matthiasbeyer
Copy link
Contributor Author

I guess you should ask the committer, @edolstra

@fgaz fgaz mentioned this issue Jan 11, 2021
@edolstra
Copy link
Member

It created an ugly asymmetry between packages with and without overrides. So to override a package you had to override both auto-packages.nix and all-packages.nix.

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

No branches or pull requests

5 participants