-
-
Notifications
You must be signed in to change notification settings - Fork 160
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 0082] lib.experimental #82
Conversation
I suggest participating in #83 which is about creating a common interface for sub package sets, of which |
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 appreciate your intent to streamline Nixpkgs development in relation to lib
, but I am concerned about the cost of the added process and the invisible cost of missed contributions and collaboration. Perhaps you could provide references for the conflicts or accidents that you're trying to resolve? I am not aware of any, but if they exist in sufficient numbers, that may justify it.
* We could let package maintainers each reinvent their own lacking and | ||
non-interoperable variants of the same code in each of the sections | ||
each of them maintain. | ||
* We could adopt the idea but rename `experimental` to some other name. |
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.
Linux' staging directory comes to mind, although that has stricter rules around it.
* code that is not yet used by any package in nixpkgs nor by any extension to nixpkgs. | ||
* code that while cool has no purpose in nixpkgs as such and can well live outside it. |
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 may include functions like cleanSourceWith
which have almost no usage in Nixpkgs itself.
While some problems may be solvable outside Nixpkgs, having a blessed implementation in Nixpkgs can help avoid fragmentation.
[Glow](http://gitlab.com/mukn/glow) for local overrides. | ||
|
||
Under this RFC, the code for POP would go in `lib/experimental/POP.nix` | ||
and be available as `pkgs.lib.POP`. |
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 seems to contradict the Detailed design section, not being under lib.experimental
.
Experimental library code should be placed under the `lib/experimental` directory, | ||
where it will be made available in the `pkgs.lib.experimental` attrset, | ||
that will *not* re-export "direct" versions of the code directly in a parent attrset. |
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 placement will not allow individual experimental functions to be added to existing lib files, even if they should reuse let bindings from those files. File-wide let
definitions aren't used as much as they probably should though.
|
||
The process for taking things out of experimental is when there is a consensus to do so: | ||
when enough maintainers use this code rather than alternatives or workarounds, | ||
when its API is stable and well documented, with enough years of good use, |
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.
Ideally, all functions are documented in the Nixpkgs manual. Not all of them are, which is a separate issue, but well documented seems to imply that it's in the manual.
Otherwise, I don't see how they can get years of good use. Years does seem a bit inflexible. I'd hope we'll be able to promote functions sooner than 2 years.
Some libraries we *may not* use | ||
without an explicit endorsement by enough maintainers of the relevant packages. |
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.
Should I read this as "forbidden"?
Nixpkgs doesn't only define packages. Most of the interesting use cases for lib
functions are in nixos/
(calling into lib.modules
, lib.types
and various functions to support the configuration logic). Some of the functions primarily support users' own projects, or at least that's how I think of lib.cleanSourceWith
.
Usually when you choose to rely on someone's open source function, you accept that you may have to help improve it when the need arises. This is a mutually beneficial situation. You can make use of whatever beneficial qualities that code already has and when you need an improvement, the others will benefit as well.
When you decrease the appeal of certain functions, they will receive less use, and therefore less attention.
In my view, use of Nixpkgs is already quite pragmatic, in the sense that contributions arise from users' specific needs. So my questions is, what is the cost of keeping users away?
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 mean that, assuming my pop library gets in, and someone wants to use it while sending a patch to some recipe that uses a different extension mechanism, I expect the recipe's owner to reject it and request the patch author to use the previously used extension mechanism instead. Alternatively, if daring, he'd ask the patch author to rewrite everything using pop.
Making these social constraints explicit avoid accidents and conflict that would happen | ||
if they were left implicit. |
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 the cost of these accidents and conflict. Could you provide real-world examples?
Also note that small accidents and conflicts (human or otherwise) are part of how some software evolves.
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.
Not sure about real-world examples in nixpkgs... maybe this is all overkill, but I was told not to make my pop.nix library part of the regular lib/
for now, so I wanted a way to get it in without it being "regular".
This RFC is now open for shepherd nominations! |
@fare do you plan to continue with this RFC? If not, we would suggest closing it with the possibility of someone (else?) picking it up again later. |
Yes, I'd like to see it through. Alternative much simpler proposal: things in lib just get marked |
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 Motivation
lacks some rules as to what should not go in lib.experimental
, and the Detailed design
states some rules on when code from lib.experimental
can be considered "stable", however, I am missing when we consider code to be a sufficiently good additional that it can go in lib.experimental
. The Motivation
states when its not badly written, unused or not fitting. But what if similar kind of code exists? Clearly a motivation needs to be given in the PR (as in every PR) and I think there still also needs to be ownership over the whole of lib.experimental
, not just owners of the specific pieces.
To move this to the next phase we would need shepherds. Anyone open to? |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/rfc-82-lib-experimental-is-looking-for-shepherds/12257/2 |
If there are no shepherds for this RFC within two weeks, the rfc steering committee team will close this RFC. |
@fare or anyone else: if you wish to continue work on this RFC, please feel free to nominate shepherds and request a reopen :) |
I nominate myself as shepherd. Any other takers? Perhaps @sternenseemann? |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/friday-hackday-project-nix-filter/12648/6 |
and be available as `pkgs.lib.POP`. | ||
Package maintainers may opt into using it like Gerbil does, | ||
but contributors may not use it without the consent | ||
of the maintainers of the code they contribute to. |
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.
Something we should look into as well is how to enforce this. There's probably a nice way to do so using scopedImport
.
Sure. |
Given the recent row about flakes in @zimbatm are you be interested / do you have the time? |
The whole point of flakes is that experimental, controversial or hacky stuff doesn't need to go into Nixpkgs but can live in its own flake. A function like |
Are flakes now considered production quality? If I have packages in main NixOS and they use an experimental library, should I remove all those packages from NixOS and create a flake for them? Create that library in an absurd place close to some of my packages rather than in lib/experimental? |
It's not feasible for
Is that really the whole point? If so, that only stresses the fact that Nixpkgs will remain at the center of the ecosystem and that we need to care for it. Caring includes having a means to deal with non-trivial changes! Flakes will do more than just that, I know, but that doesn't diminish Nixpkgs' unique position as the ecosystem monorepo or the advantages that this architecture brings. |
no, they're still guarded behind experimental-features and have no interface stability guarantees. |
I propose that we create a directory lib/experimental for experimental code,
also available as lib.experimental and pkgs.lib.experimental. Such code is
available for limited use within select parts of nixpkgs, with the explicit
opt-in approval of their respective maintainers, but not for widespread use
in other parts of nixpkgs.