GNU bug report logs - #50625
ghostscript shell scripts refer to unqualified external commands

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix; Reported by: Jack Hill <jackhill@HIDDEN>; dated Thu, 16 Sep 2021 15:29:02 UTC; Maintainer for guix is bug-guix@HIDDEN.

Message received at 50625 <at> debbugs.gnu.org:


Received: (at 50625) by debbugs.gnu.org; 17 Sep 2021 14:45:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 17 10:45:13 2021
Received: from localhost ([127.0.0.1]:60876 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mRF73-0005vm-Fx
	for submit <at> debbugs.gnu.org; Fri, 17 Sep 2021 10:45:13 -0400
Received: from mail-qt1-f180.google.com ([209.85.160.180]:41599)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <zimon.toutoune@HIDDEN>) id 1mRF71-0005o0-5m
 for 50625 <at> debbugs.gnu.org; Fri, 17 Sep 2021 10:45:12 -0400
Received: by mail-qt1-f180.google.com with SMTP id u21so8931116qtw.8
 for <50625 <at> debbugs.gnu.org>; Fri, 17 Sep 2021 07:45:11 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=aTpARAlgz7Gbw3yUKCRy6ZdI4oxgXd7di6inTrHnmCc=;
 b=G+A8gNk9TvvDzE979Wz3Fk7yI2OYud1PfcKhYFw2C0Hqj/wnpMt/rIayaCnDBcpwxK
 CU8mNulqb89l8/nJHxXYP0UeYq+ywwHXWnQNHiJQOlaNW/6X5MM5efSv+MU9CXtFw33Q
 qcF/buCt6LdQBkuAZmGz385vNG/tpbjb8Eip7UN5Hh8oNuCgyWuJQwTym2LKRyP/Yp+c
 2aqXX+uD3AMOdGrb/n7lih1xZMVfBiDPOBDazWpa9nIRcrzVGQhbr4y57vPjrD0IiBoR
 n8NZEpwjEiseoOVoPmBDsIDN268m24zaOfnt33SqDJzakOf8PxuA8a/S9UWKg2J6SP62
 6S1A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=aTpARAlgz7Gbw3yUKCRy6ZdI4oxgXd7di6inTrHnmCc=;
 b=cLD37Q7DowQ7GSpocV14SSTet4AXNiSLgIhtgWtYTj+WdfoesHAKcwfvvhbeXEMvPr
 /WJW6QwfVMq2FeLSLnjeOeDrwIzeCZ3ILXgHNKAuFwij5ciBouBOFhWjOzmOzicP+sH1
 /loGxvYgDSXrcwlWSOjGqausero9guiiKUnMdoUhQOTn7LP6PBJhhqryiBXr1uZ+H2d/
 foDvhfDxUMVP2NJ+MA0AhVZmvjL5+Cgp35zEW9JU+116XrfxvPfwaA7cLRdA9S+PA6n/
 rEkuvCMCvuA8NqPL3Si/qjg7rtucs+U/s9QOITtd4ZYlDpDYQtZSn6owkB6UJJwqs3kf
 xOVA==
X-Gm-Message-State: AOAM5306wmoKATkq1m2abaiUQBiGFr5CNZVTCSOS/OqSsXVOONMnkwp7
 X+ZX9DWdv1eUU5/Cv5SJqy1eb7tXgcy2idkwykV69674LGk=
X-Google-Smtp-Source: ABdhPJxdNkyWASLqNW6kVnj5sztIyelsaXskfq+BRbQiLGREC6ML8i3kLIqNsA+sD0yogNXJNtpxnmqXdEYZs8PThk4=
X-Received: by 2002:ac8:570f:: with SMTP id 15mr10902616qtw.335.1631889905548; 
 Fri, 17 Sep 2021 07:45:05 -0700 (PDT)
MIME-Version: 1.0
References: <alpine.DEB.2.21.2109161121570.4243@HIDDEN>
In-Reply-To: <alpine.DEB.2.21.2109161121570.4243@HIDDEN>
From: zimoun <zimon.toutoune@HIDDEN>
Date: Fri, 17 Sep 2021 16:44:54 +0200
Message-ID: <CAJ3okZ387X0bWitCQfbWAMDmdBBtET7gduiqK+y8FqjeEs60LQ@HIDDEN>
Subject: Re: bug#50625: ghostscript shell scripts refer to unqualified
 external commands
