Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0fc7da19b4d2
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: b293421a69a0
Choose a head ref
  • 4 commits
  • 3 files changed
  • 1 contributor

Commits on Apr 2, 2020

  1. nfs-utils: Add enablePython argument

    If turned off, all binaries that need python are excluded
    
    With the argument disabled, this reduces closure size from 219.5M to
    160.3M
    infinisil committed Apr 2, 2020

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    infinisil Silvan Mosberger
    Copy the full SHA
    848ed26 View commit details
  2. Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    infinisil Silvan Mosberger
    Copy the full SHA
    12c1fdd View commit details

Commits on Apr 8, 2020

  1. zfs: Add enablePython argument

    Reduces closure size with it disabled from 236.0M to 176.7M
    infinisil committed Apr 8, 2020

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    infinisil Silvan Mosberger
    Copy the full SHA
    0a43c6e View commit details
  2. Merge pull request #84129 from Infinisil/removing-python-from-grub

    Support removing python from zfs/grub closure
    infinisil authored Apr 8, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    b293421 View commit details
Showing with 17 additions and 7 deletions.
  1. +5 −2 pkgs/os-specific/linux/nfs-utils/default.nix
  2. +10 −3 pkgs/os-specific/linux/zfs/default.nix
  3. +2 −2 pkgs/top-level/all-packages.nix
7 changes: 5 additions & 2 deletions pkgs/os-specific/linux/nfs-utils/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{ stdenv, fetchurl, fetchpatch, lib, pkgconfig, utillinux, libcap, libtirpc, libevent
, sqlite, kerberos, kmod, libuuid, keyutils, lvm2, systemd, coreutils, tcp_wrappers
, python3, buildPackages, nixosTests
, enablePython ? true
}:

let
@@ -25,8 +26,7 @@ stdenv.mkDerivation rec {
buildInputs = [
libtirpc libcap libevent sqlite lvm2
libuuid keyutils kerberos tcp_wrappers
python3
];
] ++ lib.optional enablePython python3;

enableParallelBuilding = true;

@@ -96,6 +96,9 @@ stdenv.mkDerivation rec {
-e "s,/sbin/modprobe,${kmod}/bin/modprobe,g" \
-e "s,/usr/sbin,$out/bin,g" \
$out/etc/systemd/system/*
'' + lib.optionalString (!enablePython) ''
# Remove all scripts that require python (currently mountstats and nfsiostat)
grep -l /usr/bin/python $out/bin/* | xargs -I {} rm -v {}
'';

# One test fails on mips.
13 changes: 10 additions & 3 deletions pkgs/os-specific/linux/zfs/default.nix
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@

# Kernel dependencies
, kernel ? null
, enablePython ? true
}:

with stdenv.lib;
@@ -57,7 +58,12 @@ let
'' + optionalString buildUser ''
substituteInPlace ./lib/libzfs/libzfs_mount.c --replace "/bin/umount" "${utillinux}/bin/umount" \
--replace "/bin/mount" "${utillinux}/bin/mount"
substituteInPlace ./lib/libshare/nfs.c --replace "/usr/sbin/exportfs" "${nfs-utils}/bin/exportfs"
substituteInPlace ./lib/libshare/nfs.c --replace "/usr/sbin/exportfs" "${
# We don't *need* python support, but we set it like this to minimize closure size:
# If it's disabled by default, no need to enable it, even if we have python enabled
# And if it's enabled by default, only change that if we explicitly disable python to remove python from the closure
nfs-utils.override (old: { enablePython = old.enablePython or true && enablePython; })
}/bin/exportfs"
substituteInPlace ./config/user-systemd.m4 --replace "/usr/lib/modules-load.d" "$out/etc/modules-load.d"
substituteInPlace ./config/zfs-build.m4 --replace "\$sysconfdir/init.d" "$out/etc/init.d"
substituteInPlace ./etc/zfs/Makefile.am --replace "\$(sysconfdir)" "$out/etc"
@@ -92,7 +98,8 @@ let
nativeBuildInputs = [ autoreconfHook nukeReferences ]
++ optionals buildKernel (kernel.moduleBuildDependencies ++ [ perl ]);
buildInputs = optionals buildUser [ zlib libuuid attr ]
++ optionals (buildUser) [ openssl python3 ]
++ optional buildUser openssl
++ optional (buildUser && enablePython) python3
++ optional stdenv.hostPlatform.isMusl libtirpc;

# for zdb to get the rpath to libgcc_s, needed for pthread_cancel to work
@@ -102,7 +109,7 @@ let

configureFlags = [
"--with-config=${configFile}"
(withFeatureAs buildUser "python" python3.interpreter)
(withFeatureAs (buildUser && enablePython) "python" python3.interpreter)
] ++ optionals buildUser [
"--with-dracutdir=$(out)/lib/dracut"
"--with-udevdir=$(out)/lib/udev"
4 changes: 2 additions & 2 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
@@ -16864,7 +16864,7 @@ in

zenpower = callPackage ../os-specific/linux/zenpower { };

inherit (callPackage ../os-specific/linux/zfs {
inherit (callPackages ../os-specific/linux/zfs {
configFile = "kernel";
inherit kernel;
}) zfsStable zfsUnstable;
@@ -17503,7 +17503,7 @@ in

zenmonitor = callPackage ../os-specific/linux/zenmonitor { };

inherit (callPackage ../os-specific/linux/zfs {
inherit (callPackages ../os-specific/linux/zfs {
configFile = "user";
}) zfsStable zfsUnstable;