NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.14k stars 14.17k forks source link

In package `libfprint-2-tod1-broadcom`, `update-fw.py` is broken due to `glib` > `gobject-introspection` breaking change #343134

Open ahydronous opened 1 month ago

ahydronous commented 1 month ago

Describe the bug

The script update-fw.py errors out with

Traceback (most recent call last):
  File "/home/Username/Downloads/libfprint-2-tod1-broadcom/./debian/update-fw.py", line 3, in <module>
    from gi.repository import GLib, Gio
ModuleNotFoundError: No module named 'gi'

This is also visible in journalctl -u fprintd

sep 19 11:55:11 mylaptop fprintd[11789]: FwUpgradeError. Check Firmware Files or CID used or Hardware etc.

Installing glib , the error becomes

Traceback (most recent call last):
  File "/home/Username/Downloads/libfprint-2-tod1-broadcom/./debian/update-fw.py", line 3, in <module>
    from gi.repository import GLib, Gio
  File "/nix/store/4gw93n1msss5jgfpjlhv2nrcpwqj51nr-python3-3.12.5-env/lib/python3.12/site-packages/gi/importer.py", line 133, in create_module
    raise ImportError('cannot import name %s, '
ImportError: cannot import name GLib, introspection typelib not found

Found this issue, followed its example: https://github.com/NixOS/nixpkgs/issues/310205 (the problem is also refered to here , its apparently been since 24.05) Installed gobject-introspection, wrapGAppsHook3 and python3Packages.wrapPython to my systemPackages, still the same error.

Notify maintainers

@pitkling


Add a :+1: reaction to issues you find important.

pitkling commented 1 month ago

I'll have a look at this later this week, @ahydronous. I'm not quite sure what exactly the update-fw.py script does (which firmware versions are updated to which, etc.) and for which systems it is needed (or whether it figures this out automatically?).

The update update-fw.py script is actually currently not part of nixpkgs' libfprint-2-tod1-broadcom driver package (also not of the Arch Linux package, which I used in parts for reference). But if some systems require a firmware update for the driver to work properly, it should probably be provided (maybe as an extra package?).

I'll update this thread when I had time to take a closer look.

Artturin commented 1 week ago

You need to wrap the script.

pitkling commented 1 week ago

Yep, sorry, I must admit I got sidetracked and didn't look into this yet. I will try to wrap the script later this week and add it to the driver package for now.

@ahydronous (and maybe @Artturin?): Would you be willing to test the wrapped script, once I added it to the driver package? Not sure that I can test it well myself, since my chipset seems not to need the firmware update.

Artturin commented 1 week ago

I don't have this HW

You can wrap it by installing the script in to $out/bin (Preferably with a more descriptive name)

Adding wrapGAppsNoGuiHook and python3Packages.wrapPython to nativeBuildInputs Adding glib to buildInputs dontWrapGApps = true Using the preFixup and postFixup from this example For how to wrap it see https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/networking/networkd-dispatcher/default.nix