Issue 14030: Be more careful about selecting the compiler in distutils (original) (raw)

Created on 2012-02-16 09:37 by djc, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (6)
msg153471 - (view) Author: Dirkjan Ochtman (djc) * (Python committer) Date: 2012-02-16 09:37
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.
msg153569 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2012-02-17 16:52
Could you explain more about what the bug is?
msg153585 - (view) Author: Arfrever Frehtes Taifersar Arahesis (Arfrever) * (Python triager) Date: 2012-02-17 17:47
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.
msg153625 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2012-02-18 02:03
> 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.)
msg191358 - (view) Author: (dnozay) Date: 2013-06-17 18:48
affects PyPy, here are the downstream issues: - https://bugs.pypy.org/issue662 - https://bugs.pypy.org/issue674 - https://bugs.pypy.org/issue1057
msg386434 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2021-02-03 18:30
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
2013-06-17 18:48:05 dnozay set nosy: + dnozaymessages: +
2012-02-19 04:30:50 jcea set nosy: + jcea
2012-02-18 02:03:06 eric.araujo set messages: +
2012-02-17 17:47:05 Arfrever set messages: +
2012-02-17 16:52:06 eric.araujo set nosy: + Arfrever, eric.araujomessages: + assignee: eric.araujocomponents: + Distutils
2012-02-16 09:37:19 djc set versions: + Python 2.7
2012-02-16 09:37:14 djc create