splice.nix: make pkgs splicedPackages#349316
Conversation
|
This sounds like an obvious win to me, is there anything left to test or verify? |
|
Would #263082 have caught this? Maybe it would be worth reviving that. |
|
I got the feeling of this may be doable a couple of weeks ago. But now there are not many people who really dare to change the cross logic, come on 🫣 |
3e6ad22 to
0793f85
Compare
4bb1955 to
47c47cc
Compare
pkgs/top-level/splice.nix
Outdated
There was a problem hiding this comment.
@Ericson2314
I wonder why you didn't do this instead of adding __splicedPackages? f27f491
47c47cc to
65ca39b
Compare
01b7508 to
8614381
Compare
|
Because |
pkgs/top-level/all-packages.nix
Outdated
There was a problem hiding this comment.
Oh yeah #58327
If the pkgs used in all-packages.nix was __splicedPackages it would break with infinite recursion
nix-repl> pkgsStatic.pkgs1.bash ? __spliced
false
nix-repl> pkgsStatic.pkgs1.pkgs.bash ? __spliced
true
The pkgs in patchutils = pkgs.patchutils_0_3_3; in all-packages.nix is coming from this pkgs: https://github.com/NixOS/nixpkgs/blob/b6e486730fc875ec79a3dea0f1f46eaf9f6ffa9d/pkgs/top-level/all-packages.nix#L9
instead of the pkgs in with pkgs;
There was a problem hiding this comment.
I've posted this patch a few times before, but it does still seem (when updated slightly (gccCrossStageStatic has a new attr name gccWithoutTargetLibc since that patch was written) and applied on top of this PR) to fix the infrec from inheriting from __splicedPackages: lilyinstarlight@9639e73
I didn't do rigorous testing, but it does result in the same .drvs for already-cross-safe attrs I tested
8614381 to
58d7711
Compare
259c3f0 to
96fb948
Compare
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
This will make `pkgs` used in `callPackage`, and `pkgsCross.X.pkgs` have packages with `__spliced`. https://www.github.com/NixOS/nixpkgs/blob/3029741718f4c765fbc5ebf76bea3d6c8ff15fe5/pkgs/development/interpreters/python/passthrufun.nix#L37 https://www.github.com/NixOS/nixpkgs/blob/d2bd9a39dec88eddd5c192abee69939e67f43d12/pkgs/top-level/python-packages.nix#L10720 ``` nix-repl> pkgsCross.aarch64-multiplatform.python3Packages.protobuf4.protobuf.__spliced error: … while evaluating the attribute 'aarch64-multiplatform.python3Packages.protobuf4.protobuf.__spliced' at /home/artturin/nixgits/my-nixpkgs/.worktree/1/pkgs/development/python-modules/protobuf/4.nix:119:13: 118| passthru = { 119| inherit protobuf; | ^ 120| }; error: attribute '__spliced' missing at «string»:1:1: 1| pkgsCross.aarch64-multiplatform.python3Packages.protobuf4.protobuf.__spliced | ^ ``` to ``` nix-repl> pkgsCross.aarch64-multiplatform.python3Packages.protobuf4.protobuf.__spliced { buildBuild = «derivation /nix/store/s7da5mfvx4h1n86j78knaj9cprglxqz6-protobuf-25.4.drv»; buildHost = «derivation /nix/store/s7da5mfvx4h1n86j78knaj9cprglxqz6-protobuf-25.4.drv»; buildTarget = «repeated»; hostHost = «derivation /nix/store/mszvybzs4zxh43awyrjnybsfcb265n9r-protobuf-aarch64-unknown-linux-gnu-25.4.drv»; hostTarget = «repeated»; } ```
Now that `pkgs` is `__splicedPackages` on cross we can remove these variables I set. Assignments like `patchutils = pkgs.patchutils_0_3_3;` in `all-packages.nix` cannot be removed because the `pkgs` in `patchutils = pkgs.patchutils_0_3_3;` in `all-packages.nix` is coming from this `pkgs:` https://www.github.com/NixOS/nixpkgs/blob/b6e486730fc875ec79a3dea0f1f46eaf9f6ffa9d/pkgs/top-level/all-packages.nix#L9 instead of the `pkgs` in `with pkgs;`
96fb948 to
a27e48e
Compare
|
This seems like a massive improvement, at no apparent cost. Would it be possible to do the same to the overlay fixpoint, Currently in this PR: |
|
This has the label 2.status: wait for branch‐off -- and the branch cutoff has happened. Let's get this merged! |
|
Is there anything left to test or think more closely about? Otherwise I'd be in favour of merging and seeing whether anything breaks. |
|
I want to get #341067 evalling first and then apply #341067 and |
|
I was thinking of a different PR, there's no perf diff here :P I have 3 PRs touching splice.nix so got confused. |
philiptaron
left a comment
There was a problem hiding this comment.
The changes look great -- and if they eval, let's merge.
|
|
|
Take 2 #362499 |
|
I'm working on this again in #456138. |
This will make
pkgsused incallPackage, andpkgsCross.X.pkgshave packages with__spliced.https://www.github.com/NixOS/nixpkgs/blob/3029741718f4c765fbc5ebf76bea3d6c8ff15fe5/pkgs/development/interpreters/python/passthrufun.nix#L37
https://www.github.com/NixOS/nixpkgs/blob/d2bd9a39dec88eddd5c192abee69939e67f43d12/pkgs/top-level/python-packages.nix#L10720
to
Will allow getting rid of many of these https://github.com/search?q=lang%3Anix+NOT+is%3Afork+%2Fpkgs.%2B__splicedPackages%2F&type=code
#251005 is required to get rid of all of them
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.