GNU bug report logs - #29856
[PATCH core-updates] guix: python-build-system: Modify ".py" files in-place.

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-patches; Reported by: Danny Milosavljevic <dannym@HIDDEN>; Keywords: wontfix patch; Done: Ricardo Wurmus <rekado@HIDDEN>; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at 29856-done <at> debbugs.gnu.org:


Received: (at 29856-done) by debbugs.gnu.org; 4 Feb 2019 07:58:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Feb 04 02:58:39 2019
Received: from localhost ([127.0.0.1]:58044 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gqZ9L-000082-4n
	for submit <at> debbugs.gnu.org; Mon, 04 Feb 2019 02:58:39 -0500
Received: from sender-of-o51.zoho.com ([135.84.80.216]:21011)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rekado@HIDDEN>) id 1gqZ9J-00007s-60
 for 29856-done <at> debbugs.gnu.org; Mon, 04 Feb 2019 02:58:37 -0500
ARC-Seal: i=1; a=rsa-sha256; t=1549267105; cv=none; d=zoho.com; s=zohoarc; 
 b=QxoMXM+H3bytFtZ0WuU8kMFK5fSCKp9aimBI0vFCuS92HoAEUGC2qWo1/aj0hmW3yv/cjvE9kcJngVHDSguOWwK71KLAPO/o6PPKx5Y+VrWgReB0ARLx8GnmBCMa1RWUIHDg0TjYhGeoR40loWmcaDOP8SgmxSHTcez/iycVugA=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com;
 s=zohoarc; t=1549267105;
 h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To:ARC-Authentication-Results;
 bh=f3GPlHqsLdkF065mn4gyIdudsewFEorAFeP76KAtlyI=; 
 b=HcUrRx1Ogm0TA38cajLQaQ4PpqO19YaRgaobwqOmq9LoHVxTsuuGIXQuYn3UjGQzKAcaYmkjNh1vOfe95jnIcocM6F17KUkCEtdh5QehfmmzP3PEYfvVzFOI24BRv5D7zwTAmprCstX6cTfI+Th5dBQ3TL932yFjZTX52vtTOIo=
ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass  header.i=elephly.net;
 spf=pass  smtp.mailfrom=rekado@HIDDEN;
 dmarc=pass header.from=<rekado@HIDDEN> header.from=<rekado@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1549267105; 
 s=zoho; d=elephly.net; i=rekado@HIDDEN;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding;
 l=979; bh=f3GPlHqsLdkF065mn4gyIdudsewFEorAFeP76KAtlyI=;
 b=MMAu7YMV9j9Qy+BK5xFeHgTyT/ctzRxWuqPJ9A+C00CtCe04hc9lSSd5f6G2CTTP
 5Sbz43eDyMsS3rKtT6az3S7pLTF65sIy8SNbAG+r2QcUE1ZwZ8ExzHwxq7w3pfbpf4U
 4J3JUpwWaYabNjlk/Nw6PinoIkYqWgXP+t7nn0Hw=
Received: from localhost (252.139-78-194.adsl-static.isp.belgacom.be
 [194.78.139.252]) by mx.zohomail.com
 with SMTPS id 154926710429386.88489068186641;
 Sun, 3 Feb 2019 23:58:24 -0800 (PST)
