[RFC 0197] package sets by-name#197
Conversation
Sigmanificient
left a comment
There was a problem hiding this comment.
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.
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.
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.
(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.
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.
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.
(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.
- Auto generated package sets like
haskellPackages.
There was a problem hiding this comment.
i want handle both 2 and 3 with this RFC
actually i want to handle all package sets in this RFC
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.
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.
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 ↩
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.
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.
There was a problem hiding this comment.
i included a definition of package sets
does it suffice?
|
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. |
|
I think #192 has chances and also is needed (on its own or incorporated) for this one to be good? |
|
Why do we need versioned python, ghc and ocaml packages but not different package sets for other languages like C? Why are there no edit: The out path depends on the version of the interpreter:
|
|
| @@ -0,0 +1,254 @@ | |||
| --- | |||
There was a problem hiding this comment.
If we don't incorporate a system for nested package sets/package sets nested in attribute sets, how do we deal with them?
- these could probably be moved to the top level:
emacsPackages.*Packagesocaml-ng.ocamlPackages*haskell.packages.{,native-bignum.}*chickenPackages.chickenEggs
vscode-extensionscould probably be flattenedocamlPackages*.janeStreetcould maybe be merged intoocamlPackages*kdePackages.{sources,gear,framework,plasma}?vimPlugins.nvim-treesitter-{,legacy-}parsers?linuxKernels.**?luaPackages.luaLib?androidenv.**?nginxModules.*?
- decide on fooPackages vs foo.pkgs - incorporate all kinds of package sets - be very detailed, maybe too detailed
|
Somewhat related — I've been working on Currently packages like openssl, python, perl, etc. each reinvent their own multi-version handling with ad-hoc patterns.
|
| Package sets should be top-level attribute sets. This means: | ||
| - `ocaml-ng.*` will have to move to the top-level | ||
| - `vscode-extensions` will be flattened | ||
| - TODO: which package sets will have to move? |
There was a problem hiding this comment.
Alternative:
have versioned package sets be in a package-set-set
e.g.
ocamlPackageSets.ocaml_5_4lixPackageSets.lix_2_93(this is how it currently is)pythonPackageSets.python_3_13
This could also be used as a nice way of handling versioned packages
e.g.
ocamlVersions.ocaml_5_4,ocamlVersions.ocaml_4_14_unsafe_stringnixVersions.nix_2_32(this is how it currently is)pythonVersions.python_3_13,pythonVersions.pypy_3_10ffmpegVersions.ffmpeg_7,ffmpegVersions.ffmpeg_7_headless
yay (👍) or nay (👎)?
There was a problem hiding this comment.
What is the problem that could happen with doing both?
There was a problem hiding this comment.
The problem is that we not only have versions, but variants like cmakeMinimal, I'll try to come up a solution to passthru problem in my pr. Also ocamlPackageSets.ocaml_5_4 is much longer than ocaml.v5_4
There was a problem hiding this comment.
I agree on the shorter version, however the main question is how can we make sure users don't get confused, especially beginners? My only thoughts are to just produce a error that tells you what is available if it's evals and it's incorrect. Like ocaml.test which doesn't exist.
A new location and a unified interface for package sets in nixpkgs.
rendered