Linux 6.12 depends on rustc at runtime

Why does linux 6.12 on my system depend on rustc at runtime? Shouldn’t it just be at buildtime if anything? I don’t have any overrides on the kernel package, I just use (effectively)

    boot = {
      extraModulePackages = [ config.boot.kernelPackages.v4l2loopback ];
      kernelPackages = pkgs.linuxKernel.packageAliases.linux_latest;
    };

But I’m not able to reproduce with a minimum working example:

{
  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
  };

  outputs =
    { nixpkgs, ... }:
    {
      nixosConfigurations.test = nixpkgs.lib.nixosSystem {
        modules = [
          (
            {
              config,
              modulesPath,
              pkgs,
              ...
            }:
            {
              imports = [ "${modulesPath}/profiles/minimal.nix" ];

              boot.loader.grub.enable = false;
              fileSystems."/".device = "nodev";
              nixpkgs.hostPlatform = "x86_64-linux";
              system.stateVersion = "24.05";

              boot = {
                extraModulePackages = [ config.boot.kernelPackages.v4l2loopback ];
                kernelPackages = pkgs.linuxKernel.packageAliases.linux_latest;
              };
            }
          )
        ];
      };
    };
}

How would I go about debugging this in my actual config? (It’s not public.)

you could find the reason with nix why-depends

Not really, that just tells you what package depends on it. I know it’s the kernel in this case, already. (I used nix-tree instead, which provides the same information.)

1 Like

I haven’t tried this, but you could run strings on the files of the offending package and see which file contains the store path to rustc.

Oh, I missed earlier that it was the -dev output of the kernel, not just the kernel itself, pulled in via linuxPackages_latest.opensnitch-ebpf. Actually that module was always pulling in linux-dev

but just noticed it now because linux >= 6.12 will now build with rust.

I’m getting some strong deja vu here… but whatever, a quick remove-references-to in the offending expression and it’s all cleared up (actually ended up dropping 400 MB from the closure instead of adding 900 MB)

1 Like

Still, I don’t see why it should pull in rust as a runtime dep. Could you open an issue in Nixpkgs?