guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 00/14] Change python-build-system (fixes bug 20765)


From: Hartmut Goebel
Subject: Re: [PATCH 00/14] Change python-build-system (fixes bug 20765)
Date: Sun, 2 Oct 2016 11:05:38 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

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.

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | address@hidden               |
| www.crazy-compilers.com | compilers which you thought are impossible |





reply via email to

[Prev in Thread] Current Thread [Next in Thread]