Acpi_call build failed on latest kernel 5.6.2

I used following configuration:

boot.kernelPackages = pkgs.linuxPackages_latest;
boot.extraModulePackages = with config.boot.kernelPackages; [ acpi_call ];

And it refused to build when I ran nixos-rebuild

building '/nix/store/ksbsba0j1dhldd9ai46b05zsb9fgsk82-acpi-call-5.6.2.drv'...
unpacking sources
unpacking source archive /nix/store/0l1gir756vlp7m0hl0ycrl9d042cmvvb-acpi_call-ac67445
source root is acpi_call-ac67445
patching sources
applying patch /nix/store/8qdch3jnmy4x8jv83gxaj11fn4zca4r0-67.patch
patching file acpi_call.c
configuring
no configure script, doing nothing
building
build flags: SHELL=/nix/store/ffli6m23501dkiznwlkf6n4xvrj02snr-bash-4.4-p23/bin/bash
make -C /nix/store/6mhxg6wwpi7rzx7f3qdiq3gn18a55yxa-linux-5.6.2-dev/lib/modules/5.6.2/build M=/build/acpi_call-ac67445 modules
make[1]: Entering directory '/nix/store/6mhxg6wwpi7rzx7f3qdiq3gn18a55yxa-linux-5.6.2-dev/lib/modules/5.6.2/build'
copying path '/nix/store/8bvrb02jy35y404mka1nc5z0513z0ily-libvirt-glib-3.0.0' from 'https://cache.nixos.org'...
copying path '/nix/store/kfhz0gayhhb1ngizwd9h4flgbpwcvkxl-python2.7-deluge-1.3.15' from 'https://cache.nixos.org'...
  CC [M]  /build/acpi_call-ac67445/acpi_call.o
/build/acpi_call-ac67445/acpi_call.c: In function 'init_acpi_call':
/build/acpi_call-ac67445/acpi_call.c:355:53: error: passing argument 4 of 'proc_create' from incompatible pointer type [-Werror=incompatible-pointer-types]
  355 |                                                     &proc_acpi_operations);
      |                                                     ^~~~~~~~~~~~~~~~~~~~~
      |                                                     |
      |                                                     struct file_operations *
In file included from /build/acpi_call-ac67445/acpi_call.c:6:
/nix/store/6mhxg6wwpi7rzx7f3qdiq3gn18a55yxa-linux-5.6.2-dev/lib/modules/5.6.2/source/include/linux/proc_fs.h:64:24: note: expected 'const struct proc_ops *' but argument is of type 'struct file_operations *'
   64 | struct proc_dir_entry *proc_create(const char *name, umode_t mode, struct proc_dir_entry *parent, const struct proc_ops *proc_ops);
      |                        ^~~~~~~~~~~
cc1: some warnings being treated as errors
make[3]: *** [/nix/store/6mhxg6wwpi7rzx7f3qdiq3gn18a55yxa-linux-5.6.2-dev/lib/modules/5.6.2/source/scripts/Makefile.build:268: /build/acpi_call-ac67445/acpi_call.o] Error 1
make[2]: *** [/nix/store/6mhxg6wwpi7rzx7f3qdiq3gn18a55yxa-linux-5.6.2-dev/lib/modules/5.6.2/source/Makefile:1683: /build/acpi_call-ac67445] Error 2
make[1]: *** [/nix/store/6mhxg6wwpi7rzx7f3qdiq3gn18a55yxa-linux-5.6.2-dev/lib/modules/5.6.2/source/Makefile:180: sub-make] Error 2
make[1]: Leaving directory '/nix/store/6mhxg6wwpi7rzx7f3qdiq3gn18a55yxa-linux-5.6.2-dev/lib/modules/5.6.2/build'
make: *** [Makefile:8: default] Error 2
builder for '/nix/store/ksbsba0j1dhldd9ai46b05zsb9fgsk82-acpi-call-5.6.2.drv' failed with exit code 2
copying path '/nix/store/31a5r4k9qsgg1myaablawc2q1l09vc7h-python3.7-libvirt-6.1.0' from 'https://cache.nixos.org'...
cannot build derivation '/nix/store/6svs75qv4ly26a1cqib4jjbpvl5p8lpp-kernel-modules.drv': 1 dependencies couldn't be built

I think it should be some upstream faults? Any thought or help would be appreciated. Thanks in advance

Same on Ubuntu:

This is not the fault of anyone, really. It is an out of tree kernel
module. Those fail from time to time.

Apparently @Mic92 already pushed a fix to our (nix-community) fork of
it: Use proc_ops instead of file_operations on Linux >= 5.6 by vikmik · Pull Request #88 · mkottman/acpi_call · GitHub

2 Likes