From: Ricardo Wurmus <rekado@HIDDEN>
To: Danny Milosavljevic <dannym@HIDDEN>
Subject: Re: [bug#29856] [PATCH core-updates] guix: python-build-system:,
 Modify ".py" files in-place.
References: <86b45cc4-f8ef-95da-87f7-397db19c424e@HIDDEN>
 <20180102182627.16566e3c@HIDDEN>
Date: Mon, 04 Feb 2019 08:58:21 +0100
In-Reply-To: <20180102182627.16566e3c@HIDDEN> (Danny Milosavljevic's
 message of "Tue, 2 Jan 2018 18:26:27 +0100")
Message-ID: <87pns8htnm.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-ZohoMailClient: External
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 29856-done
Cc: Hartmut Goebel <h.goebel@HIDDEN>,
 Marius Bakke <mbakke@HIDDEN>, 29856-done <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 (-)

Danny Milosavljevic <dannym@HIDDEN> writes:
>
> On Tue, 2 Jan 2018 17:13:15 +0100
> Hartmut Goebel <h.goebel@HIDDEN> wrote:
>
>>   * it kills "from __future__ import", which must be the first import
>>     statement (or even the first statement after any doc-string) to work.
>
> ... oops.
>
>> Thus I suggest aiming to implement the solution discussed in that thread
>> (see esp.
>> <https://lists.gnu.org/archive/html/guix-devel/2017-11/msg00041.html>.
>
> I like that approach. Nice...
>
>> Beside of this, the patch suffers from some more issues. Sorry to say :-(
>>=20
>>   * When converting PYTHONPATH into a list of python strings, these need
>>     to be quoted properly.
>
> I agree.
>
>>   * The description (commit-message) of the patch is much to terse. It
>>     should describe the the reason and implications. Esp. it should
>>     describe the case this is fixing.
>
> Sure.

I=E2=80=99m closing this in favour of #29951.

Thanks!





Notification sent to Danny Milosavljevic <dannym@HIDDEN>:
bug acknowledged by developer. Full text available.
Reply sent to Ricardo Wurmus <rekado@HIDDEN>:
You have taken responsibility. Full text available.
Added tag(s) wontfix. Request was from Ricardo Wurmus <rekado@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

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


Received: (at 29856) by debbugs.gnu.org; 2 Jan 2018 17:26:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 02 12:26:33 2018
Received: from localhost ([127.0.0.1]:33384 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eWQKf-0002d9-Ji
	for submit <at> debbugs.gnu.org; Tue, 02 Jan 2018 12:26:33 -0500
Received: from dd26836.kasserver.com ([85.13.145.193]:51656)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dannym@HIDDEN>) id 1eWQKd-0002d1-HV
 for 29856 <at> debbugs.gnu.org; Tue, 02 Jan 2018 12:26:32 -0500
Received: from localhost (178.113.223.176.wireless.dyn.drei.com
 [178.113.223.176])
 by dd26836.kasserver.com (Postfix) with ESMTPSA id 6F69733601D1;
 Tue,  2 Jan 2018 18:26:30 +0100 (CET)
Date: Tue, 2 Jan 2018 18:26:27 +0100
From: Danny Milosavljevic <dannym@HIDDEN>
To: Hartmut Goebel <h.goebel@HIDDEN>
Subject: Re: [bug#29856] [PATCH core-updates] guix: python-build-system:,
 Modify ".py" files in-place.
Message-ID: <20180102182627.16566e3c@HIDDEN>
In-Reply-To: <86b45cc4-f8ef-95da-87f7-397db19c424e@HIDDEN>
References: <86b45cc4-f8ef-95da-87f7-397db19c424e@HIDDEN>
X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.31; x86_64-unknown-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 29856
Cc: Marius Bakke <mbakke@HIDDEN>, 29856 <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: -0.7 (/)

Hi Hartmut,

thanks for the review!

On Tue, 2 Jan 2018 17:13:15 +0100
Hartmut Goebel <h.goebel@HIDDEN> wrote:

>   * it kills "from __future__ import", which must be the first import
>     statement (or even the first statement after any doc-string) to work.

... oops.

> Thus I suggest aiming to implement the solution discussed in that thread
> (see esp.
> <https://lists.gnu.org/archive/html/guix-devel/2017-11/msg00041.html>.

I like that approach. Nice...

> Beside of this, the patch suffers from some more issues. Sorry to say :-(
> 
>   * When converting PYTHONPATH into a list of python strings, these need
>     to be quoted properly.

I agree.

>   * The description (commit-message) of the patch is much to terse. It
>     should describe the the reason and implications. Esp. it should
>     describe the case this is fixing.

Sure.




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

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


Received: (at 29856) by debbugs.gnu.org; 2 Jan 2018 16:13:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 02 11:13:19 2018
Received: from localhost ([127.0.0.1]:33316 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eWPBn-0000vP-Gy
	for submit <at> debbugs.gnu.org; Tue, 02 Jan 2018 11:13:19 -0500
Received: from mail-out.m-online.net ([212.18.0.9]:54145)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <h.goebel@HIDDEN>) id 1eWPBl-0000vH-Up
 for 29856 <at> debbugs.gnu.org; Tue, 02 Jan 2018 11:13:18 -0500
Received: from frontend01.mail.m-online.net (unknown [192.168.8.182])
 by mail-out.m-online.net (Postfix) with ESMTP id 3z9zcs1cZWz1qrNW;
 Tue,  2 Jan 2018 17:13:17 +0100 (CET)
Received: from localhost (dynscan1.mnet-online.de [192.168.6.70])
 by mail.m-online.net (Postfix) with ESMTP id 3z9zcs1CvCz26T2C;
 Tue,  2 Jan 2018 17:13:17 +0100 (CET)
X-Virus-Scanned: amavisd-new at mnet-online.de
Received: from mail.mnet-online.de ([192.168.8.182])
 by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new,
 port 10024)
 with ESMTP id HjnbfoKkq_7r; Tue,  2 Jan 2018 17:13:16 +0100 (CET)
Received: from hermia.goebel-consult.de
 (ppp-93-104-162-253.dynamic.mnet-online.de [93.104.162.253])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mail.mnet-online.de (Postfix) with ESMTPS;
 Tue,  2 Jan 2018 17:13:16 +0100 (CET)
Received: from [192.168.110.2] (lenashee.goebel-consult.de [192.168.110.2])
 by hermia.goebel-consult.de (Postfix) with ESMTP id A83FC607A8;
 Tue,  2 Jan 2018 17:13:15 +0100 (CET)
From: Hartmut Goebel <h.goebel@HIDDEN>
Subject: Re: [bug#29856] [PATCH core-updates] guix: python-build-system:,
 Modify ".py" files in-place.
To: 29856 <at> debbugs.gnu.org
Organization: crazy-compilers.com
Message-ID: <86b45cc4-f8ef-95da-87f7-397db19c424e@HIDDEN>
Date: Tue, 2 Jan 2018 17:13:15 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
 Thunderbird/52.5.2
MIME-Version: 1.0
Content-Type: multipart/alternative;
 boundary="------------6A65D42712545950E5BBC99D"
Content-Language: en-US
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 29856
Cc: Danny Milosavljevic <dannym@HIDDEN>,
 Marius Bakke <mbakke@HIDDEN>
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: -0.7 (/)

This is a multi-part message in MIME format.
--------------6A65D42712545950E5BBC99D
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hi,

I'm afraid, this patch will lead to quite some serious problems:

  * It "kills" the doc-string, which must be the very first
    expression-statement in the program. This might be rarely used, but
  * it kills "from __future__ import", which must be the first import
    statement (or even the first statement after any doc-string) to work.=


Fixing these issues would require to implement a language-aware scanner,
as discussed in
<https://lists.gnu.org/archive/html/guix-devel/2017-11/msg00022.html>.

Thus I suggest aiming to implement the solution discussed in that thread
(see esp.
<https://lists.gnu.org/archive/html/guix-devel/2017-11/msg00041.html>.

Beside of this, the patch suffers from some more issues. Sorry to say :-(=


  * When converting PYTHONPATH into a list of python strings, these need
    to be quoted properly.
  * The description (commit-message) of the patch is much to terse. It
    should describe the the reason and implications. Esp. it should
    describe the case this is fixing.

BTW: The first analysis in <https://bugs.gnu.org/29824> was misleading.
I commented there.

--=20
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel@HIDDEN               |
| www.crazy-compilers.com | compilers which you thought are impossible |


--------------6A65D42712545950E5BBC99D
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 8bit

<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Hi,</p>
    <p>I'm afraid, this patch will lead to quite some serious problems:</p>
    <ul>
      <li>It "kills" the doc-string, which must be the very first
        expression-statement in the program. This might be rarely used,
        but <br>
      </li>
      <li>it kills "from __future__ import", which must be the first
        import statement (or even the first statement after any
        doc-string) to work.</li>
    </ul>
    <p>Fixing these issues would require to implement a language-aware
      scanner, as discussed in
<a class="moz-txt-link-rfc2396E" href="https://lists.gnu.org/archive/html/guix-devel/2017-11/msg00022.html">&lt;https://lists.gnu.org/archive/html/guix-devel/2017-11/msg00022.html&gt;</a>.<br>
    </p>
    <p>Thus I suggest aiming to implement the solution discussed in that
      thread (see esp.
<a class="moz-txt-link-rfc2396E" href="https://lists.gnu.org/archive/html/guix-devel/2017-11/msg00041.html">&lt;https://lists.gnu.org/archive/html/guix-devel/2017-11/msg00041.html&gt;</a>.</p>
    <p>Beside of this, the patch suffers from some more issues. Sorry to
      say :-(</p>
    <ul>
      <li>When converting PYTHONPATH into a list of python strings,
        these need to be quoted properly.</li>
      <li>The description (commit-message) of the patch is much to
        terse. It should describe the the reason and implications. Esp.
        it should describe the case this is fixing.</li>
    </ul>
    <p>BTW: The first analysis in &lt;<a
        href="https://bugs.gnu.org/29824">https://bugs.gnu.org/29824</a>&gt;
      was misleading. I commented there.<br>
    </p>
    <ul>
    </ul>
    <pre class="moz-signature" cols="72">-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | <a class="moz-txt-link-abbreviated" href="mailto:h.goebel@HIDDEN">h.goebel@HIDDEN</a>               |
| <a class="moz-txt-link-abbreviated" href="http://www.crazy-compilers.com">www.crazy-compilers.com</a> | compilers which you thought are impossible |
</pre>
  </body>
</html>

--------------6A65D42712545950E5BBC99D--




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

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


Received: (at 29856) by debbugs.gnu.org; 31 Dec 2017 17:18:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Dec 31 12:18:03 2017
Received: from localhost ([127.0.0.1]:58945 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eVhFK-0002nX-Td
	for submit <at> debbugs.gnu.org; Sun, 31 Dec 2017 12:18:03 -0500
Received: from dd26836.kasserver.com ([85.13.145.193]:50188)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dannym@HIDDEN>) id 1eVhFI-0002n7-Vh
 for 29856 <at> debbugs.gnu.org; Sun, 31 Dec 2017 12:18:01 -0500
Received: from localhost (178.113.228.174.wireless.dyn.drei.com
 [178.113.228.174])
 by dd26836.kasserver.com (Postfix) with ESMTPSA id 3E2EA33601F3;
 Sun, 31 Dec 2017 18:17:59 +0100 (CET)
Date: Sun, 31 Dec 2017 18:17:55 +0100
From: Danny Milosavljevic <dannym@HIDDEN>
To: Marius Bakke <mbakke@HIDDEN>
Subject: Re: [bug#29856] [PATCH core-updates] guix: python-build-system:
 Modify ".py" files in-place.
Message-ID: <20171231181755.7fe64e7e@HIDDEN>
In-Reply-To: <87d12vaqk9.fsf@HIDDEN>
References: <20171226122105.19156-1-dannym@HIDDEN>
 <20171226191013.GE1413@HIDDEN>
 <20171227012326.5aa8a762@HIDDEN>
 <87d12vaqk9.fsf@HIDDEN>
X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.31; x86_64-unknown-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 29856
Cc: 29856 <at> debbugs.gnu.org, Leo Famulari <leo@HIDDEN>
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: -0.7 (/)

Hi Marius,

On Sun, 31 Dec 2017 16:02:30 +0100
Marius Bakke <mbakke@HIDDEN> wrote:

> I wonder if this will fix <https://bugs.gnu.org/29824>.  "meson" is not
> installed with a .py extension

That bugreport sounds as if the searched-for program is "meson.py".  But I tried to install meson while having 29856 applied.  Doesn't work.

>, but I guess we can call wrap-program* on it.

If you made sure the original wrapping thing didn't run, yeah.  That's why I did such an intrusive fix in the first place.

> Would it work to peek at the shebang instead of the file extension?

Probably, but I wanted it to be dead easy for core-updates.

Not sure whether, if we examined the content, there would be any false positives, empty files, dangling symlinks, special files etc which would need special handling.  Every change there rebuilds for several hours on my machine, so I'd like a sure-to-work block even when testing :)




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

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


Received: (at 29856) by debbugs.gnu.org; 31 Dec 2017 15:02:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Dec 31 10:02:34 2017
Received: from localhost ([127.0.0.1]:58867 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eVf8E-00080G-DO
	for submit <at> debbugs.gnu.org; Sun, 31 Dec 2017 10:02:34 -0500
Received: from out2-smtp.messagingengine.com ([66.111.4.26]:41341)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mbakke@HIDDEN>) id 1eVf8C-000807-IS
 for 29856 <at> debbugs.gnu.org; Sun, 31 Dec 2017 10:02:32 -0500
Received: from compute5.internal (compute5.nyi.internal [10.202.2.45])
 by mailout.nyi.internal (Postfix) with ESMTP id 2F16A21A8A;
 Sun, 31 Dec 2017 10:02:32 -0500 (EST)
Received: from frontend1 ([10.202.2.160])
 by compute5.internal (MEProxy); Sun, 31 Dec 2017 10:02:32 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h=
 cc:content-type:date:from:in-reply-to:message-id:mime-version
 :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=
 fm1; bh=0MYYecyk+vU1UacNdqUKrku6ViqgZJZFmkjKyv473bg=; b=yMYjMeBj
 1zIGTDyAQRqeO73VAe4LvxA5iHY3h6g4pBXS11vlHWIhBEvA6Y5CLACgtlb9iakS
 csKJNY+bThsGZ6r7FIohjVxPVapO04w7gwpvwE8TTNVJGhQ242PGMOGZxBWMgBNY
 hS9156ujHcaofDeBgDChq1XB4HBK58Rp4ZOb+s1LFRR+yUAWG5uGm3INRr56vkd3
 lmSm1ELMq+OFofodDyjddOb/YWfS3tx8jrZCXqrU45SdD0TmiOxq7JrQjMPkqyNy
 MVZwlmKs5qwgakHYyMyNqADitjYxWTcikoyLqYgALWr2vxFslyuGcY4wqpM8TFyf
 22LAT9sO2HxqQg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-type:date:from:in-reply-to
 :message-id:mime-version:references:subject:to:x-me-sender
 :x-me-sender:x-sasl-enc; s=fm1; bh=0MYYecyk+vU1UacNdqUKrku6ViqgZ
 JZFmkjKyv473bg=; b=jtm5EpxbOSbQJhYFI5JCtnXcl0XxBRE8K/ZC+L0M9sEhA
 2E1M4jgUdGOH6tAezrVl1hwKQ3pWF80dGt7BbGaZwtyqFnnUJSYeE7Ow80oVzDBn
 2Byxo73IgcVvJpfs/b59jUF8Dlh8tn9zR835xAjWnhUp1Wdm7inpLGZtNXnFjt63
 p4TKF0w3X4ocMzq4WhltzeuKVwQGfI+rkbeo2lI77sIODMZH3l6UPekzucZa9RLu
 FUJb91Nb98Y8oD0T9Eullh+AWA3iEzvd01dawewhzm+V0vqQ8DI+eRkipZMmRvLI
 jJiYtX899BHj1b6TsykjyvNigZnw4e6x92fs9h7Aw==
X-ME-Sender: <xms:CPxIWsUTgj5hbBKQ4rjkr1jMgtjDQqZcDI0JDxgJ8YkA6zMd9goj1A>
Received: from localhost (cm-84.214.173.174.getinternet.no [84.214.173.174])
 by mail.messagingengine.com (Postfix) with ESMTPA id A7CFA7E31F;
 Sun, 31 Dec 2017 10:02:31 -0500 (EST)
From: Marius Bakke <mbakke@HIDDEN>
To: Danny Milosavljevic <dannym@HIDDEN>,
 Leo Famulari <leo@HIDDEN>
Subject: Re: [bug#29856] [PATCH core-updates] guix: python-build-system:
 Modify	".py" files in-place.
In-Reply-To: <20171227012326.5aa8a762@HIDDEN>
References: <20171226122105.19156-1-dannym@HIDDEN>
 <20171226191013.GE1413@HIDDEN> <20171227012326.5aa8a762@HIDDEN>
User-Agent: Notmuch/0.25.3 (https://notmuchmail.org) Emacs/25.3.1
 (x86_64-pc-linux-gnu)
Date: Sun, 31 Dec 2017 16:02:30 +0100
Message-ID: <87d12vaqk9.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha512; protocol="application/pgp-signature"
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 29856
Cc: 29856 <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: -0.7 (/)

--=-=-=
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

Danny Milosavljevic <dannym@HIDDEN> writes:

> On Tue, 26 Dec 2017 14:10:13 -0500
> Leo Famulari <leo@HIDDEN> wrote:
>
>> On Tue, Dec 26, 2017 at 01:21:05PM +0100, Danny Milosavljevic wrote:
>> > * guix/build/python-build-system.scm (wrap-python-program): New variab=
le.
>> > (wrap-program*): New variable.
>> > (wrap): Use wrap-program*.=20=20
>>=20
>> The idea here is to avoid renaming the Python executables to .foo-real,
>> right?
>
> Yes, especially since Python itself sometimes imports those and then it's=
 tripping over the bash script when it expected a Python script.

I wonder if this will fix <https://bugs.gnu.org/29824>.  "meson" is not
installed with a .py extension, but I guess we can call wrap-program*
on it.

Would it work to peek at the shebang instead of the file extension?

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAlpI/AYACgkQoqBt8qM6
VPrrHQf+KiR+FFQjWUMT1Klcqz+LzuZehrNcUwxFUeBapTRPn8IlZKo47EMD09Lb
v2N6ODeE2F8A4+xX35PrD0dZTTnHNGpSmYoePMO6SyPI0GHq6cAMsXASpWKPQJDy
cB3QsN4MG7IBhmIPf22VKESudzuLHBOZmmuG5CLYo6dfFdYhcj6chh6I6wDvqOoc
oxcxbfwyjKI058TIFaQb4OYFfam5LkAtKmm5epQ351ttKPpD8e29aOkpV4WpzN6G
v7qHClHE3+p/caNSTYAxAKVlUBI1a06poea1imUU6XR6eVpAqdgT+5OgGzT+y+rk
Fw8M4naroPxuRkbobfc0qUd8YVmAiw==
=unNI
-----END PGP SIGNATURE-----
--=-=-=--




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

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


Received: (at 29856) by debbugs.gnu.org; 27 Dec 2017 00:23:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Dec 26 19:23:32 2017
Received: from localhost ([127.0.0.1]:52997 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eTzVM-0005mF-68
	for submit <at> debbugs.gnu.org; Tue, 26 Dec 2017 19:23:32 -0500
Received: from dd26836.kasserver.com ([85.13.145.193]:36696)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dannym@HIDDEN>) id 1eTzVK-0005m7-8L
 for 29856 <at> debbugs.gnu.org; Tue, 26 Dec 2017 19:23:30 -0500
Received: from localhost (77.118.177.251.wireless.dyn.drei.com
 [77.118.177.251])
 by dd26836.kasserver.com (Postfix) with ESMTPSA id 60FA833602A0;
 Wed, 27 Dec 2017 01:23:28 +0100 (CET)
Date: Wed, 27 Dec 2017 01:23:26 +0100
From: Danny Milosavljevic <dannym@HIDDEN>
To: Leo Famulari <leo@HIDDEN>
Subject: Re: [bug#29856] [PATCH core-updates] guix: python-build-system:
 Modify ".py" files in-place.
Message-ID: <20171227012326.5aa8a762@HIDDEN>
In-Reply-To: <20171226191013.GE1413@HIDDEN>
References: <20171226122105.19156-1-dannym@HIDDEN>
 <20171226191013.GE1413@HIDDEN>
X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.31; x86_64-unknown-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 29856
Cc: 29856 <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: -0.7 (/)

On Tue, 26 Dec 2017 14:10:13 -0500
Leo Famulari <leo@HIDDEN> wrote:

> On Tue, Dec 26, 2017 at 01:21:05PM +0100, Danny Milosavljevic wrote:
> > * guix/build/python-build-system.scm (wrap-python-program): New variable.
> > (wrap-program*): New variable.
> > (wrap): Use wrap-program*.  
> 
> The idea here is to avoid renaming the Python executables to .foo-real,
> right?

Yes, especially since Python itself sometimes imports those and then it's tripping over the bash script when it expected a Python script.




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

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


Received: (at 29856) by debbugs.gnu.org; 26 Dec 2017 19:10:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Dec 26 14:10:17 2017
Received: from localhost ([127.0.0.1]:52892 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eTucC-0004oU-UL
	for submit <at> debbugs.gnu.org; Tue, 26 Dec 2017 14:10:17 -0500
Received: from out2-smtp.messagingengine.com ([66.111.4.26]:46475)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <leo@HIDDEN>) id 1eTucA-0004oJ-M8
 for 29856 <at> debbugs.gnu.org; Tue, 26 Dec 2017 14:10:14 -0500
Received: from compute4.internal (compute4.nyi.internal [10.202.2.44])
 by mailout.nyi.internal (Postfix) with ESMTP id 8CC2720F6D;
 Tue, 26 Dec 2017 14:10:14 -0500 (EST)
Received: from frontend2 ([10.202.2.161])
 by compute4.internal (MEProxy); Tue, 26 Dec 2017 14:10:14 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=famulari.name;
 h=cc:content-type:date:from:in-reply-to:message-id:mime-version
 :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=
 mesmtp; bh=feZoO8LLMsqyTPoT8W4P6tsoKOUeYaI0jzdr94hNRWo=; b=obvFR
 ReigQtfJJPngp2yMRG5/UnxtpD7wGynySURi3OwFU1M+BTmcHxaPVgam5jku8xGy
 WMSCeQzrUitoF5x7at4hBbehjmKHW677KWRzmuDrQ9kDUxOoS4Gu90jw4pWlm9Pg
 rvQ8DPPdsS/pDAU7p0qKbKWCyflTBxrGJ1KdGc=
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-type:date:from:in-reply-to
 :message-id:mime-version:references:subject:to:x-me-sender
 :x-me-sender:x-sasl-enc; s=fm1; bh=feZoO8LLMsqyTPoT8W4P6tsoKOUeY
 aI0jzdr94hNRWo=; b=I+CQIB008GMzP8zcYHBjbOZqau9RoSfozLAcv2pd0WBev
 3NcLNgtYLnUDP/jWO2mzP1q+WSFdXaj/F5lsrC1R6jiqvrb0O1Z4HU+Uk/t+cl0p
 e4mxrBgAy3PL6p8R8V8zCqzVs9zqtViCXjPBY7fLmKgW0yIbjrDBuU2DPZxYLWnr
 gcfKrX3ckF9WrQrce1jDjO7Met49bwotqmY0lLiQq7Umwj0TEe9Yif6nBkFk6eli
 I8IboSkgD42GDmW983Zm9xBNB0/pw3cP03cGC0iwQWcouJYqLMT7sQcmz/g0Tfru
 988ZycSZb5ev5CG9ISfabI8bxpvskMLxXhl7HJmdg==
X-ME-Sender: <xms:lp5CWk7ZywbmT3rXrlJrDIFvECXz7wPBlkz5hugRh6EIbt5BUihSEg>
Received: from localhost (c-76-109-243-109.hsd1.fl.comcast.net
 [76.109.243.109])
 by mail.messagingengine.com (Postfix) with ESMTPA id 42C9124447;
 Tue, 26 Dec 2017 14:10:14 -0500 (EST)
Date: Tue, 26 Dec 2017 14:10:13 -0500
From: Leo Famulari <leo@HIDDEN>
To: Danny Milosavljevic <dannym@HIDDEN>
Subject: Re: [bug#29856] [PATCH core-updates] guix: python-build-system:
 Modify ".py" files in-place.
Message-ID: <20171226191013.GE1413@HIDDEN>
References: <20171226122105.19156-1-dannym@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature"; boundary="lteA1dqeVaWQ9QQl"
Content-Disposition: inline
In-Reply-To: <20171226122105.19156-1-dannym@HIDDEN>
User-Agent: Mutt/1.9.2 (2017-12-15)
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 29856
Cc: 29856 <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: -0.7 (/)


--lteA1dqeVaWQ9QQl
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Tue, Dec 26, 2017 at 01:21:05PM +0100, Danny Milosavljevic wrote:
> * guix/build/python-build-system.scm (wrap-python-program): New variable.
> (wrap-program*): New variable.
> (wrap): Use wrap-program*.

The idea here is to avoid renaming the Python executables to .foo-real,
right?

--lteA1dqeVaWQ9QQl
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEsFFZSPHn08G5gDigJkb6MLrKfwgFAlpCnpUACgkQJkb6MLrK
fwh7vw/8C8gRrXHE1ziXAB4mAn2EgJp12DvRXOoS4VUE6UjPp2dC9hd+jqjbEmbq
PV2JnGUiCyIz4I5Umk5Vxd3NdsuNeozJSHsWRVMLhsrtq+lBi8mc0XPFkWvPVPhx
YVKSHyE/urFwxTu6pyqtmKVRIJWdffWNpPL8iVP7x0OsjC/SgQ3ztfjpbctzLWEJ
a4KbSMvwY8PcDKqh+hKLrMC+BgnM86Gadj+dpyDzaI8jhMPaX50z/T6emiGS0JeH
ntlgl7zX36JjwBBSR8sczgaYjkAZTM3Vfxwnsdi/Tqil9MHI4DVwCcDfA3VPov5o
mnGWX0U+jDghmshe+5RjU/rNoQRHIeM9T9VA8wCyKKDJu25mTMzjOiff8ln2vnJL
Tr0nDBUC9OT3XTWVtGbCxVSbbxR+1K4YdimO+qxtynAheqL2VjKTvdZ9dGUwFObO
BMuqYYKymPoMjPfqSs35oGUUC9HT4xEtzwTvVIY6rh5y5dV6FVz0zTWngggTrBDr
9YlQxIap8+OoUYMuVakO6rddFzPAE0cYFItuuspriY/7Bxp5lVhmCqbL06jQJQyg
4y76TVFVGQZH/e6QLv3Yz6tx6PWjtoF1Suy+G/ef+5CqKau8qfA8B5RY1E1ErD+r
I/rcdaw7YOrY6ujy9YBhZTFPOa+BMH/VYcqWu/gorUQMQLBesLI=
=aE4o
-----END PGP SIGNATURE-----

--lteA1dqeVaWQ9QQl--




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

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


Received: (at submit) by debbugs.gnu.org; 26 Dec 2017 12:21:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Dec 26 07:21:22 2017
Received: from localhost ([127.0.0.1]:52421 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eToEU-0001VQ-15
	for submit <at> debbugs.gnu.org; Tue, 26 Dec 2017 07:21:22 -0500
Received: from eggs.gnu.org ([208.118.235.92]:52714)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dannym@HIDDEN>) id 1eToET-0001VD-2x
 for submit <at> debbugs.gnu.org; Tue, 26 Dec 2017 07:21:21 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <dannym@HIDDEN>) id 1eToEN-0003xW-5R
 for submit <at> debbugs.gnu.org; Tue, 26 Dec 2017 07:21:16 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled
 version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:55890)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <dannym@HIDDEN>)
 id 1eToEN-0003xQ-2F
 for submit <at> debbugs.gnu.org; Tue, 26 Dec 2017 07:21:15 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:43626)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <dannym@HIDDEN>) id 1eToEL-0007gF-Tf
 for guix-patches@HIDDEN; Tue, 26 Dec 2017 07:21:14 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <dannym@HIDDEN>) id 1eToEI-0003ug-MP
 for guix-patches@HIDDEN; Tue, 26 Dec 2017 07:21:13 -0500
Received: from dd26836.kasserver.com ([85.13.145.193]:40074)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <dannym@HIDDEN>)
 id 1eToEI-0003tg-GD
 for guix-patches@HIDDEN; Tue, 26 Dec 2017 07:21:10 -0500
Received: from dayas.3.home (77.118.177.251.wireless.dyn.drei.com
 [77.118.177.251])
 by dd26836.kasserver.com (Postfix) with ESMTPSA id 3C95E33601CF;
 Tue, 26 Dec 2017 13:21:08 +0100 (CET)
From: Danny Milosavljevic <dannym@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH core-updates] guix: python-build-system: Modify ".py" files
 in-place.
Date: Tue, 26 Dec 2017 13:21:05 +0100
Message-Id: <20171226122105.19156-1-dannym@HIDDEN>
X-Mailer: git-send-email 2.15.1
Tags: patch
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
 [fuzzy]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: submit
Cc: Danny Milosavljevic <dannym@HIDDEN>
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: -5.0 (-----)

* guix/build/python-build-system.scm (wrap-python-program): New variable.
(wrap-program*): New variable.
(wrap): Use wrap-program*.
---
 guix/build/python-build-system.scm | 29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/guix/build/python-build-system.scm b/guix/build/python-build-system.scm
index dd07986b9..f5f6b07f8 100644
--- a/guix/build/python-build-system.scm
+++ b/guix/build/python-build-system.scm
@@ -25,6 +25,7 @@
   #:use-module (guix build utils)
   #:use-module (ice-9 match)
   #:use-module (ice-9 ftw)
+  #:use-module (ice-9 rdelim)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-26)
   #:export (%standard-phases
@@ -184,6 +185,32 @@ when running checks after installing the package."
                          configure-flags)))
     (call-setuppy "install" params use-setuptools?)))
 
+(define (wrap-python-program file-name vars)
+  "Wrap the given program as a Python script (in-place)"
+  (match vars
+    (("PYTHONPATH" 'prefix python-path)
+     (let ((pythonish-path (string-join python-path "', '")))
+       (with-atomic-file-replacement file-name
+         (lambda (in out)
+           (display (format #f "#!~a
+import sys
+sys.path = ['~a'] + sys.path
+" (which "python") pythonish-path) out)
+           (let loop ((line (read-line in 'concat)))
+             (if (eof-object? line)
+               #t
+               (begin
+                 (display line out)
+                 (loop (read-line in 'concat)))))))))))
+
+(define (wrap-program* file-name vars)
+  "Wrap the given program.
+   If FILE-NAME is ending in '.py', wraps it in a Python way.
+   Otherwise wraps it in a Bash way."
+  (if (string-suffix? ".py" file-name)
+    (wrap-python-program file-name vars)
+    (wrap-program file-name vars)))
+
 (define* (wrap #:key inputs outputs #:allow-other-keys)
   (define (list-of-files dir)
     (map (cut string-append dir "/" <>)
@@ -209,7 +236,7 @@ when running checks after installing the package."
                         (or (getenv "PYTHONPATH") ""))))))
     (for-each (lambda (dir)
                 (let ((files (list-of-files dir)))
-                  (for-each (cut wrap-program <> var)
+                  (for-each (cut wrap-program* <> var)
                             files)))
               bindirs)))
 




Acknowledgement sent to Danny Milosavljevic <dannym@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#29856; Package guix-patches. 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: Mon, 4 Feb 2019 08:00:02 UTC

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