pop-os / system76-driver

System76 Driver for Pop!_OS
Other
113 stars 29 forks source link

System76 Module Build Error on NixOS with Kernel 6.12 #309

Open kylegortych opened 5 days ago

kylegortych commented 5 days ago

Apologies if this is a duplicate or more specifically a nix related issue. I'm encountering an error when running sudo nixos-rebuild boot --upgrade it fails with an error related to the System76 module which seems to be related to building with latest Linux kernel version.

"Specifically, the error indicates an incompatible pointer type being passed to
the wmi_install_notify_handler function, which suggests the System76 driver needs
to be updated to match the current kernel API." 

Source: Perplexity AI, accessed on 11/26/2024

Thank you in advance for any help and assistance.

stderr ```shell sudo nixos-rebuild boot --upgrade --show-trace unpacking 2 channels... building Nix... building the system configuration... these 29 derivations will be built: /nix/store/c33hg07wjy2xh3icrkjqybcfbc4clbk9-system-path.drv /nix/store/ic0hq3w40q28vm9jyxvccsapk07d5wxl-dbus-1.drv /nix/store/4p2fd90p30784i59z61h9xsm2lr2mykj-X-Restart-Triggers-dbus.drv /nix/store/pwnyr2cdqm29cwj9zfdz2kv54vc7zp06-unit-dbus.service.drv /nix/store/44zg0wgp0y562bgqc8qnfqgnr4kpaln6-user-units.drv /nix/store/25n1l11xjssq37xp3j08xnhlvhd1drfp-unit-accounts-daemon.service.drv /nix/store/vm4nfvzn4v74jbzc3ssnpw9g31py2kv2-google-chrome-131.0.6778.69.drv /nix/store/y3q78iwym0x55azqpr0vzsaddmds2hgd-neovim-0.10.2.drv /nix/store/7cjvk1p1d46ar3jsa22m7w6ipnfsbz7f-home-manager-path.drv /nix/store/iksrw4l5gympja1zi7jcgg42b6qxcg5x-activation-script.drv /nix/store/k0nnxsjmc775qrbbd247yf7ylz9gc583-home-manager-generation.drv /nix/store/3qws34fpa4kjwn2vnhjgf6qchiq54df7-unit-home-manager-kg.service.drv /nix/store/8lxnlx48dg4d1hibm3vf3v5i92gmv7lb-unit-dbus.service.drv /nix/store/8rjkrhyjnrhiqsvvbvy0rmcrh9ihd3xi-X-Restart-Triggers-polkit.drv /nix/store/rxgnfcmzjvh14amd4g60y0lif8bgjc65-unit-polkit.service.drv /nix/store/d2n0lh0z8y1wyk11iwwhy9xvjcbbz6lp-system76-module-1.0.16-6.12.drv /nix/store/k5nrz09qhny9hx5l9qa6wj3j09l8ncra-udev-rules.drv /nix/store/m5i4mzxf7ygngg3rmk6r9x8rgafqrr5p-X-Restart-Triggers-systemd-udevd.drv /nix/store/x739z4kx4ky2pzrsp0ikk6vk392mh9yi-unit-systemd-udevd.service.drv /nix/store/hnrkkjck1fcyrh3d936aiz2yknr3l9k3-system-units.drv /nix/store/shk1nvs23120l11zbpba60qjhrb1pbb7-hwdb.bin.drv /nix/store/4746axv504k0cl5nxr6j17jcmn8ik41v-man-cache.drv /nix/store/yb3iri9acdgfpwcw6z4l26x8yz5dimnx-etc-man_db.conf.drv /nix/store/fzc4lw9b95hgqhg58k9xhvaxr95rb2if-etc.drv /nix/store/pydc109m5b0bamwsim47cll1mzxbvjyh-linux-6.12-modules.drv /nix/store/glpcz3nh0hnvqh1h51f6na08b4bmz6fq-linux-6.12-modules-shrunk.drv /nix/store/s6xx6fldhqhrv7q1byra1w76dasgvigg-initrd-linux-6.12.drv /nix/store/ql9l7x09zc9fw8fpyppphn3i09psx1r0-boot.json.drv /nix/store/1q9h71a6ax5i5wsf86d344wxvk22z2p9-nixos-system-dev-null-25.05beta710087.23e89b7da85c.drv building '/nix/store/c33hg07wjy2xh3icrkjqybcfbc4clbk9-system-path.drv'... building '/nix/store/d2n0lh0z8y1wyk11iwwhy9xvjcbbz6lp-system76-module-1.0.16-6.12.drv'... building '/nix/store/4746axv504k0cl5nxr6j17jcmn8ik41v-man-cache.drv'... building '/nix/store/vm4nfvzn4v74jbzc3ssnpw9g31py2kv2-google-chrome-131.0.6778.69.drv'... building '/nix/store/y3q78iwym0x55azqpr0vzsaddmds2hgd-neovim-0.10.2.drv'... Running phase: unpackPhase unpacking source archive /nix/store/hzshnr6nhpdiz6rgqabsp620r5iqlw0h-source source root is source Running phase: patchPhase Running phase: updateAutotoolsGnuConfigScriptsPhase Running phase: configurePhase no configure script, doing nothing Running phase: buildPhase build flags: SHELL=/nix/store/0irlcqx2n3qm6b1pc9rsd2i8qpvcccaj-bash-5.2p37/bin/bash KERNEL_DIR=/nix/store/lacdcr5zi7w59f8xsq4cfi41mzgc6dcn-linux-6.12-dev/lib/modules/6.12.0/build make -C "/nix/store/lacdcr5zi7w59f8xsq4cfi41mzgc6dcn-linux-6.12-dev/lib/modules/6.12.0/build" M="/build/source" modules make[1]: Entering directory '/nix/store/lacdcr5zi7w59f8xsq4cfi41mzgc6dcn-linux-6.12-dev/lib/modules/6.12.0/build' structuredAttrs is enabled Running phase: patchPhase Running phase: updateAutotoolsGnuConfigScriptsPhase Running phase: configurePhase no configure script, doing nothing Running phase: buildPhase Running phase: unpackPhase Generating remote plugin manifest Looking for lua dependencies... _addToLuaPath called for dir /nix/store/lmrhz604wzcm8lzl7fq9804vcci9i15d-vim-pack-dir LUA_PATH towards the end of packdir: ;; Running phase: installPhase no Makefile or custom installPhase, doing nothing Running phase: fixupPhase shrinking RPATHs of ELF executables and libraries in /nix/store/mpzn92524y6nqqk6sp4rcllpf0x19z1p-neovim-0.10.2 checking for references to /build/ in /nix/store/mpzn92524y6nqqk6sp4rcllpf0x19z1p-neovim-0.10.2... gzipping man pages under /nix/store/mpzn92524y6nqqk6sp4rcllpf0x19z1p-neovim-0.10.2/share/man/ patching script interpreter paths in /nix/store/mpzn92524y6nqqk6sp4rcllpf0x19z1p-neovim-0.10.2 stripping (with command strip and flags -S -p) in /nix/store/mpzn92524y6nqqk6sp4rcllpf0x19z1p-neovim-0.10.2/lib /nix/store/mpzn92524y6nqqk6sp4rcllpf0x19z1p-neovim-0.10.2/bin CC [M] /build/source/system76.o warning: collision between `/nix/store/rz1w8ha9c3hnir9qyz59395lf5ya9x9f-xwayland-24.1.4/lib/xorg/protocol.txt' and `/nix/store/cwa9ihrzv9zcg6rci26g5kxj7lgm3110-xorg-server-21.1.14/lib/xorg/protocol.txt' warning: collision between `/nix/store/rz1w8ha9c3hnir9qyz59395lf5ya9x9f-xwayland-24.1.4/share/man/man1/Xserver.1.gz' and `/nix/store/cwa9ihrzv9zcg6rci26g5kxj7lgm3110-xorg-server-21.1.14/share/man/man1/Xserver.1.gz' In file included from /build/source/system76.c:110: /build/source/system76_hwmon.c:24:5: warning: this use of "defined" may not be portable [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wexpansion-to-defined-Wexpansion-to-defined8;;] 24 | #if S76_HAS_HWMON | ^~~~~~~~~~~~~ /build/source/system76_hwmon.c:24:5: warning: this use of "defined" may not be portable [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wexpansion-to-defined-Wexpansion-to-defined8;;] /build/source/system76_hwmon.c:24:5: warning: this use of "defined" may not be portable [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wexpansion-to-defined-Wexpansion-to-defined8;;] /build/source/system76.c: In function 's76_probe': /build/source/system76.c:210:58: error: passing argument 2 of 'wmi_install_notify_handler' from incompatible pointer type [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wincompatible-pointer-types-Werror=incompatible-pointer-types8;;] 210 | err = wmi_install_notify_handler(S76_EVENT_GUID, s76_wmi_notify, NULL); | ^~~~~~~~~~~~~~ | | | void (*)(u32, void *) {aka void (*)(unsigned int, void *)} In file included from /build/source/system76.c:25: /nix/store/lacdcr5zi7w59f8xsq4cfi41mzgc6dcn-linux-6.12-dev/lib/modules/6.12.0/source/include/linux/acpi.h:404:60: note: expected 'wmi_notify_handler' {aka 'void (*)(union acpi_object *, void *)'} but argument is of type 'void (*)(u32, void *)' {aka 'void (*)(unsigned int, void *)'} 404 | wmi_notify_handler handler, void *data); | ~~~~~~~~~~~~~~~~~~~^~~~~~~ cc1: some warnings being treated as errors make[3]: *** [/nix/store/lacdcr5zi7w59f8xsq4cfi41mzgc6dcn-linux-6.12-dev/lib/modules/6.12.0/source/scripts/Makefile.build:229: /build/source/system76.o] Error 1 make[2]: *** [/nix/store/lacdcr5zi7w59f8xsq4cfi41mzgc6dcn-linux-6.12-dev/lib/modules/6.12.0/source/Makefile:1936: /build/source] Error 2 make[1]: *** [/nix/store/lacdcr5zi7w59f8xsq4cfi41mzgc6dcn-linux-6.12-dev/lib/modules/6.12.0/source/Makefile:224: __sub-make] Error 2 make[1]: Leaving directory '/nix/store/lacdcr5zi7w59f8xsq4cfi41mzgc6dcn-linux-6.12-dev/lib/modules/6.12.0/build' make: *** [Makefile:5: all] Error 2 error: builder for '/nix/store/d2n0lh0z8y1wyk11iwwhy9xvjcbbz6lp-system76-module-1.0.16-6.12.drv' failed with exit code 2 error: 1 dependencies of derivation '/nix/store/shk1nvs23120l11zbpba60qjhrb1pbb7-hwdb.bin.drv' failed to build error: 1 dependencies of derivation '/nix/store/pydc109m5b0bamwsim47cll1mzxbvjyh-linux-6.12-modules.drv' failed to build error: 1 dependencies of derivation '/nix/store/k5nrz09qhny9hx5l9qa6wj3j09l8ncra-udev-rules.drv' failed to build error: 1 dependencies of derivation '/nix/store/1q9h71a6ax5i5wsf86d344wxvk22z2p9-nixos-system-dev-null-25.05beta710087.23e89b7da85c.drv' failed to build ```
Meta info | Type | Details | | --------- | ------- | | OS | NixOS 25.05beta708622.5e4fbfb6b3de (Warbler) x86_64 | | Host | System76 Pangolin | | Kernel | 6.11.8 | | Shell | fish 3.7.1 | | DE | Plasma 6.2.3 (Wayland) | | WM | kwin | | Terminal | WezTerm | | CPU | AMD Ryzen 7 6800U with Radeon Graphics (16) @ 4.768GHz | | GPU | AMD ATI Radeon 680M | ```shell sudo nix-channel --list home-manager https://github.com/nix-community/home-manager/archive/master.tar.gz nixos https://nixos.org/channels/nixos-unstable nix --version nix (Nix) 2.24.10 ```
configuration.nix ```nix # Edit this configuration file to define what should be installed on # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). { config, pkgs, ... }: let sddmwallpaper = /home/blank/Pictures/wallpaper.jpg; in { imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix ./dotfiles/doom.nix ./dotfiles/fish.nix ./dotfiles/neovim.nix ./dotfiles/starship.nix ./dotfiles/wezterm.nix ]; #nix settings nix.settings.experimental-features = [ "nix-command" "flakes" ]; hardware.system76.enableAll = true; ... etc. } ```
ahoneybun commented 4 hours ago

Does it work if you pull in the changes from nixos-hardware? It works on my galp5-1650

https://gitlab.com/ahoneybun/nix-configs/-/blob/main/flake.nix#L83

kylegortych commented 38 minutes ago

Hello @ahoneybun, I'm not sure if I can pull the changes as I haven't used flakes yet. I did run sudo nix-channel --update. This problem has happen before and it was resolved so it may just be a matter of waiting.

Thank you for the link to your flake config. I may need to start using flakes.

ahoneybun commented 35 minutes ago

You can use channels instead for nixos-hardware:

https://github.com/NixOS/nixos-hardware?tab=readme-ov-file#using-channels