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: update version to 3.19.6, fix hpcups segfault, enable udev rule file #64722

Merged
merged 5 commits into from Jul 17, 2019

Conversation

Yarny0
Copy link
Contributor

@Yarny0 Yarny0 commented Jul 14, 2019

Motivation for this change
  • Regular update 3.19.1 -> 3.19.6 .
  • Segfaults hound hpcups since 3.18.7. Add a patch to cure those.
  • Uploading firmware to certain printers requires a udev rule file that was previously deleted in the WithPlugin version of the package. The pull request reinstates that rule file and improves the script that patches paths in the file.
  • Expand package metadata with download URL.
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • 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): no tests available
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip": no depending packages
  • Tested execution of all binary files (usually in ./result/bin/): see note below
  • Determined the impact on package closure size (by running nix path-info -S before and after): new version adds 770KiB to package size
  • Ensured that relevant documentation is up to date: none
  • Fits CONTRIBUTING.md.

  • Most binaries are just python script wrappers. Most scripts fail due to missing GUI support or other reasons. This, however, is not due to this pull request.
  • The pull request was tested with HP LaserJet 1000, connected via USB. Uploading firmware works, triggered by udev. Printing works, with hpcups in the filter chain. Tests have been performed with hplipWithPlugin_3_16_11, hplipWithPlugin_3_18_5, and with hplipWithPlugin.
  • CC maintainer @ttuegel, and @jgeerds for 3.18.5
  • @ttuegel: You removed the udev rule file from the WithPlugin version with commit 8ffd6af ("don't use udev rules to change device owner"). Is this (still) an issue? If it is, I can try to patch away the offending lines in the rule file.

Beginning with version 3.18.7, `hpcups` fails with
> DEBUG: imageProcessorStartPage failed
and segfaults (tested with HP LaserJet 1000 printer).

Upstream bug reports:
* https://bugs.launchpad.net/hplip/+bug/1788706
* https://bugs.launchpad.net/hplip/+bug/1787289

There is a patch available in one of the reports:
https://bugs.launchpad.net/hplip/+bug/1787289/+attachment/5176026/+files/hplip.patch
It applies to 3.18.7, but not to later versions.

This commit adds a slight adaption of
the patch that applies to versions 3.18.9 -- 3.19.6.
The patch fixes NixOS#58949 .

Note that the patch is merely a workaround:
It simply removes all calls into the
ImageProcessor library from `HPCupsFilter.cpp`.
hplip's udev rule uses `nohup` to attempt to detach
its printer configuration script from the udev process.
However, this attempt is futile as udev
tracks its child processes with cgroups:
https://unix.stackexchange.com/a/243648

The hardcoded path to `nohup` was patched to use Nix' `nohup`.
This commit alters the patch script so
that it simply drops the call to `nohup`.
Beginning with commit 8ffd6af,
the build recipe for `hplipWithPlugin` explicitely drops a
udev rule file that is delivered with the sources.
In `hplip` (without plugin), the rule file is retained.

The udev rules takes care of uploading firmware
to certain printers (and maybe of other things),
e.g. to HP LaserJet 1000.

This commit reinstates the rule file and
expands the fixup script so that the rules
are also patched in the WithPlugin version.
@Yarny0
Copy link
Contributor Author

Yarny0 commented Jul 14, 2019

Oops, tiny update to my branch: I already forgot about #58949, which is likely to be fixed by the hpcups patch.

@Yarny0 Yarny0 changed the title hplip: update version to 3.19.6, enable udev rule file hplip: update version to 3.19.6, fix hpcups segfault, enable udev rule file Jul 14, 2019
@@ -142,8 +142,6 @@ pythonPackages.buildPythonApplication {

mkdir -p $out/etc/sane.d/dll.d
mv $out/etc/sane.d/dll.conf $out/etc/sane.d/dll.d/hpaio.conf

rm $out/etc/udev/rules.d/56-hpmud.rules
Copy link
Member

Choose a reason for hiding this comment

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

How is the udev rule installed on NixOS?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently I'm simply adding pkgs.hplipWithPlugins to config.services.udev.packages.

@ttuegel ttuegel merged commit e740b88 into NixOS:master Jul 17, 2019
@Yarny0 Yarny0 deleted the hplip branch November 2, 2019 07:39
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

2 participants