-
-
Notifications
You must be signed in to change notification settings - Fork 159
[RFC 0197] package sets by-name #197
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
base: master
Are you sure you want to change the base?
Conversation
Sigmanificient
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First time interacting with an RFC, i hope i am not making comment that are too dumb 😅
|
thanks for adding trees ❤️ |
|
i think a drawback from idea 3 is that we end up with attrpath in directory names |
Co-authored-by: Yohann Boniface <edhyjox@gmail.com>
SigmaSquadron
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was discussing this privately with @Sigmanificient earlier today, and he helped me organise my thoughts on this.
rfcs/0197-package-set-definitions.md
Outdated
|
|
||
| - get rid of the package categories as directories. | ||
| - make packages in package sets take advantage of the by-name greatness | ||
| - auto updates with r-ryantm + merge bot maintainer merging |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think our implementation plan should be separated into four stages:
- Create interfaces for package sets that uses the same functions as
by-nametocallPackagepackages from sharded directories, with additional extensions for package set versioning. - Update
nixpkgs-vetto expand the existing linting checks to the new package sets. - Migrate all package sets into the new interface when it makes sense to do so, or move the children of smaller sets into
by-nameas top-level packages. - Add new rules to
nixpkgs-merge-botto allow unprivileged merging to package sets.
We can't move into the next stage before the previous one is complete, so let's not think about the later stages just now.
|
|
||
| ## Unresolved Questions | ||
|
|
||
| - How do we handle functions like `fishPlugins.buildFishPlugin`? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Answering because this applies to idea 1)
I never thought it made sense for functions and derivation builders to be inside package sets. I think our Go infrastructure has the right idea: move them to the top-level, and version them in the attribute name. fishPlugins.buildFishPlugin can just be moved to the top-level, while python313Packages.buildPythonApplication becomes buildPython313Application on the top-level. We can deal with this at stage 3, where we migrate everything over.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This proposal is awkward with Python where you have CPython and PyPy and then language version-dialects within them, and even worse for Common Lisp where you have same base language but multiple compatible implementations with their completely own versioning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i also think keeping functions in package sets is fine
|
|
||
| - How do we handle functions like `fishPlugins.buildFishPlugin`? | ||
| - How do we handle aliases? | ||
| - How do we handle versioned package sets? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Answering because this applies to idea 1)
I generally think it's a good idea to think of Nixpkgs as having three types of package infrastructure systems:
- Top-level packages, which nowadays go to
by-name; - Simple package sets, like
fishPlugins, which are easier to implement in this new interface as we can simply call them as we doby-namepackages and shove the resulting set intofishPluginsfrom the top-level. - Versioned package sets, like
python3Packages, which are by far the most complex. I think we should absolutely get the input of the primary maintainers of these sets here before we move forward. There are many concerns regarding updating versioned sets, and default aliases, as well as edge cases likepython3.pkgsandpython3Packages. In the end, having something that is no worse to maintain as it was before would be ideal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Auto generated package sets like
haskellPackages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i want handle both 2 and 3 with this RFC
| - How do we handle functions like `fishPlugins.buildFishPlugin`? | ||
| - How do we handle aliases? | ||
| - How do we handle versioned package sets? | ||
| - How do we move large package sets? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Answering because this applies to idea 1)
Some of them are easy enough. If we resolve the aforementioned issues with the python edge cases, it should be a simple matter of moving and renaming files. OCaml should also be pretty simple.
The generated sets, like Haskell, Node, Lisp and R, will be impossible, though. Those packages don't actually exist as separate files in Nixpkgs, and are instead imported from some other upstream.
This is something that again, we'll have to get the input of package set maintainers on. Moving everything over will end up being a case-by-case basis.
rfcs/0197-package-set-definitions.md
Outdated
| - the `packageset.nix` can include aliases, functions like `fishPlugins.buildFishPlugin` and | ||
| overrides. | ||
| - The `packageset.nix` files are autocalled by some `pkgs/top-level/by-name-overlay.nix` like file. | ||
| - Versioned package sets like `python316Packages` are done in `all-packages.nix` by calling the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That seems good to me. As mentioned in #197 (comment), this is conditional on the approval of the current versioned package set maintainers.
infinisil
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition to the comments, also a meta-comment: While it's really great to create RFC documents like these, we don't need the lengthy RFC process anymore to get them approved, because if Nixpkgs committers can't agree on it, we can escalate to the SC-appointed Nixpkgs core team, which has the authority to make a call.
Probably still beneficial for Nixpkgs to keep discussions for such changes outside the Nixpkgs repo itself due to the noise there, but otherwise I'd suggest to PR this to an adr/1 directory in Nixpkgs.
Footnotes
-
From https://adr.github.io/, which is very similar ↩
Co-authored-by: Yohann Boniface <edhyjox@gmail.com>
rfcs/0197-package-set-definitions.md
Outdated
| # Summary | ||
| [summary]: #summary | ||
|
|
||
| Different ideas on how to handle package sets in nixpkgs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is a package set? There are some that do not have a direct top-level name. I think in general some places of the text is written for a package set that comes with its set of expressions, while there are cases where meaningfully sets share a large fraction of the expressions.
| - scaleability | ||
| - isolation | ||
| - vetting | ||
| - *your goal here* |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updates across package sets are very different. I don't think this should be a goal of this RFC, but instead something that can be developed separately as an updateScript that nixpkgs-update can pick up.
| │ │ ├── zx | ||
| │ │ │ ├── zxcvbn | ||
| │ │ │ │ └── package.nix | ||
| │ │ │ ├── zxcvbn-rs-py | ||
| │ │ │ │ └── package.nix | ||
| │ │ │ └── zxing-cpp | ||
| │ │ │ └── package.nix | ||
| │ │ ├── aliases.nix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, a few files mixed within the shard list?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The alternative would be putting them in pkgs/top-level. It seems more sensible to have them at the root of the package set instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another alternative is to have one more level inside the package set before the shards (by-name subdirectory, I guess).
Which would also make more manageable packagesets that benefit from having a few more support files inside the package set but not as a packageset package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That might require us to filter out that directory from the autocaller function, but it's a good idea as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think they meant
pkgs/sets
├── fishPlugins
│ ├── by-name
│ │ ├── as
│ │ │ ├── async-prompt
│ │ │ ... └── package.nix
│ │ ├── au
│ │ ...
│ │ └── z_
│ │ └── z
│ │ └── package.nix
│ └── top-level
│ ├── aliases.nix
│ ├── functions.nix
│ └── overrides.nix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, it is a matter of taste if top-level is needed or the files would go into the root of the package set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, it is a matter of taste if top-level is needed or the files would go into the root of the package set.
Exactly.
So I was thinking like this could happen:
pkgs/
├── fi/fishPlugins
│ ├── by-name
│ │ ├── as
│ │ │ ├── async-prompt
│ │ │ ... └── package.nix
│ │ ├── au
│ │ ...
│ │ └── z_
│ │ └── z
│ │ └── package.nix
└── aliases.nix
└── functions.nix
└── overrides.nix
By name is used in the case so that way you don't get confused easily with two by-names.
Another idea to improve this, is making the by-name in package sets to something like packages could work? So like:
pkgs/
├── fi/fishPlugins
│ ├── packages
│ │ ├── as
│ │ │ ├── async-prompt
│ │ │ ... └── package.nix
│ │ ├── au
│ │ ...
│ │ └── z_
│ │ └── z
│ │ └── package.nix
└── aliases.nix
└── functions.nix
└── overrides.nix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you look at the POC implementation, you can also see that buildFishPlugin is in sets-by-name/fishPlugins/buildFishPlugin.nix.
For some package sets there might be larger amounts of functions so the package set folder could become crowded.
We could also just inline functions into functions.nix and require that no additional files are in the package set tree root.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand that. This mixes shards and non-shards under pkgs itself? And puts the package sets as normal packages? I am probably misreading the diagram.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand that. This mixes shards and non-shards under pkgs itself? And puts the package sets as normal packages? I am probably misreading the diagram.
Well the ideally in the packages it's another set then there would be default.nix which would hook it up.
I am probably misreading the diagram.
Probably 👀
|
By the way, lispPackages treated as sbclPackages but also needed for |
|
Guys I think we need to decide on and merge #83 first. |
|
#83 is unfortunately abandoned. I don't think we should depend on it, but rather replace it. |
This is currently a collection of ideas on how to handle package sets in the future.
Looking for feedback and ideas.
rendered