Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hplip: Fix missing library #90609

Merged
merged 2 commits into from Jun 16, 2020
Merged

hplip: Fix missing library #90609

merged 2 commits into from Jun 16, 2020

Conversation

bkchr
Copy link
Contributor

@bkchr bkchr commented Jun 16, 2020

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@bkchr bkchr requested a review from ttuegel June 16, 2020 14:06
@bkchr
Copy link
Contributor Author

bkchr commented Jun 16, 2020

CC @flokli

@flokli
Copy link
Contributor

flokli commented Jun 16, 2020

@bkchr Thanks for the PR! Can you elaborate a bit in how this fails? I was actually able to build this, so I'm curious…

@vcunat
Copy link
Member

vcunat commented Jun 16, 2020

Like this? https://hydra.nixos.org/build/122332330

@flokli
Copy link
Contributor

flokli commented Jun 16, 2020

@vcunat no, it failed on master yesterday with that error message you got hydra logs from, and with #89120 merged, successfully builds (which is why I merged it).

It still currently builds on master.

@bkchr
Copy link
Contributor Author

bkchr commented Jun 16, 2020

Sorry, I should have made it clear. It builds, but it fails at running hp-setup for example. Other commands probably fail as well.

bkchr and others added 2 commits June 16, 2020 20:26
Otherwise, things like `hp-setup` fail finding gi:

```
HP Linux Imaging and Printing System (ver. 3.20.5)
Printer/Fax Setup Utility ver. 9.0

Copyright (c) 2001-18 HP Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

Traceback (most recent call last):
  File "/nix/store/rmzq8c4n47s4q4p31w18waz0zrba2ljl-hplip-3.20.5/share/hplip/setup.py", line 314, in <module>
    ui = import_module(ui_package + ".setupdialog")
  File "/nix/store/n0b076p351ma864q38if4yglsg99hw2s-python3-3.8.3/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/nix/store/rmzq8c4n47s4q4p31w18waz0zrba2ljl-hplip-3.20.5/share/hplip/ui5/setupdialog.py", line 31, in <module>
    from base import device, utils, models, pkit
  File "/nix/store/rmzq8c4n47s4q4p31w18waz0zrba2ljl-hplip-3.20.5/share/hplip/base/pkit.py", line 38, in <module>
    from gi import _gobject as gobject
ModuleNotFoundError: No module named 'gi'
```
Otherwise, things like hp-setup segfault if you run them from another
nixpkgs checkout:

```
HP Linux Imaging and Printing System (ver. 3.20.5)
Printer/Fax Setup Utility ver. 9.0

Copyright (c) 2001-18 HP Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

[1]    4543 abort (core dumped)  result/bin/hp-setup
```
@flokli
Copy link
Contributor

flokli commented Jun 16, 2020

Hmm, even with that patch, running the application (from another nixpkgs checkout) fails, as the QT stuff isn't wrapped:

HP Linux Imaging and Printing System (ver. 3.20.5)
Printer/Fax Setup Utility ver. 9.0

Copyright (c) 2001-18 HP Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

[1]    4543 abort (core dumped)  result/bin/hp-setup

@flokli
Copy link
Contributor

flokli commented Jun 16, 2020

I updated the commit message to include some more detail, and pushed a second commit doing the qt wrapping for the hplip binaries. PTAL.

@bkchr
Copy link
Contributor Author

bkchr commented Jun 16, 2020

Hmm. @flokli you probably not use KDE? That is maybe the reason why I did not get the problems with QT.

@flokli
Copy link
Contributor

flokli commented Jun 16, 2020

Nah, the problem can also happen in other cases, too: #65399

@flokli flokli merged commit 23c9091 into NixOS:master Jun 16, 2020
@bkchr bkchr deleted the bkchr-fix-hplip branch June 16, 2020 21:15
@@ -219,6 +222,10 @@ python3Packages.buildPythonApplication {
--replace {,${utillinux}/bin/}logger \
--replace {/usr,$out}/bin
remove-references-to -t ${stdenv.cc.cc} $(readlink -f $out/lib/*.so)
'' + stdenv.lib.optionalString withQt5 ''
for f in $out/bin/hp-*;do
wrapQtApp $f
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, I'm pretty sure the binaries are wrapped twice now. It should have been:

  preFixup = ''
    makeWrapperArgs+=("''${qtWrapperArgs[@]}")
  ''

But it's not that bad...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, if someone wants to clean this up, I'd happily review a PR, but don't feel it a pressing enough issue to do it myself :-)

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/unable-to-install-hp-printer-with-proprietary-driver-despite-setting-allowunfree-true-in-etc-nixos-configuration-nix/7741/15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants