From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hartmut Goebel Subject: Re: [PATCH 00/14] Change python-build-system (fixes bug 20765) Date: Sun, 2 Oct 2016 11:05:38 +0200 Message-ID: <57F0CDE2.7040808@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> <87bmz5ih9u.fsf@ike.i-did-not-set--mail-host-address--so-tickle-me> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46060) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bqciP-0004XT-Dk for guix-devel@gnu.org; Sun, 02 Oct 2016 05:05:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bqciM-00080m-2I for guix-devel@gnu.org; Sun, 02 Oct 2016 05:05:45 -0400 Received: from mail-out.m-online.net ([212.18.0.9]:52620) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bqciL-00080a-Io for guix-devel@gnu.org; Sun, 02 Oct 2016 05:05:41 -0400 In-Reply-To: <87bmz5ih9u.fsf@ike.i-did-not-set--mail-host-address--so-tickle-me> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Marius Bakke , guix-devel@gnu.org Am 30.09.2016 um 16:39 schrieb Marius Bakke: > After adding a couple of patches I'm able to build many python packages= =2E 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 package= s > using distutils instead of setuptools. We should use the same code here pip uses [1,2], which is: "import setuptools, tokenize;__file__=3D%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)= =2E > 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. --=20 Regards Hartmut Goebel | Hartmut Goebel | h.goebel@crazy-compilers.com | | www.crazy-compilers.com | compilers which you thought are impossible |