Message ID | 87bmz5ih9u.fsf@ike.i-did-not-set--mail-host-address--so-tickle-me |
---|---|
State | New |
Headers |
Received: (qmail 29159 invoked by uid 89); 30 Sep 2016 14:47:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.2 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.9 required=5.0 tests=BAYES_00, FREEMAIL_FROM, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=H*F:D*fastmail.com, Perhaps, sk:single, sk:single- X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00, FREEMAIL_FROM, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: lists.gnu.org Received: from lists.gnu.org (HELO lists.gnu.org) (208.118.235.17) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 30 Sep 2016 14:47:08 +0000 Received: from localhost ([::1]:44987 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <guix-devel-bounces+patchwork=sourceware.org@gnu.org>) id 1bpz5e-0004bk-4y for patchwork@sourceware.org; Fri, 30 Sep 2016 10:47:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46710) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <mbakke@fastmail.com>) id 1bpyyK-0007AC-GS for guix-devel@gnu.org; Fri, 30 Sep 2016 10:39:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <mbakke@fastmail.com>) id 1bpyyG-0006Ca-3J for guix-devel@gnu.org; Fri, 30 Sep 2016 10:39:32 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:48830) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <mbakke@fastmail.com>) id 1bpyyD-00065s-MS for guix-devel@gnu.org; Fri, 30 Sep 2016 10:39:28 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 58F982104A; Fri, 30 Sep 2016 10:39:17 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute4.internal (MEProxy); Fri, 30 Sep 2016 10:39:17 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.com; h= content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=xb9Ao Zlduy0/dSrP4w9aDtIa4ZQ=; b=O/X24PCZpzsOuFKcGzm+9jqSNi8131mm4Qx4v lbxJW0qoAsSD1s2QRgDVJKm/R2mXChWyf70mHP7dWuYT6ZKWzlNI9xY6nq0Flx/v 0gZV7z36fMZMyyiG50WNgqVuZxaCbHLvIKZkcmaGSDXPZmhosiMs9Jt5f2q6V7sV H8N+FI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=xb9AoZlduy0/dSrP4w9aDtIa4ZQ=; b=Txod7 qc7d+mHaDQrQWITmPpaplRuCbaRiHRt/G/t3Hj09kDqkzP9yJoMyObpxCxhUwAYt d4UcAO9Fz5sitHgahnkvKk5B6b2rpy2AQGM0G1mOj0d7MBo/68PxGsh/jRFabKRW Laj6mIUxR+R3Ai+iLK4sOB1F28A5TsU2N7WwKI= X-Sasl-enc: cNj0QAfb2YuGkuPC10M3zGizHpw38vkSv35xz885WLnk 1475246357 Received: from localhost (238-36.wifi.nat.warwick.ac.uk [137.205.238.36]) by mail.messagingengine.com (Postfix) with ESMTPA id F40F6F29D1; Fri, 30 Sep 2016 10:39:16 -0400 (EDT) From: Marius Bakke <mbakke@fastmail.com> To: Hartmut Goebel <h.goebel@crazy-compilers.com>, guix-devel@gnu.org Subject: Re: [PATCH 00/14] Change python-build-system (fixes bug 20765) In-Reply-To: <57EC008A.4030006@crazy-compilers.com> References: <1475071107-10765-1-git-send-email-h.goebel@crazy-compilers.com> <57EBCD98.9020407@goebel-consult.de> <87mvism34v.fsf@ike.i-did-not-set--mail-host-address--so-tickle-me> <57EC008A.4030006@crazy-compilers.com> Date: Fri, 30 Sep 2016 15:39:09 +0100 Message-ID: <87bmz5ih9u.fsf@ike.i-did-not-set--mail-host-address--so-tickle-me> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.111.4.25 X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." <guix-devel.gnu.org> List-Unsubscribe: <https://lists.gnu.org/mailman/options/guix-devel>, <mailto:guix-devel-request@gnu.org?subject=unsubscribe> List-Archive: <http://lists.gnu.org/archive/html/guix-devel/> List-Post: <mailto:guix-devel@gnu.org> List-Help: <mailto:guix-devel-request@gnu.org?subject=help> List-Subscribe: <https://lists.gnu.org/mailman/listinfo/guix-devel>, <mailto:guix-devel-request@gnu.org?subject=subscribe> Errors-To: guix-devel-bounces+patchwork=sourceware.org@gnu.org Sender: "Guix-devel" <guix-devel-bounces+patchwork=sourceware.org@gnu.org> |
Commit Message
Marius Bakke
Sept. 30, 2016, 2:39 p.m. UTC
Hartmut Goebel <h.goebel@crazy-compilers.com> writes: > Am 28.09.2016 um 17:54 schrieb Marius Bakke: >> Or push a branch somewhere? > > Branch is now available at > <https://gitlab.com/htgoebel/guix/tree/python-build-system> Thanks a lot for doing this! After adding a couple of patches I'm able to build many python packages. Patch #2 mostly emulates NixOS "shim" setup.py[0], required for packages using distutils instead of setuptools. Some packages really don't like the new configure flags however (scons). Perhaps we should have them as default, but if #:configure-flags is set, let them be overridden? Also some packages are missing a dependency on "python-py"[1]. Perhaps we can set up a Hydra channel to deal with the fallout? Cheers, Marius 0: https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/interpreters/python/run_setup.py 1: https://pypi.python.org/pypi/py/1.4.31
Comments
Am 30.09.2016 um 16:39 schrieb Marius Bakke: > After adding a couple of patches I'm able to build many python packages. Thanks for sharing. Sorry that you need #1 at all. I should have tested my code another time prior to posting the patch. > Patch #2 mostly emulates NixOS "shim" setup.py[0], required for packages > using distutils instead of setuptools. We should use the same code here pip uses [1,2], which is: "import setuptools, tokenize;__file__=%r;" "exec(compile(getattr(tokenize, 'open', open)(__file__).read()" ".replace('\\r\\n', '\\n'), __file__, 'exec'))" % self.setup_py The main difference to your code is the use of token.open (Open a file in read only mode using the encoding detected by detect_encoding() [3]) which we should use. Otherwise we will get encoding errors somewhen. [1] https://github.com/pypa/pip/blob/8.1.2/pip/utils/setuptools_build.py [2] https://github.com/pypa/pip/blob/8.1.2/pip/req/req_install.py#L849 [3] https://docs.python.org/3/library/tokenize.html#tokenize.open > Some packages really don't like the new configure flags however (scons). > Perhaps we should have them as default, but if #:configure-flags is set, > let them be overridden? Uff, this tricked me. I digged into scons and found it is redefining the commands, much like setuptools do. For scons we could change the setup.py, but where for sure are other packages having the same problem. And there *may* be packages witch are incompatible with setuptools, too (even if they should not). I'm twofold regarding the behaviour of #:configure-flag. Emptying them as soon as one passes some options flags is different to what other builders are doing. E.g. gnu-build-system *adds* any option passed. So a somewhat better solution would be to put --single-version-external-managed and --root into the default config-flags. But then if one needs to add options, this will become complicated. What about adding a flag #;use-setuptools, which defaults to #t? > Also some packages are missing a dependency on "python-py"[1]. This is very curious, since python-setuptools does not have python-py as input nor does it contain this package. Can you give an example please? > Perhaps we can set up a Hydra channel to deal with the fallout? Tonight Leo wrote that he will set up one.
Hi,
Am 02.10.2016 um 11:05 schrieb Hartmut Goebel:
> What about adding a flag #;use-setuptools, which defaults to #t?
I just pushed to <https://gitlab.com/htgoebel/guix/tree/python-build-system>
- Marius' changes
- updated shim-code
- Add option "#:use-setuptools?" (default true).
- Fix for scons (as an example)
git fetch https://gitlab.com/htgoebel/guix.git python-build-system
Hi! Marius Bakke <mbakke@fastmail.com> skribis: > Hartmut Goebel <h.goebel@crazy-compilers.com> writes: > >> Am 28.09.2016 um 17:54 schrieb Marius Bakke: >>> Or push a branch somewhere? >> >> Branch is now available at >> <https://gitlab.com/htgoebel/guix/tree/python-build-system> > > Thanks a lot for doing this! > > After adding a couple of patches I'm able to build many python packages. > Patch #2 mostly emulates NixOS "shim" setup.py[0], required for packages > using distutils instead of setuptools. > > Some packages really don't like the new configure flags however (scons). > Perhaps we should have them as default, but if #:configure-flags is set, > let them be overridden? In general it seems like a good pattern. > Also some packages are missing a dependency on "python-py"[1]. > > Perhaps we can set up a Hydra channel to deal with the fallout? I haven’t really followed, but if the two of you agree on that, that’s definitely something we can do! > From a12000dd320cebeb920a4f790fe9206a2b6bda41 Mon Sep 17 00:00:00 2001 > From: Marius Bakke <mbakke@fastmail.com> > Date: Thu, 29 Sep 2016 18:29:21 +0100 > Subject: [PATCH 1/2] guix: python-build-system: fix configure flag append > (followup to dba07a8d1) > > --- > guix/build/python-build-system.scm | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) Seems reasonable (with proper commit log). > From 84fa3e8be3d3d868ddb9278a96807086415b754d Mon Sep 17 00:00:00 2001 > From: Marius Bakke <mbakke@fastmail.com> > Date: Thu, 29 Sep 2016 18:41:35 +0100 > Subject: [PATCH 2/2] guix: python-build-system: Import setuptools before > calling `setup.py'. > > This is needed for packages using "distutils" instead of "setuptools" > since the former does not understand the > "--single-version-externally-managed" flag. Also export __file__ since > it will be unset when setup.py is called from python "exec". Please move this explanation as a comment right above the newly-added code. > * guix/build/python-build-system.scm (call-setuppy): extend > "python setup.py" call to import setuptools, export __file__, and > call setup.py from setuptools python environment. It might be worth adding a comment on the general context in the code here. Regardless, it’s a good idea to get feedback from Hartmut and whoever else knows more about Python than myself before committing. :-) Speaking of which, could you create an account on savannah.gnu.org and send your account name to the folks marked as “project admins” on <https://savannah.gnu.org/projects/guix/>? Please send it as an OpenPGP-signed message, using the OpenPGP key that you will then use to sign commits. Also, make sure to upload said key to pgp.mit.edu and to add it on Savannah too. If anything is unclear, let me know. :-) TIA! Ludo’.
Am 02.10.2016 um 16:24 schrieb Ludovic Courtès: > >> Subject: [PATCH 2/2] guix: python-build-system: Import setuptools before >> calling `setup.py'. >> >> This is needed for packages using "distutils" instead of "setuptools" >> since the former does not understand the >> "--single-version-externally-managed" flag. Also export __file__ since >> it will be unset when setup.py is called from python "exec". > Please move this explanation as a comment right above the newly-added > code. @marius: I already added this comment, see the fixups on my branch at gitlab (which I'm going to clean up when we all agree on the result).
On Sun, Oct 02, 2016 at 07:31:01PM +0200, Hartmut Goebel wrote: > Am 02.10.2016 um 16:24 schrieb Ludovic Courtès: > > > >> Subject: [PATCH 2/2] guix: python-build-system: Import setuptools before > >> calling `setup.py'. > >> > >> This is needed for packages using "distutils" instead of "setuptools" > >> since the former does not understand the > >> "--single-version-externally-managed" flag. Also export __file__ since > >> it will be unset when setup.py is called from python "exec". > > Please move this explanation as a comment right above the newly-added > > code. > > @marius: I already added this comment, see the fixups on my branch at > gitlab (which I'm going to clean up when we all agree on the result). Let us know when the two of you think the code is ready to be tested on Hydra, and I will set it up.
On 2 October 2016 19:01:38 BST, Leo Famulari <leo@famulari.name> wrote: >On Sun, Oct 02, 2016 at 07:31:01PM +0200, Hartmut Goebel wrote: >> Am 02.10.2016 um 16:24 schrieb Ludovic Courtès: >> > >> >> Subject: [PATCH 2/2] guix: python-build-system: Import setuptools >before >> >> calling `setup.py'. >> >> >> >> This is needed for packages using "distutils" instead of >"setuptools" >> >> since the former does not understand the >> >> "--single-version-externally-managed" flag. Also export __file__ >since >> >> it will be unset when setup.py is called from python "exec". >> > Please move this explanation as a comment right above the >newly-added >> > code. >> >> @marius: I already added this comment, see the fixups on my branch at >> gitlab (which I'm going to clean up when we all agree on the result). > >Let us know when the two of you think the code is ready to be tested on >Hydra, and I will set it up. Just FYI: I will be offline for a couple of days while waiting for a newly ordered ARM chromebook (Asus C201). If anyone wants to work on core/libreboot meanwhile that would be great ;-) I'll address the points raised Thursday or so. It makes sense to either apply these on core-updates or wait until it's merged before creating a channel/branch for Hydra IMO.
Am 30.09.2016 um 16:39 schrieb Marius Bakke:
> Also some packages are missing a dependency on "python-py"[1].
I found an example: python-pytest-cov fails in the "check" phase. This
is an undocumented requirement for the tests, resp. this is an
install-requirement for pytest, but pytest has "python-py" defined as a
normal input.
I also discovered that prior to my changes a .pth file was created in
some case where now it is not - as far as I've seen. I still need to
investigate this in detail.
I'll report when I'm done with this. Probably I will need to rework the
core of the patch-set.
Am 30.09.2016 um 16:39 schrieb Marius Bakke:
> Also some packages are missing a dependency on "python-py"[1].
FYI: I found an example: python-pytest-cov fails in the "check" phase.
This is an undocumented requirement for the tests, resp. this is an
install-requirement for pytest, but pytest has "python-py" defined as a
normal input.
I investigated this and found that the existing build-system was kind of
broken :-( Prior to my changes, a .pth file was created in
in many cases - while now it is never creates.
(For those not common to Python: .pth-files are an old way to specify
additional directories to be added to sys.path (PYTHONPATH). .pth-file
were rarely used until setuptools and easy-install came up. And now
since pip is the recommended install method, they are bound to vanish
again.)
This .pth file did not only point to the .egg-directory (or file, in
case of a zipped .egg), but also to the .eggs of the requirement of the
current package. In the case of pytest, the .pth file looked something
like thus:
./pytest-1.2.3.egg
/gnu/store/…-python-py-3.2.1/lib/python3.4/site-packages/py-3.2.1.egg
Thus the .pth-file did "propagate" the inputs.
Due to my change the .pth-file is gone now, and thus all required inputs
need to be declared as propageded-inputs as uix.
I'm working on this, but it requires to have a look at many of the
packages' source to do it right and will take some days to finish.
Hi Leo, > Let us know when the two of you think the code is ready to be tested on > Hydra, and I will set it up. I now have a patch-set ready for testing. The patches will still need some clean-up, but the result should be okay so far. Please set up a Hydra channel so we can test cross building. My WIP is still available at <https://gitlab.com/htgoebel/guix/tree/python-build-system>
On Mon, Oct 10, 2016 at 03:24:24PM +0200, Hartmut Goebel wrote: > Hi Leo, > > Let us know when the two of you think the code is ready to be tested on > > Hydra, and I will set it up. > > I now have a patch-set ready for testing. The patches will still need > some clean-up, but the result should be okay so far. > > Please set up a Hydra channel so we can test cross building. > > My WIP is still available at <https://gitlab.com/htgoebel/guix/tree/python-build-system> I've added you to the Guix group on Savannah, so you should be able to push a branch called 'wip-python-build-system'. Please read the file 'HACKING' carefully, and ask if you are unsure about anything. I'll set up a Hydra jobset for the branch once it has been created. Welcome! I'm looking forward to seeing this new Python build system in action. [0] It can be called 'python-build-system' if you don't expect to rebase or break the history of the branch. We use the 'wip-' prefix to signal that clones of the branch may become invalid due to rewritten history.
On Wed, Oct 12, 2016 at 10:29:54AM -0400, Leo Famulari wrote:
> I'll set up a Hydra jobset for the branch once it has been created.
Maybe it would be good to wait until core-updates is merged? Hydra is
currently busy building that. Also, there is still the wip-python branch
on hydra, maybe this could then be deleted, or commits cherry-picked?
Andreas
On Wed, Oct 12, 2016 at 04:37:06PM +0200, Andreas Enge wrote: > On Wed, Oct 12, 2016 at 10:29:54AM -0400, Leo Famulari wrote: > > I'll set up a Hydra jobset for the branch once it has been created. > > Maybe it would be good to wait until core-updates is merged? Hydra is > currently busy building that. Also, there is still the wip-python branch > on hydra, maybe this could then be deleted, or commits cherry-picked? Yes, I was going to coordinate with the rest of the admins to schedule this Python rebuild. I think it should happen after this core-updates cycle. The wip-python branch is on hold until we have Python 3.5 in master. I found some significant differences in how Python 3.4 and 3.5 affect building, and I didn't want to juggle three different Python package graphs: current master, current core-updates, and wip-pytohn. The core Python packages are *extremely* tangled up in each other. Help wanted, and I do plan to tackle it after the next release, and potentially after this new build system is merged. It depends on how quickly the new build system looks ready for master. We could even restart wip-python on wip-python-build-system, since I didn't make concrete progress on wip-python, unfortunately.
Hello, On Wed, Oct 12, 2016 at 4:51 PM, Leo Famulari <leo@famulari.name> wrote: > The core Python packages are *extremely* tangled up in each other. Help > wanted Can you explain a bit what that would involve, what one can do to help, etc...
From 84fa3e8be3d3d868ddb9278a96807086415b754d Mon Sep 17 00:00:00 2001 From: Marius Bakke <mbakke@fastmail.com> Date: Thu, 29 Sep 2016 18:41:35 +0100 Subject: [PATCH 2/2] guix: python-build-system: Import setuptools before calling `setup.py'. This is needed for packages using "distutils" instead of "setuptools" since the former does not understand the "--single-version-externally-managed" flag. Also export __file__ since it will be unset when setup.py is called from python "exec". * guix/build/python-build-system.scm (call-setuppy): extend "python setup.py" call to import setuptools, export __file__, and call setup.py from setuptools python environment. --- guix/build/python-build-system.scm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/guix/build/python-build-system.scm b/guix/build/python-build-system.scm index d07b83f..4362c48 100644 --- a/guix/build/python-build-system.scm +++ b/guix/build/python-build-system.scm @@ -42,7 +42,11 @@ (begin (format #t "running \"python setup.py\" with command ~s and parameters ~s~%" command params) - (zero? (apply system* "python" "setup.py" command params))) + (zero? (apply system* "python" + "-c" (string-append "import setuptools;" + "__file__='setup.py';" + "exec(open('setup.py').read())") + command params))) (error "no setup.py found"))) (define* (build #:rest empty) -- 2.10.0