[WIP] Multiple by-name directory support#180
[WIP] Multiple by-name directory support#180mdaniels5757 wants to merge 21 commits intoNixOS:mainfrom
Conversation
fyi we'll soon have tcl8Packages and tcl9Packages as well NixOS/nixpkgs#433414 |
7cabe9d to
8b483c2
Compare
e17d122 to
fec3654
Compare
6c4a22e to
e126486
Compare
92623ed to
43a6a7e
Compare
43a6a7e to
0d147d5
Compare
infinisil
left a comment
There was a problem hiding this comment.
Finally got around to taking a closer look at this, and overall this is already looking very solid, thanks a lot!
For now I'll just comment for the biggest issue I've noticed, I can do another review when that's addressed.
| { | ||
| id = "py"; | ||
| path = "pkgs/development/python-modules/by-name"; | ||
| attr_path_regex = "^(python3\\d*Packages|python3\\d*.pkgs)\\..*$"; |
There was a problem hiding this comment.
The biggest issue with how it's done currently closely relates to this here. As far as I understand, the new eval.nix/eval.rs does a recursive Nixpkgs evaluation, lists all resulting attribute paths and then checks which ones match the regex defined here.
This complicates the eval.nix because it needs to handle all the random failing evaluations in Nixpkgs, making it very brittle and slow.
Instead, please change this configuration options to be like suggested in #31:
attr_path = [ "python3Packages" ];
Notably we don't need to check all the different version sets like python311Packages, etc., because the only reason we need to evaluate anything at all is for the eval-time checks and ratchet checks. Since all the python3*Packages sets only differ in very minor ways, checking one of them is good enough. This will be much more efficient and simplify the code a lot.
On the implementation side, the code then only needs to evaluate the attributes directly under that attribute path, just like the eval.nix in the main branch (I'm afraid a lot of your eval.nix changes won't be needed 😅) . I also recommend changing what eval.nix outputs to be more suited to the new functionality, e.g. something like
{
py = [ [ name value ] ... ];
main = [ [ name value ] ... ];
tcl = [ [ name value ] ... ];
}
This should make the diff to what it was fairly small.
This works in tests only.
Known issues:
One thing that may or may not be an issue, is that I mostly did not follow the instructions @infinisil so kindly left on #31. Not sure which of those should or should not be implemented.
Feedback is welcome! I would ask you please refrain for now from e.g. pointing out commented-out code and the like. (I'm well aware this needs cleanup.) But more function- or design- focused feedback, or feedback related to the points above, is definitely welcome (and probably needed :) )!