Conversation
|
When I look at diff --git a/distutils/sysconfig.py b/distutils/sysconfig.py
index 879b6981ed..39e4a848a2 100644
--- a/distutils/sysconfig.py
+++ b/distutils/sysconfig.py
@@ -205,8 +205,8 @@ def customize_compiler(compiler):
_osx_support.customize_compiler(_config_vars)
_config_vars['CUSTOMIZED_OSX_COMPILER'] = 'True'
- (cc, cxx, cflags, ccshared, ldshared, shlib_suffix, ar, ar_flags) = \
- get_config_vars('CC', 'CXX', 'CFLAGS',
+ (cc, cxx, opt, cflags, ccshared, ldshared, shlib_suffix, ar, ar_flags) = \
+ get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS',
'CCSHARED', 'LDSHARED', 'SHLIB_SUFFIX', 'AR', 'ARFLAGS')
if 'CC' in os.environ:
@@ -229,7 +229,7 @@ def customize_compiler(compiler):
if 'LDFLAGS' in os.environ:
ldshared = ldshared + ' ' + os.environ['LDFLAGS']
if 'CFLAGS' in os.environ:
- cflags = cflags + ' ' + os.environ['CFLAGS']
+ cflags = opt + ' ' + os.environ['CFLAGS']
ldshared = ldshared + ' ' + os.environ['CFLAGS']
if 'CPPFLAGS' in os.environ:
cpp = cpp + ' ' + os.environ['CPPFLAGS']But if I apply that diff to this branch, not only does it not address the failure, it creates a new one. |
|
Aha, so looking at the history of sysconfig_pypy, the lingering presence of the use of |
|
It seems the issue happens here when: Because On CPython, |
|
I'm now all but convinced that test is a poorly-written test. It monkey-patches |
|
If I update diff --git a/distutils/sysconfig.py b/distutils/sysconfig.py
index 879b6981ed..110ff3a8b4 100644
--- a/distutils/sysconfig.py
+++ b/distutils/sysconfig.py
@@ -205,9 +205,12 @@ def customize_compiler(compiler):
_osx_support.customize_compiler(_config_vars)
_config_vars['CUSTOMIZED_OSX_COMPILER'] = 'True'
- (cc, cxx, cflags, ccshared, ldshared, shlib_suffix, ar, ar_flags) = \
- get_config_vars('CC', 'CXX', 'CFLAGS',
- 'CCSHARED', 'LDSHARED', 'SHLIB_SUFFIX', 'AR', 'ARFLAGS')
+ (cc, cxx, cflags, ccshared, ldshared, shlib_suffix, ar, ar_flags) = (
+ get_config_var(var)
+ for var in (
+ 'CC', 'CXX', 'CFLAGS',
+ 'CCSHARED', 'LDSHARED', 'SHLIB_SUFFIX', 'AR', 'ARFLAGS')
+ )
if 'CC' in os.environ:
newcc = os.environ['CC']The test passes. |
|
So the issue isn't pypy-specific, but the flaw is triggered by the conditions that happen to be present in my environment (darwin, Homebrew PyPy build). |
…following the patterns of prior implementations.
Thanks to the work of @mattip in pypa/setuptools#2221, support for PyPy in distutils is coming along nicely. This branch cherry-picks the distutils-related commits from that PR and addresses other test-related failures. Now the tests are passing (or skipped) except for one on PyPy:
Matti, can you suggest the right fix for this issue? Once I have the tests passing on PyPy3 here, I'll fold that into pypa/setuptools@distutils.