I need to adjust the default configuration used by “distutils” for compilation. In my default build of branch release-pypy3.5-5.x, the toplevel “distutils.sysconfig” dispatches as follows: if '__pypy__' in sys.builtin_module_names: from distutils.sysconfig_pypy import * from distutils.sysconfig_pypy import _config_vars # needed by setuptools and sysconfig_pypy.py unconditionally sets some configuration variables such as “CC” and “LDSHARED”. CPython reads from a configuration file which can be change with an environment variable and it is this technique we use. This does not yet seem supported in PyPy’s alternate implementation “distutils.sysconfig_cpython.py” Two questions: Generally, why are there are two implementations of sysconfig and what motivates the default choice? What changes are recommended to allow a configuration file here? Thanks david
Hi David As far as I remember, there are two implementations of sysconfig, because CPython one parser Makefile or something like that which we don't even really have, or more precisely didn't really have at the time. Overwriting CC and LDFLAGS can be definitely consider a bug, I would accept the patch that changes it to accept it only conditionally. PS. If you're using PyPy to compile C extensions using distutils (as opposed to say cffi), while it's generally supported, the resulting extensions are quite slow. Best regards, Maciej Fijalkowski On Wed, Oct 4, 2017 at 2:52 PM, David Callahan <dcallahan@fb.com> wrote:
I need to adjust the default configuration used by “distutils” for compilation.
In my default build of branch release-pypy3.5-5.x, the toplevel “distutils.sysconfig” dispatches as follows:
if '__pypy__' in sys.builtin_module_names:
from distutils.sysconfig_pypy import *
from distutils.sysconfig_pypy import _config_vars # needed by setuptools
and sysconfig_pypy.py unconditionally sets some configuration variables such as “CC” and “LDSHARED”.
CPython reads from a configuration file which can be change with an environment variable and it is this technique we use. This does not yet seem supported in PyPy’s alternate implementation “distutils.sysconfig_cpython.py”
Two questions:
Generally, why are there are two implementations of sysconfig and what motivates the default choice?
What changes are recommended to allow a configuration file here?
Thanks
david
_______________________________________________ pypy-dev mailing list pypy-dev@python.org https://mail.python.org/mailman/listinfo/pypy-dev
participants (2)
-
David Callahan
-
Maciej Fijalkowski