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 hp-setup crash by adding proper NixOS PPD search path #108830
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems ok but in general I think our way of removing such FHS paths is bad and might not be reliable in future releases...
Yeah, this should ideally be |
I can't comment on all the other |
HPLIP's getSystemPPDs() function relies on searching for PPDs below common FHS paths. None of these exist on NixOS, but the code assumes that at least one of the directories will be found, and crashes when it doesn't (cups_ppd_path is None and the code passes that to os.path.join). A usable PPD search path for the running system on NixOS is /var/lib/cups/path/share, so this patches the source to check this path as well. This should fix the NixOS case and keep non-NixOS cases working too.
134e385
to
60df55c
Compare
Result of 2 packages built:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Diff LGTM. hp-setup
works both in hplipWithPlugin
and hplip
.
Backported in 40e8aae. |
Motivation for this change
This is to address the crash I hit recently trying to use
hp-setup
, details here: #21796.From the commit description:
Disclaimer here, this fixes my problem with 20.09 and I've built my system config against master, but I haven't run a machine with master to actually test this out there. I plan to do so on a spare machine when I get time to set one up, but I'm opening this now to get some eyes on it.
I'm interested in having this backported to 20.09, if it's considered safe enough.
Thanks!
Things done
sandbox
innix.conf
on non-NixOS linux)nixos/tests/printing.nix
passes with these changes applied to master.nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
hplipWithPlugin
../result/bin/
)hp-setup
.nix path-info -S
before and after)