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
Support removing python from zfs/grub closure #84129
Conversation
If turned off, all binaries that need python are excluded With the argument disabled, this reduces closure size from 219.5M to 160.3M
@@ -16918,7 +16918,7 @@ in | |||
|
|||
zenpower = callPackage ../os-specific/linux/zenpower { }; | |||
|
|||
inherit (callPackage ../os-specific/linux/zfs { | |||
inherit (callPackages ../os-specific/linux/zfs { |
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.
unrelated to PR, but what's the difference between callPackage and callPackages
I could only find #36354 and what's in the source:
callPackages = lib.callPackagesWith splicedPackagesWithXorg;
but that still doesn't explain what's going on.
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.
callPackage <file>
is for when the file looks like
{ stdenv }: stdenv.mkDerivation { ... }
It makes the result of the call contain a .override
attribute you can use to change the arguments.
callPackages <file>
is for when the file looks like
{ stdenv }: {
foo = stdenv.mkDerivation { ... };
bar = stdenv.mkDerivation { ... };
}
It makes all the attributes of the result contain a .override
attribute you can use to change the arguments for any package individually.
If callPackage
is used on the latter, you'd get
{
foo = ...;
bar = ...;
override = ...;
}
as a result, without any .override
on the actual derivations, which is why you couldn't .override
on pkgs.zfs
before this change.
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.
ah, that makes sense. I feel like this should be documented somewhere more formally.
Thank you for the explanation.
Looks fine although I wonder what the usecase is because zfs is usually used on systems with plenty resources (RAM/storage space). |
I think it's still a good goal to have packages be minimally complete. Really impactful in a lot of cases where closure size has value. |
+1 to minification. Regarding small systems ZFS is now enabled even on Raspberry Pi which doesn't seem very useful. |
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.
LGTM
failures are broken on master
https://github.com/NixOS/nixpkgs/pull/84129
6 package marked as broken and skipped:
linuxPackages_hardkernel_4_14.zfs linuxPackages_hardkernel_4_14.zfsStable linuxPackages_hardkernel_4_14.zfsUnstable linuxPackages_hardkernel_latest.zfs linuxPackages_hardkernel_latest.zfsStable linuxPackages_hardkernel_latest.zfsUnstable
7 package failed to build:
linuxPackages_5_6.zfs linuxPackages_latest-libre.zfs linuxPackages_latest_hardened.zfs linuxPackages_latest_xen_dom0.zfs linuxPackages_latest_xen_dom0_hardened.zfs linuxPackages_testing_bcachefs.zfs linuxPackages_testing_hardened.zfs
10 package built:
linuxPackages-libre.zfs linuxPackages.zfs linuxPackages_4_14.zfs linuxPackages_4_19.zfs linuxPackages_4_4.zfs linuxPackages_4_9.zfs linuxPackages_5_5.zfs linuxPackages_hardened.zfs linuxPackages_xen_dom0.zfs linuxPackages_xen_dom0_hardened.zfs
Hm wait, why does it rebuild stuff anyways, I don't think this should be |
Reduces closure size with it disabled from 236.0M to 176.7M
67e7131
to
0a43c6e
Compare
Indeed, I had a mistake in there! I fixed it now, so there shouldn't be any rebuilds anymore. |
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.
LGTM
Nothing changed
https://github.com/NixOS/nixpkgs/pull/84129
$ nix-shell /home/jon/.cache/nixpkgs-review/pr-84129-1/shell.nix
Motivation for this change
ZFS (and consequently grub) depends on python, I don't want that because it adds ~50M. With this PR you can remove python from its closure with the overlay
This overlay reduces the closure of
grub2
from 249.9M to 190.7M, and the closure of ZFS from 236.0M to 176.7M.No defaults were changed.
Ping @Mic92 @sorki @FRidh @edolstra @wkennington
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)