To: Jack Hill <jackhill@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 50625
Cc: 50625 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi,

On Thu, 16 Sept 2021 at 17:29, Jack Hill <jackhill@HIDDEN> wrote:

> Many of the commands, e.g. ps2pdf, provided by the ghostscript package are
> implemented as shell scripts that do some argument or file name processing
> before invoking the main gs binary. These scripts invoke external commands
> like basename, awk, dirname, and even gs by dynamically looking them up
> PATH. Instead, they should refer to a specific path in the store so that
> the behavior of ghostscript doesn't depend on the environment and so that
> Guix can see these references.

Indeed.

--8<---------------cut here---------------start------------->8---
$ guix environment -C --ad-hoc ghostscript
[env]$ ps2pdf --version
/gnu/store/jc3x02w3dmbff7s5r7g2d21r2jswag4p-profile/bin/ps2pdf: line
8: dirname: command not found
/gnu/store/jc3x02w3dmbff7s5r7g2d21r2jswag4p-profile/bin/ps2pdf14: line
3: dirname: command not found
/gnu/store/jc3x02w3dmbff7s5r7g2d21r2jswag4p-profile/bin/ps2pdfwr: line
7: dirname: command not found
/gnu/store/jc3x02w3dmbff7s5r7g2d21r2jswag4p-profile/bin/ps2pdfwr: line
24: basename: command not found
Usage:  [options...] (input.[e]ps|-) [output.pdf|-]
--8<---------------cut here---------------end--------------->8---

The fix would to add these external commands as 'inputs' and then let
'wrap-program'.  Do you want to give a try?

Cheers,
simon




Information forwarded to bug-guix@HIDDEN:
bug#50625; Package guix. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 16 Sep 2021 15:28:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 16 11:28:51 2021
Received: from localhost ([127.0.0.1]:56247 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mQtJj-0005h0-GO
	for submit <at> debbugs.gnu.org; Thu, 16 Sep 2021 11:28:51 -0400
Received: from lists.gnu.org ([209.51.188.17]:35088)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jackhill@HIDDEN>) id 1mQtJc-0005gi-6Q
 for submit <at> debbugs.gnu.org; Thu, 16 Sep 2021 11:28:50 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:40344)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <jackhill@HIDDEN>)
 id 1mQtJb-0007rm-Vc
 for bug-guix@HIDDEN; Thu, 16 Sep 2021 11:28:43 -0400
Received: from minsky.hcoop.net ([104.248.1.95]:38718)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <jackhill@HIDDEN>)
 id 1mQtJa-0000o1-AQ
 for bug-guix@HIDDEN; Thu, 16 Sep 2021 11:28:43 -0400
Received: from marsh.hcoop.net ([45.55.52.66])
 by minsky.hcoop.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <jackhill@HIDDEN>)
 id 1mQtJY-0003f0-Kk
 for bug-guix@HIDDEN; Thu, 16 Sep 2021 11:28:40 -0400
Date: Thu, 16 Sep 2021 11:28:40 -0400 (EDT)
From: Jack Hill <jackhill@HIDDEN>
X-X-Sender: jackhill@HIDDEN
To: bug-guix@HIDDEN
Subject: ghostscript shell scripts refer to unqualified external commands
Message-ID: <alpine.DEB.2.21.2109161121570.4243@HIDDEN>
User-Agent: Alpine 2.21 (DEB 202 2017-01-01)
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset=US-ASCII
Received-SPF: pass client-ip=104.248.1.95; envelope-from=jackhill@HIDDEN;
 helo=minsky.hcoop.net
X-Spam_score_int: -18
X-Spam_score: -1.9
X-Spam_bar: -
X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.4 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.4 (--)

Hi Guix,

Many of the commands, e.g. ps2pdf, provided by the ghostscript package are 
implemented as shell scripts that do some argument or file name processing 
before invoking the main gs binary. These scripts invoke external commands 
like basename, awk, dirname, and even gs by dynamically looking them up 
PATH. Instead, they should refer to a specific path in the store so that 
the behavior of ghostscript doesn't depend on the environment and so that 
Guix can see these references.

Best,
Jack




Acknowledgement sent to Jack Hill <jackhill@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-guix@HIDDEN. Full text available.
Report forwarded to bug-guix@HIDDEN:
bug#50625; Package guix. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 17 Sep 2021 15:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.