distutils incorrectly handles CFLAGS as 1 argument instead of space-separated list of arguments. distutils should respect environment variables, which set compiler, linker etc. --- Lib/distutils/unixccompiler.py +++ Lib/distutils/unixccompiler.py @@ -297,7 +297,7 @@ # this time, there's no way to determine this information from # the configuration data stored in the Python installation, so # we use this hack. - compiler = os.path.basename(sysconfig.get_config_var("CC")) + compiler = os.path.basename(self.compiler[0]) if sys.platform[:6] == "darwin": # MacOSX's linker doesn't understand the -R flag at all return "-L" + dir Patch was created by Arfrever Frehtes Taifersar Arahesis (arfrever.fta@gmail.com). It was originally written for PyPy, but it seems like it should actually apply to the stdlib. This patch is for 2.7, I'm hoping it could be taken as a bug fix.
The bug is specific to PyPy. PyPy has no Makefile, so sysconfig.get_config_var("CC") returns None in PyPy. The first paragraph in message #153471 is about a different patch, not this patch.
> PyPy has no Makefile, so sysconfig.get_config_var("CC") returns None in PyPy. Do you think the stdlib sysconfig could be changed to make this call return something meaningful, or should the code use another method to find the compiler to use? (Getting config vars for 'SO' is one of the (surprisingly few) issues I’ve found when trying to run distutils2 tests with PyPy, I’d love to fix it.)
Distutils is now deprecated (see PEP 632) and all tagged issues are being closed. From now until removal, only release blocking issues will be considered for distutils. If this issue does not relate to distutils, please remove the component and reopen it. If you believe it still requires a fix, most likely the issue should be re-reported at https://github.com/pypa/setuptools
History
Date
User
Action
Args
2022-04-11 14:57:26
admin
set
github: 58238
2021-02-03 18:30:39
steve.dower
set
status: open -> closednosy: + steve.dowermessages: + resolution: out of datestage: resolved