Repository navigation
Closed as not planned
Labels
0.kind: bugSomething is broken
Description
Nixpkgs version
- Unstable (26.05)
Describe the bug
If I add this snippet to my config, the ZFS kernel module fails to build:
boot.kernelPackages = pkgs.linuxPackagesFor (pkgs.linux.override {
extraMakeFlags = [
"KCFLAGS+=-march=icelake-client"
"KCFLAGS+=-mtune=icelake-client"
];
});A plain ext4 system takes a day, but it succeeds.
Steps to reproduce
For contrast, these configs build quickly. They're very basic, though.
Root on ext4
/etc/nixos/configuration.nix
{ config, lib, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
boot.loader.grub.device = "/dev/vda";
boot.kernelParams = [ "console=ttyS0,115200n8" ];
boot.loader.grub.enable = true;
system.stateVersion = "25.05"; # Did you read the comment?
}/etc/nixos/hardware-configuration.nix
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "virtio_scsi" "sr_mod" "virtio_blk" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/e8f47036-a035-430b-be6a-7f3a8a565644";
fsType = "ext4";
};
swapDevices = [ ];
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}Root on ZFS
/etc/nixos/configuration.nix
{ config, lib, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
boot.loader.grub.device = "/dev/vda";
boot.kernelParams = [ "console=ttyS0,115200n8" "zfs.zfs_arc_max=268435456" ];
networking.hostId = "fd70ea62";
boot.loader.grub.enable = true;
system.stateVersion = "25.05"; # Did you read the comment?
}/etc/nixos/hardware-configuration.nix
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/profiles/qemu-guest.nix")
];
boot.zfs.devNodes = "/dev";
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "virtio_scsi" "sr_mod" "virtio_blk" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "zroot";
fsType = "zfs";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/d1d68f57-f2b5-4bdc-a87a-6ab8fc8cee2b";
fsType = "ext2";
};
swapDevices = [ ];
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}Expected behaviour
zfs-kernel appends -march=icelake-client and -mtune=icelake-client to KCFLAGS, just like the kernel itself.
Screenshots
No response
Relevant log output
building the system configuration...
these 7 derivations will be built:
/nix/store/kb9igdg84gkililfbvshivdxlhbh2h8l-zfs-kernel-2.3.5-6.12.62.drv
/nix/store/vkakk74cf3cwg74pr7gmdq2crl0idhkg-linux-6.12.62-modules.drv
/nix/store/1d22mpxjhmhx9xk31w2nii3flf3qg5cd-linux-6.12.62-modules-shrunk.drv
/nix/store/2b3cgsbjf2c5hz6drcvsxssy44jy76l1-closure-info.drv
/nix/store/svycmn823bafg83zhaiwz0imjhby5h2n-initrd-linux-6.12.62.drv
/nix/store/rhg0diwgk15f9irz6bqjdkywr8lj1fr7-boot.json.drv
/nix/store/29vanxrwvgf9jvmbk18wcq793gsxa3y3-nixos-system-nixos-26.05pre913595.c6245e83d836.drv
building '/nix/store/kb9igdg84gkililfbvshivdxlhbh2h8l-zfs-kernel-2.3.5-6.12.62.drv'...
Running phase: unpackPhase
unpacking source archive /nix/store/9v5ai3gxzamycywxkp76azmcfrn6vd70-source
source root is source
Running phase: patchPhase
applying patch /nix/store/arr60xb0ivwxpkfb28s994b6wvqnc2bc-fix_llvm-21_-wuninitialized-const-pointer_warning.patch
patching file config/kernel-blkdev.m4
patching script interpreter paths in scripts
scripts/convert_wycheproof.pl: interpreter directive changed from "#!/usr/bin/env perl" to "/nix/store/h2jsb5i4yfblr2f3ac2c7zpmlmj7zjym-perl-5.40.0/bin/perl"
scripts/zimport.sh: interpreter directive changed from "#!/usr/bin/env bash" to "/nix/store/rlq03x4cwf8zn73hxaxnx0zn5q9kifls-bash-5.3p3/bin/bash"
scripts/kmodtool: interpreter directive changed from "#!/usr/bin/env bash" to "/nix/store/rlq03x4cwf8zn73hxaxnx0zn5q9kifls-bash-5.3p3/bin/bash"
scripts/spdxcheck.pl: interpreter directive changed from "#!/usr/bin/env perl" to "/nix/store/h2jsb5i4yfblr2f3ac2c7zpmlmj7zjym-perl-5.40.0/bin/perl"
scripts/zfs.sh: interpreter directive changed from "#!/bin/sh" to "/nix/store/rlq03x4cwf8zn73hxaxnx0zn5q9kifls-bash-5.3p3/bin/sh"
scripts/cstyle.pl: interpreter directive changed from "#!/usr/bin/env perl" to "/nix/store/h2jsb5i4yfblr2f3ac2c7zpmlmj7zjym-perl-5.40.0/bin/perl"
scripts/zloop.sh: interpreter directive changed from "#!/usr/bin/env bash" to "/nix/store/rlq03x4cwf8zn73hxaxnx0zn5q9kifls-bash-5.3p3/bin/bash"
scripts/dkms.mkconf: interpreter directive changed from "#!/bin/sh" to "/nix/store/rlq03x4cwf8zn73hxaxnx0zn5q9kifls-bash-5.3p3/bin/sh"
scripts/zfs-helpers.sh: interpreter directive changed from "#!/bin/sh" to "/nix/store/rlq03x4cwf8zn73hxaxnx0zn5q9kifls-bash-5.3p3/bin/sh"
scripts/zfs_prepare_disk: interpreter directive changed from "#!/bin/sh" to "/nix/store/rlq03x4cwf8zn73hxaxnx0zn5q9kifls-bash-5.3p3/bin/sh"
scripts/update_authors.pl: interpreter directive changed from "#!/usr/bin/env perl" to "/nix/store/h2jsb5i4yfblr2f3ac2c7zpmlmj7zjym-perl-5.40.0/bin/perl"
scripts/mancheck.sh: interpreter directive changed from "#!/bin/sh" to "/nix/store/rlq03x4cwf8zn73hxaxnx0zn5q9kifls-bash-5.3p3/bin/sh"
scripts/zol2zfs-patch.sed: interpreter directive changed from "#!/bin/sed -f" to "/nix/store/drc7kang929jaza6cy9zdx10s4gw1z5p-gnused-4.9/bin/sed -f"
scripts/dkms.postbuild: interpreter directive changed from "#!/bin/sh" to "/nix/store/rlq03x4cwf8zn73hxaxnx0zn5q9kifls-bash-5.3p3/bin/sh"
scripts/commitcheck.sh: interpreter directive changed from "#!/bin/sh" to "/nix/store/rlq03x4cwf8zn73hxaxnx0zn5q9kifls-bash-5.3p3/bin/sh"
scripts/zfs2zol-patch.sed: interpreter directive changed from "#!/bin/sed -f" to "/nix/store/drc7kang929jaza6cy9zdx10s4gw1z5p-gnused-4.9/bin/sed -f"
scripts/zfs-tests-color.sh: interpreter directive changed from "#!/bin/sh" to "/nix/store/rlq03x4cwf8zn73hxaxnx0zn5q9kifls-bash-5.3p3/bin/sh"
scripts/paxcheck.sh: interpreter directive changed from "#!/bin/sh" to "/nix/store/rlq03x4cwf8zn73hxaxnx0zn5q9kifls-bash-5.3p3/bin/sh"
scripts/man-dates.sh: interpreter directive changed from "#!/bin/sh" to "/nix/store/rlq03x4cwf8zn73hxaxnx0zn5q9kifls-bash-5.3p3/bin/sh"
scripts/zfs-tests.sh: interpreter directive changed from "#!/usr/bin/env bash" to "/nix/store/rlq03x4cwf8zn73hxaxnx0zn5q9kifls-bash-5.3p3/bin/bash"
scripts/make_gitrev.sh: interpreter directive changed from "#!/bin/sh" to "/nix/store/rlq03x4cwf8zn73hxaxnx0zn5q9kifls-bash-5.3p3/bin/sh"
Supported Kernel versions:
Linux-Maximum: 6.17
Linux-Minimum: 4.18
Checking kernelMinSupportedMajorMinor is correct...
Checking kernelMaxSupportedMajorMinor is correct...
Running phase: autoreconfPhase
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force -I config
autoreconf: configure.ac: tracing
autoreconf: configure.ac: AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION
autoreconf: running: libtoolize --copy --force
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'config'.
libtoolize: copying file 'config/ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'config'.
libtoolize: copying file 'config/libtool.m4'
libtoolize: copying file 'config/ltoptions.m4'
libtoolize: copying file 'config/ltsugar.m4'
libtoolize: copying file 'config/ltversion.m4'
libtoolize: copying file 'config/lt~obsolete.m4'
autoreconf: running: /nix/store/jww0dwicdca8yq5f1fr9wavb60i3gshd-autoconf-2.69/bin/autoconf --force
autoreconf: running: /nix/store/jww0dwicdca8yq5f1fr9wavb60i3gshd-autoconf-2.69/bin/autoheader --force
autoreconf: running: automake --add-missing --copy --force-missing
configure.ac:50: installing 'config/compile'
configure.ac:41: installing 'config/config.guess'
configure.ac:41: installing 'config/config.sub'
configure.ac:44: installing 'config/install-sh'
configure.ac:44: installing 'config/missing'
Makefile.am: installing 'config/depcomp'
autoreconf: Leaving directory `.'
Running phase: updateAutotoolsGnuConfigScriptsPhase
Updating Autotools / GNU config script to a newer upstream version: ./config/config.sub
Updating Autotools / GNU config script to a newer upstream version: ./config/config.guess
Running phase: configurePhase
fixing libtool script ./config/ltmain.sh
./configure
patching script interpreter paths in ./configure
./configure: interpreter directive changed from "#! /bin/sh" to "/nix/store/rlq03x4cwf8zn73hxaxnx0zn5q9kifls-bash-5.3p3/bin/sh"
configure flags: --disable-static --disable-dependency-tracking --prefix=/nix/store/rgzq12knvc834h1y1053a81djdpcpz5f-zfs-kernel-2.3.5-6.12.62 --with-config=kernel --with-tirpc=1 --without-python --with-linux=/nix/store/9v5mkx7zcnjyimhrhprm27k68yxkcsla-linux-6.12.62-dev/lib/modules/6.12.62/source --with-linux-obj=/nix/store/9v5mkx7zcnjyimhrhprm27k68yxkcsla-linux-6.12.62-dev/lib/modules/6.12.62/build KERNEL_CC=/nix/store/kzq78n13l8w24jn8bx4djj79k5j717f1-gcc-14.3.0/bin/gcc KERNEL_LD=/nix/store/dc9vaz50jg7mibk9xvqw5dqv89cxzla3-binutils-2.44/bin/ld KERNEL_AR=/nix/store/vr15iyyykg9zai6fpgvhcgyw7gckl78w-gcc-wrapper-14.3.0/bin/ar KERNEL_NM=/nix/store/vr15iyyykg9zai6fpgvhcgyw7gckl78w-gcc-wrapper-14.3.0/bin/nm KERNEL_STRIP=/nix/store/dc9vaz50jg7mibk9xvqw5dqv89cxzla3-binutils-2.44/bin/strip KERNEL_OBJCOPY=/nix/store/vr15iyyykg9zai6fpgvhcgyw7gckl78w-gcc-wrapper-14.3.0/bin/objcopy KERNEL_OBJDUMP=/nix/store/vr15iyyykg9zai6fpgvhcgyw7gckl78w-gcc-wrapper-14.3.0/bin/objdump KERNEL_READELF=/nix/store/vr15iyyykg9zai6fpgvhcgyw7gckl78w-gcc-wrapper-14.3.0/bin/readelf KERNEL_HOSTCC=/nix/store/vr15iyyykg9zai6fpgvhcgyw7gckl78w-gcc-wrapper-14.3.0/bin/cc KERNEL_HOSTCXX=/nix/store/vr15iyyykg9zai6fpgvhcgyw7gckl78w-gcc-wrapper-14.3.0/bin/c++ KERNEL_HOSTAR=/nix/store/xwydcyvlsa3cvssk0y5llgdhlhjvmqdm-binutils-wrapper-2.44/bin/ar KERNEL_HOSTLD=/nix/store/xwydcyvlsa3cvssk0y5llgdhlhjvmqdm-binutils-wrapper-2.44/bin/ld KERNEL_ARCH=x86_64 KERNEL_CROSS_COMPILE= KERNEL_KCFLAGS+=-march=icelake-client KERNEL_KCFLAGS+=-mtune=icelake-client KERNEL_KBUILD_OUTPUT=/nix/store/9v5mkx7zcnjyimhrhprm27k68yxkcsla-linux-6.12.62-dev/lib/modules/6.12.62/build
configure: error: invalid variable name: `KERNEL_KCFLAGS+'
error: Cannot build '/nix/store/kb9igdg84gkililfbvshivdxlhbh2h8l-zfs-kernel-2.3.5-6.12.62.drv'.
Reason: builder failed with exit code 1.
Output paths:
/nix/store/rgzq12knvc834h1y1053a81djdpcpz5f-zfs-kernel-2.3.5-6.12.62
error: Cannot build '/nix/store/vkakk74cf3cwg74pr7gmdq2crl0idhkg-linux-6.12.62-modules.drv'.
Reason: 1 dependency failed.
Output paths:
/nix/store/1k0ap4a43lpm6kdm3hy22bp9sv4hf597-linux-6.12.62-modules
error: Cannot build '/nix/store/29vanxrwvgf9jvmbk18wcq793gsxa3y3-nixos-system-nixos-26.05pre913595.c6245e83d836.drv'.
Reason: 1 dependency failed.
Output paths:
/nix/store/kw3kywibqj76gk25d3scq88cg6204lyr-nixos-system-nixos-26.05pre913595.c6245e83d836
Command 'nix-build '<nixpkgs/nixos>' --attr config.system.build.toplevel --no-out-link --max-jobs 1' returned non-zero exit status 100.Additional context
No response
System metadata
- system:
"x86_64-linux" - host os:
Linux 6.12.62, NixOS, 26.05 (Yarara), 26.05pre913595.c6245e83d836 - multi-user?:
yes - sandbox:
yes - version:
nix-env (Nix) 2.31.2+1 - nixpkgs:
/nix/store/xav32kq6jdxzrk7n8wyhvscny0n8gh05-nixos/nixos
Notify maintainers
Note for maintainers: Please tag this issue in your pull request description. (i.e. Resolves #ISSUE.)
I assert that this issue is relevant for Nixpkgs
- I assert that this is a bug and not a support request.
- I assert that this is not a duplicate of an existing issue.
- I assert that I have read the NixOS Code of Conduct and agree to abide by it.
Is this issue important to you?
Add a 👍 reaction to issues you find important.
Reacted by Alexander Aleksandrovič Klimov and n0099
Metadata
Metadata
Assignees
Labels
0.kind: bugSomething is broken
Activity
adamcstephens commentedon Dec 24, 2025
This is a problem you’re causing to yourself. If this matters to you then I’d encourage you to open a pull request to fix whatever is necessary, assuming the zfs package even supports these flags. In the meantime I’m closing this as not planned as it is a nonstandard configuration.
n0099 commentedon Jul 21, 2026
Same here with
n0099 commentedon Jul 21, 2026
Some traceback:
nixpkgs/pkgs/os-specific/linux/zfs/generic.nix
Line 221 in 6fca707
nixpkgs/pkgs/top-level/linux-kernels.nix
Lines 275 to 277 in 6fca707
nixpkgs/pkgs/os-specific/linux/kernel/build.nix
Lines 121 to 128 in 6fca707
nixpkgs/pkgs/os-specific/linux/kernel/common-flags.nix
Line 39 in 6fca707
Searching
kernelModuleMakeFlags configureseems only zfs is passing them toconfigurewhich is introduced in #435553This issue should reopen.
adamcstephens commentedon Jul 21, 2026
Feel free to open a PR with a fix, but this is still considered not planned and thus I won't reopen this issue.
n0099 commentedon Jul 21, 2026
#408433 should fix this by only allowing certain flags to be passed.
n0099 commentedon Jul 21, 2026
hotfix:
* fix passing shell array appending syntax for `KC{,PP}FLAGS+=` that …
n0099 commentedon Sep 1, 2026
This one use
kernelPackagesExtensionslikepythonPackagesExtensionssoconfigureFlagsof bothconfig.boot.zfs.modulePackageandconfig.boot.kernelPackages.${config.boot.zfs.package.kernelModuleAttribute}are changed:* now also change `configureFlags` of `config.boot.kernelPackages.${c…