From unknown Sat Jun 21 03:25:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#64741: CUPS: fix the PATH settings for filters Resent-From: Emmanuel Beffara Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 20 Jul 2023 08:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 64741 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 64741@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.168984201525494 (code B ref -1); Thu, 20 Jul 2023 08:34:01 +0000 Received: (at submit) by debbugs.gnu.org; 20 Jul 2023 08:33:35 +0000 Received: from localhost ([127.0.0.1]:57650 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qMP6M-0006d8-FT for submit@debbugs.gnu.org; Thu, 20 Jul 2023 04:33:34 -0400 Received: from lists.gnu.org ([2001:470:142::17]:53118) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qMP6K-0006co-6X for submit@debbugs.gnu.org; Thu, 20 Jul 2023 04:33:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qMP6D-0005tI-KU for bug-guix@gnu.org; Thu, 20 Jul 2023 04:33:26 -0400 Received: from relay7-d.mail.gandi.net ([217.70.183.200]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qMP67-0006Ru-M6 for bug-guix@gnu.org; Thu, 20 Jul 2023 04:33:25 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 2E59520015 for ; Thu, 20 Jul 2023 08:33:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beffara.org; s=gm1; t=1689841995; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=AEXOgtN3S9VQo1uf3qFE0IV5Qzfha93BQ6HSGrKaH10=; b=eyV65Ly1ILDZ1h5iW9hKTTgOz3/z9KrhaSIYgqSbZ0SETdx7kqiZA8FwoDcoOcPj4q+44s XwFTmCF/I9+A7gG3Ij0z8q0jwCnUFaOP5/sbIZSDs798UAe1bXTWOG9c/FF2RHVWaScVxf QlWDKiA9va9sOmuk+KX0FHY+oZZ3Y3f4nIof0fXgwwwYNSHify2peoyE+FVriweegkAQXz gmvEvy/a7lO6jvGszGK5oy46aBnBaKjwmRWUpWjuJ7eJBP35x7kagBKcWIQYN4cfls/eFH 5G6CG0tF6+hW74i9deKUWhXm52VjMtUQ0L0NBylXNsGq1QhS6XjjRMaoaCjhBA== Date: Thu, 20 Jul 2023 10:32:48 +0200 Message-ID: <20230720103248.GB1092@beffara.org> From: Emmanuel Beffara References: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="EsVSDa8c3jWVzaDR" Content-Disposition: inline Content-Transfer-Encoding: 8bit X-GND-Sasl: manu@beffara.org Received-SPF: none client-ip=217.70.183.200; envelope-from=manu@beffara.org; helo=relay7-d.mail.gandi.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_HELO_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --EsVSDa8c3jWVzaDR Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit Hello, I would like to propose the attached patch for the `cups-filters` package. The point is to add the paths for `coreutils` and `sed` to the PATH setting in the wrapper scripts so that the filters can find them. Maybe other packages should be added, at least this patch fixes the issue I was facing. About my specific case: I want to use the printing service of my university, an instance of PaperCut. This is as simple as setting an LPD queue at the right address with the PPD printer driver provided by the university (a Ricoh IM C5500 PS in my case, if that makes any difference). After switching to Guix system a few months ago, this stopped working: print jobs were sent with no error message but they all appeared as 1 page in PaperCut and nothing actually came out of the printers. I finally took the time to explore the logs and it appears that CUPS at some point calls `foomatic-rip` and that this filter fails, as shown in these extracts from `/var/log/cups/error_log`: ``` I [18/Jul/2023:16:34:10 +0200] [Job 12] Started filter /gnu/store/nhjpc32034v6186v37l51j0z2jq8xlkm-cups-server-bin/lib/cups/filter/foomatic-rip (PID 27451) [...] D [18/Jul/2023:16:34:21 +0200] [Job 12] Starting process \"renderer\" (generation 2) D [18/Jul/2023:16:34:21 +0200] [Job 12] JCL: \033%-12345X@PJL D [18/Jul/2023:16:34:21 +0200] [Job 12] D [18/Jul/2023:16:34:21 +0200] [Job 12] /gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/bin/bash: line 5: date: command not found D [18/Jul/2023:16:34:21 +0200] [Job 12] /gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/bin/bash: line 5: sed: command not found D [18/Jul/2023:16:34:21 +0200] [Job 12] /gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/bin/bash: line 5: date: command not found D [18/Jul/2023:16:34:21 +0200] [Job 12] /gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/bin/bash: line 5: sed: command not found D [18/Jul/2023:16:34:21 +0200] [Job 12] /gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/bin/bash: line 5: cat: command not found D [18/Jul/2023:16:34:21 +0200] [Job 12] renderer exited with status 127 D [18/Jul/2023:16:34:21 +0200] [Job 12] Process is dying with \"Encountered error Broken pipe during fwrite\", exit stat 1 [...] D [18/Jul/2023:16:34:21 +0200] [Job 12] PID 27451 (/gnu/store/nhjpc32034v6186v37l51j0z2jq8xlkm-cups-server-bin/lib/cups/filter/foomatic-rip) stopped with status 1. ``` So `foomatic-rip` actually needs `date`, `sed` and `cat` but does not find them. The issue with required tools is known in Guix because the package definition for `cups-filters` already adds paths for `ghostscript-with-cups` and `grep`. The patch just adds necessary inputs for those, and it makes printing work for me. I don't know what other tools the filters might require in other situations. On a different level, I am surprised that the failure above does not lead to an actual user-visible error by CUPS. A corrupted job is actually sent silently (probably with some error messages mixed with the printing job or with malformed printing commands) although the filter does return an error code. Maybe this should be sent upstream as a CUPS bug? -- Emmanuel --EsVSDa8c3jWVzaDR Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="cups-filters.patch" Content-Transfer-Encoding: 8bit diff --git a/gnu/packages/cups.scm b/gnu/packages/cups.scm index 9d81a0aa07..301fdcdb35 100644 --- a/gnu/packages/cups.scm +++ b/gnu/packages/cups.scm @@ -198,9 +198,11 @@ (define-public cups-filters (wrap-program file `("PATH" ":" prefix (,(string-append + #$(this-package-input "coreutils") "/bin:" #$(this-package-input "ghostscript-with-cups") "/bin:" - #$(this-package-input "grep") "/bin"))))) + #$(this-package-input "grep") "/bin:" + #$(this-package-input "sed") "/bin"))))) (find-files (string-append #$output "/lib/cups/filter")))))))) (native-inputs @@ -208,6 +210,7 @@ (define-public cups-filters pkg-config)) (inputs (list avahi + coreutils fontconfig freetype font-dejavu ; also needed by test suite @@ -222,6 +225,7 @@ (define-public cups-filters glib qpdf poppler + sed cups-minimal)) (home-page "https://wiki.linuxfoundation.org/openprinting/cups-filters") (synopsis "OpenPrinting CUPS filters and backends") --EsVSDa8c3jWVzaDR-- From unknown Sat Jun 21 03:25:45 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Emmanuel Beffara Subject: bug#64741: closed (Re: bug#64741: CUPS: fix the PATH settings for filters) Message-ID: References: <874jlyl1c2.fsf@gmail.com> <20230720103248.GB1092@beffara.org> X-Gnu-PR-Message: they-closed 64741 X-Gnu-PR-Package: guix Reply-To: 64741@debbugs.gnu.org Date: Thu, 20 Jul 2023 21:29:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1689888542-7194-1" This is a multi-part message in MIME format... ------------=_1689888542-7194-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #64741: CUPS: fix the PATH settings for filters which was filed against the guix package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 64741@debbugs.gnu.org. --=20 64741: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D64741 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1689888542-7194-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 64741-done) by debbugs.gnu.org; 20 Jul 2023 21:28:39 +0000 Received: from localhost ([127.0.0.1]:60123 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qMbCR-0001rU-DV for submit@debbugs.gnu.org; Thu, 20 Jul 2023 17:28:39 -0400 Received: from mail-qv1-xf2f.google.com ([2607:f8b0:4864:20::f2f]:45081) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qMbCO-0001rE-Ko for 64741-done@debbugs.gnu.org; Thu, 20 Jul 2023 17:28:37 -0400 Received: by mail-qv1-xf2f.google.com with SMTP id 6a1803df08f44-634f59e7d47so10004406d6.2 for <64741-done@debbugs.gnu.org>; Thu, 20 Jul 2023 14:28:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689888510; x=1690493310; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=xRjzTDmaGs5qDzB/W0IjSkQ1NrZWsnnFkK7DOIeaoeU=; b=I084FjWq05IDAIQzppdHhoXaMk7xWA27FWjjQdSa+gYx31HklH92h8tQIjKY3m/K8u +/DIgCmYbk5L6YB9u1AyYzqHL2D5MIfv1G5qz1pTPvnbEBrEJfzNAWnn4dHgN0lWUnsQ VPUS87T6Lsz5UkUKULXTgBnzbqer8gO/jbQrVbIiDIoULb3uSXzewuZys5HdTu1xYceb ozuE+IHPT5/e3eyomU8SP3EftVVKSRpoEWkJLwN7GwYoIDqfux5oupH7lBl68D0y9Mm+ nptLRStFZ0ppXfPqSOHB6+si/Py2160dayA4WaVBO3Arbja0blE/ZnZfONC6Af3CDmAi 9kgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689888510; x=1690493310; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=xRjzTDmaGs5qDzB/W0IjSkQ1NrZWsnnFkK7DOIeaoeU=; b=PC1o1OI/6VSt3y6jumMSgKe2N/iQZNF9B7RTLFOKcxqdosXHr7EYaK+1C1/EcvgOrs 5V8++YaLXCzkuFg7kmjus+i2U8OdgBKxF9Kxhg8dUXgg4GkfCrtPNPJ6Wxj0S9ZVv+8e bn2maYWvp0dcn7exoYK0Ikbm0oiWzLwo42PCQmUUoGodilV325nRSwB6ASI0pvVKI6hW qYLXPLxMUFrezhyLZVR8WBeIgUptTkvJ5L2L1YbmQuIvWzUhBMh3lMOxgx1mRJqMTKgn qRmveb43MQSICJXi8L01C2el5xJIEFqy8mJgFwmgtJaAX6nsTBhAqx/uWI9u5WUp9JJt aYew== X-Gm-Message-State: ABy/qLaEXxUcZ+8K4zygj6r7KVod2xfihDYldlc++JnfQwg/CNz+Xa4F BC/g8SCO+xDHvNDXM5Gewl0z5gg+sqg= X-Google-Smtp-Source: APBJJlHj1IhXRnLxXtLPYMDWF/j0o4Q9opsZUJFLda8K5BySt8BIjoz9YqE5KynXnSucuOULL3cr8g== X-Received: by 2002:a0c:f689:0:b0:636:60c6:203d with SMTP id p9-20020a0cf689000000b0063660c6203dmr281767qvn.35.1689888510528; Thu, 20 Jul 2023 14:28:30 -0700 (PDT) Received: from hurd (dsl-159-145.b2b2c.ca. [66.158.159.145]) by smtp.gmail.com with ESMTPSA id g15-20020a0ce4cf000000b00637abbfaac9sm740990qvm.98.2023.07.20.14.28.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jul 2023 14:28:30 -0700 (PDT) From: Maxim Cournoyer To: Emmanuel Beffara Subject: Re: bug#64741: CUPS: fix the PATH settings for filters References: <20230720103248.GB1092@beffara.org> Date: Thu, 20 Jul 2023 17:28:29 -0400 In-Reply-To: <20230720103248.GB1092@beffara.org> (Emmanuel Beffara's message of "Thu, 20 Jul 2023 10:32:48 +0200") Message-ID: <874jlyl1c2.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 64741-done Cc: 64741-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Emmanuel Beffara writes: > Hello, > > I would like to propose the attached patch for the `cups-filters` package. The > point is to add the paths for `coreutils` and `sed` to the PATH setting in the > wrapper scripts so that the filters can find them. Maybe other packages should > be added, at least this patch fixes the issue I was facing. > > About my specific case: I want to use the printing service of my university, > an instance of PaperCut. This is as simple as setting an LPD queue at the > right address with the PPD printer driver provided by the university (a Ricoh > IM C5500 PS in my case, if that makes any difference). After switching to Guix > system a few months ago, this stopped working: print jobs were sent with no > error message but they all appeared as 1 page in PaperCut and nothing actually > came out of the printers. I finally took the time to explore the logs and it > appears that CUPS at some point calls `foomatic-rip` and that this filter > fails, as shown in these extracts from `/var/log/cups/error_log`: > > ``` > I [18/Jul/2023:16:34:10 +0200] [Job 12] Started filter > /gnu/store/nhjpc32034v6186v37l51j0z2jq8xlkm-cups-server-bin/lib/cups/filter/foomatic-rip > (PID 27451) > [...] > D [18/Jul/2023:16:34:21 +0200] [Job 12] Starting process \"renderer\" > (generation 2) > D [18/Jul/2023:16:34:21 +0200] [Job 12] JCL: \033%-12345X@PJL > D [18/Jul/2023:16:34:21 +0200] [Job 12] > D [18/Jul/2023:16:34:21 +0200] [Job 12] > /gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/bin/bash: > line 5: date: command not found > D [18/Jul/2023:16:34:21 +0200] [Job 12] > /gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/bin/bash: > line 5: sed: command not found > D [18/Jul/2023:16:34:21 +0200] [Job 12] > /gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/bin/bash: > line 5: date: command not found > D [18/Jul/2023:16:34:21 +0200] [Job 12] > /gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/bin/bash: > line 5: sed: command not found > D [18/Jul/2023:16:34:21 +0200] [Job 12] > /gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/bin/bash: > line 5: cat: command not found > D [18/Jul/2023:16:34:21 +0200] [Job 12] renderer exited with status > 127 > D [18/Jul/2023:16:34:21 +0200] [Job 12] Process is dying with > \"Encountered error Broken pipe during fwrite\", exit stat 1 > [...] > D [18/Jul/2023:16:34:21 +0200] [Job 12] PID 27451 > (/gnu/store/nhjpc32034v6186v37l51j0z2jq8xlkm-cups-server-bin/lib/cups/filter/foomatic-rip) > stopped with status 1. > ``` > > So `foomatic-rip` actually needs `date`, `sed` and `cat` but does not find > them. The issue with required tools is known in Guix because the package > definition for `cups-filters` already adds paths for `ghostscript-with-cups` > and `grep`. The patch just adds necessary inputs for those, and it makes > printing work for me. I don't know what other tools the filters might require > in other situations. That sounds reasonable. > On a different level, I am surprised that the failure above does not lead to > an actual user-visible error by CUPS. A corrupted job is actually sent > silently (probably with some error messages mixed with the printing job or > with malformed printing commands) although the filter does return an error > code. Maybe this should be sent upstream as a CUPS bug? That's indeed surprising. I'd encourage you to try to reach out to upstream with the problem, if that's feasible for you. I've installed the change to the recently reintroduced core-updates branch. Bonus points next time if you write a GNU ChangeLog style commit message to go along with it! -- Thanks, Maxim ------------=_1689888542-7194-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 20 Jul 2023 08:33:35 +0000 Received: from localhost ([127.0.0.1]:57650 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qMP6M-0006d8-FT for submit@debbugs.gnu.org; Thu, 20 Jul 2023 04:33:34 -0400 Received: from lists.gnu.org ([2001:470:142::17]:53118) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qMP6K-0006co-6X for submit@debbugs.gnu.org; Thu, 20 Jul 2023 04:33:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qMP6D-0005tI-KU for bug-guix@gnu.org; Thu, 20 Jul 2023 04:33:26 -0400 Received: from relay7-d.mail.gandi.net ([217.70.183.200]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qMP67-0006Ru-M6 for bug-guix@gnu.org; Thu, 20 Jul 2023 04:33:25 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 2E59520015 for ; Thu, 20 Jul 2023 08:33:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beffara.org; s=gm1; t=1689841995; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=AEXOgtN3S9VQo1uf3qFE0IV5Qzfha93BQ6HSGrKaH10=; b=eyV65Ly1ILDZ1h5iW9hKTTgOz3/z9KrhaSIYgqSbZ0SETdx7kqiZA8FwoDcoOcPj4q+44s XwFTmCF/I9+A7gG3Ij0z8q0jwCnUFaOP5/sbIZSDs798UAe1bXTWOG9c/FF2RHVWaScVxf QlWDKiA9va9sOmuk+KX0FHY+oZZ3Y3f4nIof0fXgwwwYNSHify2peoyE+FVriweegkAQXz gmvEvy/a7lO6jvGszGK5oy46aBnBaKjwmRWUpWjuJ7eJBP35x7kagBKcWIQYN4cfls/eFH 5G6CG0tF6+hW74i9deKUWhXm52VjMtUQ0L0NBylXNsGq1QhS6XjjRMaoaCjhBA== Date: Thu, 20 Jul 2023 10:32:48 +0200 Message-ID: <20230720103248.GB1092@beffara.org> From: Emmanuel Beffara To: bug-guix@gnu.org Subject: CUPS: fix the PATH settings for filters References: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="EsVSDa8c3jWVzaDR" Content-Disposition: inline Content-Transfer-Encoding: 8bit X-GND-Sasl: manu@beffara.org Received-SPF: none client-ip=217.70.183.200; envelope-from=manu@beffara.org; helo=relay7-d.mail.gandi.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_HELO_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --EsVSDa8c3jWVzaDR Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit Hello, I would like to propose the attached patch for the `cups-filters` package. The point is to add the paths for `coreutils` and `sed` to the PATH setting in the wrapper scripts so that the filters can find them. Maybe other packages should be added, at least this patch fixes the issue I was facing. About my specific case: I want to use the printing service of my university, an instance of PaperCut. This is as simple as setting an LPD queue at the right address with the PPD printer driver provided by the university (a Ricoh IM C5500 PS in my case, if that makes any difference). After switching to Guix system a few months ago, this stopped working: print jobs were sent with no error message but they all appeared as 1 page in PaperCut and nothing actually came out of the printers. I finally took the time to explore the logs and it appears that CUPS at some point calls `foomatic-rip` and that this filter fails, as shown in these extracts from `/var/log/cups/error_log`: ``` I [18/Jul/2023:16:34:10 +0200] [Job 12] Started filter /gnu/store/nhjpc32034v6186v37l51j0z2jq8xlkm-cups-server-bin/lib/cups/filter/foomatic-rip (PID 27451) [...] D [18/Jul/2023:16:34:21 +0200] [Job 12] Starting process \"renderer\" (generation 2) D [18/Jul/2023:16:34:21 +0200] [Job 12] JCL: \033%-12345X@PJL D [18/Jul/2023:16:34:21 +0200] [Job 12] D [18/Jul/2023:16:34:21 +0200] [Job 12] /gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/bin/bash: line 5: date: command not found D [18/Jul/2023:16:34:21 +0200] [Job 12] /gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/bin/bash: line 5: sed: command not found D [18/Jul/2023:16:34:21 +0200] [Job 12] /gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/bin/bash: line 5: date: command not found D [18/Jul/2023:16:34:21 +0200] [Job 12] /gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/bin/bash: line 5: sed: command not found D [18/Jul/2023:16:34:21 +0200] [Job 12] /gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/bin/bash: line 5: cat: command not found D [18/Jul/2023:16:34:21 +0200] [Job 12] renderer exited with status 127 D [18/Jul/2023:16:34:21 +0200] [Job 12] Process is dying with \"Encountered error Broken pipe during fwrite\", exit stat 1 [...] D [18/Jul/2023:16:34:21 +0200] [Job 12] PID 27451 (/gnu/store/nhjpc32034v6186v37l51j0z2jq8xlkm-cups-server-bin/lib/cups/filter/foomatic-rip) stopped with status 1. ``` So `foomatic-rip` actually needs `date`, `sed` and `cat` but does not find them. The issue with required tools is known in Guix because the package definition for `cups-filters` already adds paths for `ghostscript-with-cups` and `grep`. The patch just adds necessary inputs for those, and it makes printing work for me. I don't know what other tools the filters might require in other situations. On a different level, I am surprised that the failure above does not lead to an actual user-visible error by CUPS. A corrupted job is actually sent silently (probably with some error messages mixed with the printing job or with malformed printing commands) although the filter does return an error code. Maybe this should be sent upstream as a CUPS bug? -- Emmanuel --EsVSDa8c3jWVzaDR Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="cups-filters.patch" Content-Transfer-Encoding: 8bit diff --git a/gnu/packages/cups.scm b/gnu/packages/cups.scm index 9d81a0aa07..301fdcdb35 100644 --- a/gnu/packages/cups.scm +++ b/gnu/packages/cups.scm @@ -198,9 +198,11 @@ (define-public cups-filters (wrap-program file `("PATH" ":" prefix (,(string-append + #$(this-package-input "coreutils") "/bin:" #$(this-package-input "ghostscript-with-cups") "/bin:" - #$(this-package-input "grep") "/bin"))))) + #$(this-package-input "grep") "/bin:" + #$(this-package-input "sed") "/bin"))))) (find-files (string-append #$output "/lib/cups/filter")))))))) (native-inputs @@ -208,6 +210,7 @@ (define-public cups-filters pkg-config)) (inputs (list avahi + coreutils fontconfig freetype font-dejavu ; also needed by test suite @@ -222,6 +225,7 @@ (define-public cups-filters glib qpdf poppler + sed cups-minimal)) (home-page "https://wiki.linuxfoundation.org/openprinting/cups-filters") (synopsis "OpenPrinting CUPS filters and backends") --EsVSDa8c3jWVzaDR-- ------------=_1689888542-7194-1--