
This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
Created on2019-03-08 12:23 byvstinner, last changed2022-04-11 14:59 byadmin. This issue is nowclosed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 12236 | closed | vstinner,2019-03-08 12:34 | |
| PR 12348 | merged | vstinner,2019-03-15 14:16 | |
| PR 12349 | merged | vstinner,2019-03-15 14:19 | |
| PR 12380 | closed | yan12125,2019-03-17 16:31 | |
| PR 12403 | merged | vstinner,2019-03-18 11:40 | |
| PR 12415 | merged | vstinner,2019-03-18 16:25 | |
| PR 12417 | merged | vstinner,2019-03-18 16:32 | |
| PR 12751 | merged | vstinner,2019-04-09 17:08 | |
| PR 12764 | merged | vstinner,2019-04-10 12:56 | |
| PR 12768 | merged | miss-islington,2019-04-10 23:39 | |
| Messages (19) | |||
|---|---|---|---|
| msg337468 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2019-03-08 12:23 | |
When a C extension is built by distutils, distutils.sysconfig.customize_compiler() is used to configure compiler flags. Extract of the code: (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 'CFLAGS' in os.environ: cflags = opt + ' ' + os.environ['CFLAGS'] ldshared = ldshared + ' ' + os.environ['CFLAGS'] if 'CPPFLAGS' in os.environ: cpp = cpp + ' ' + os.environ['CPPFLAGS'] cflags = cflags + ' ' + os.environ['CPPFLAGS'] ldshared = ldshared + ' ' + os.environ['CPPFLAGS'] ...If the CFLAGS environment variable is set, the 'CFLAGS' configuration variable is overriden with the 'OPT' configuration variable: cflags = opt + ...This bug has been fixed since 2013 in Fedora and RHEL by this patch:https://src.fedoraproject.org/rpms/python2/blob/master/f/00168-distutils-cflags.patchRHEL bug report:https://bugzilla.redhat.com/show_bug.cgi?id=849994I converted that patch to a pull request. | |||
| msg337505 -(view) | Author: Ned Deily (ned.deily)*![]() | Date: 2019-03-08 16:16 | |
This appears to be a duplicate ofIssue969718. | |||
| msg337990 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2019-03-15 13:58 | |
New changeset86082c22d23285995a32aabb491527c9f5629556 by Victor Stinner in branch 'master':bpo-36235: Fix CFLAGS in distutils customize_compiler() (GH-12236)https://github.com/python/cpython/commit/86082c22d23285995a32aabb491527c9f5629556 | |||
| msg337994 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2019-03-15 15:03 | |
New changeset37f6971777c05b5ca9c157606896b7ff458756a5 by Victor Stinner in branch '2.7':bpo-36235: Fix CFLAGS in distutils customize_compiler() (GH-12236) (GH-12349)https://github.com/python/cpython/commit/37f6971777c05b5ca9c157606896b7ff458756a5 | |||
| msg337995 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2019-03-15 15:03 | |
New changeset6c0e0d141a07cc3fd2441d9df8d762f56bf7edf2 by Victor Stinner in branch '3.7':bpo-36235: Fix CFLAGS in distutils customize_compiler() (GH-12236) (GH-12348)https://github.com/python/cpython/commit/6c0e0d141a07cc3fd2441d9df8d762f56bf7edf2 | |||
| msg338051 -(view) | Author: (yan12125)* | Date: 2019-03-16 03:48 | |
After this patch, test_distutils failed if $CPPFLAGS is not empty when building CPython. For example:$ export CPPFLAGS=-DFOO=BAR$ ./configure$ make$ ./python -m test test_distutils Run tests sequentially0:00:00 load avg: 0.45 [1/1] test_distutilstest test_distutils failed -- Traceback (most recent call last): File "/home/yen/Projects/cpython/Lib/distutils/tests/test_sysconfig.py", line 99, in test_customize_compiler self.assertEqual(comp.exes['compiler'], 'my_cc --sysconfig-cflags --mycflags')AssertionError: 'my_cc --sysconfig-cflags --mycflags -DFOO=BAR' != 'my_cc --sysconfig-cflags --mycflags'- my_cc --sysconfig-cflags --mycflags -DFOO=BAR? ----------+ my_cc --sysconfig-cflags --mycflagstest_distutils failed== Tests result: FAILURE ==1 test failed: test_distutilsTotal duration: 2 sec 192 msTests result: FAILURETested with commitd2fdd1fedf6b9dc785cf5025b548a989faed089a.This is an issue as Arch Linux uses CPPFLAGS="-D_FORTIFY_SOURCE=2" for creating packages [1].[1]https://git.archlinux.org/svntogit/packages.git/tree/trunk/makepkg.conf?h=packages/pacman#n39 | |||
| msg338199 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2019-03-18 11:41 | |
Chih-Hsuan Yen: After this patch, test_distutils failed if $CPPFLAGS is not empty when building CPython.Aha, more sysconfig configuration variables and environment variables should be mocked. I wrotePR 12403 to mock all variables. Would you mind to test and review it? | |||
| msg338229 -(view) | Author: (yan12125)* | Date: 2019-03-18 14:26 | |
STINNER Victor: Thank you very much for that much better fix! I've tested it on Arch Linux. With that patch, test_distutils passes as usual. The pull request looks good, too. Just a question: I think it should be backported to 3.7 and 2.7 branches likehttps://github.com/python/cpython/pull/12236? | |||
| msg338252 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2019-03-18 16:19 | |
New changeset72c7b372cf145fded93a9a776acc742a60090f95 by Victor Stinner in branch 'master':bpo-36235: Enhance distutils test_customize_compiler() (GH-12403)https://github.com/python/cpython/commit/72c7b372cf145fded93a9a776acc742a60090f95 | |||
| msg338254 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2019-03-18 16:37 | |
> Just a question: I think it should be backported to 3.7 and 2.7 (...)Right, I wrote PRs for that. I didn't use GitHub labels because the bot is currently broken. | |||
| msg338264 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2019-03-18 17:34 | |
New changesetdd1cfefd67f254ce44f33995922e347c9d3f7b4e by Victor Stinner in branch '3.7':bpo-36235: Enhance distutils test_customize_compiler() (GH-12403) (GH-12415)https://github.com/python/cpython/commit/dd1cfefd67f254ce44f33995922e347c9d3f7b4e | |||
| msg338265 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2019-03-18 17:34 | |
New changeset8c380e99e9b71387d5722373805fe3159e2d912c by Victor Stinner in branch '2.7':bpo-36235: Enhance distutils test_customize_compiler() (GH-12403) (GH-12417)https://github.com/python/cpython/commit/8c380e99e9b71387d5722373805fe3159e2d912c | |||
| msg338267 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2019-03-18 17:35 | |
Thanks for the review, I merged my PR and the test enhancements. | |||
| msg338268 -(view) | Author: (yan12125)* | Date: 2019-03-18 17:41 | |
Oh, I didn't know the bot is not working for now. Thank you for making the test more robust! | |||
| msg339785 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2019-04-09 17:02 | |
Oh, the test failed on Python 2.7 on macOS:x86-64 High Sierra 2.7https://buildbot.python.org/all/#/builders/140/builds/211======================================================================FAIL: test_customize_compiler (distutils.tests.test_sysconfig.SysconfigTestCase)----------------------------------------------------------------------Traceback (most recent call last): File "/Users/buildbot/buildarea/2.7.billenstein-sierra/build/Lib/distutils/tests/test_sysconfig.py", line 134, in test_customize_compiler 'sc_cc -E')AssertionError: '/usr/bin/clang -E' != 'sc_cc -E' | |||
| msg339795 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2019-04-09 17:54 | |
New changeset22de4ce498b656063e236350e8404981c13e1cd8 by Victor Stinner in branch '2.7':bpo-36235: Fix distutils test_customize_compiler() on macOS (GH-12751)https://github.com/python/cpython/commit/22de4ce498b656063e236350e8404981c13e1cd8 | |||
| msg339859 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2019-04-10 12:56 | |
Good, my change fixed x86-64 High Sierra 2.7 buildbot:https://buildbot.python.org/all/#/builders/140/builds/216I wrotePR 12764 to forward-port the fix to the master branch. | |||
| msg339899 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2019-04-10 23:38 | |
New changeseta9bd8925c7fa50dd3cfab125b824ec192133ef49 by Victor Stinner in branch 'master':bpo-36235: Fix distutils test_customize_compiler() on macOS (GH-12764)https://github.com/python/cpython/commit/a9bd8925c7fa50dd3cfab125b824ec192133ef49 | |||
| msg339901 -(view) | Author: miss-islington (miss-islington) | Date: 2019-04-10 23:58 | |
New changesetd9b25a2627ff6f4e10d46b4de4fff941b63497c7 by Miss Islington (bot) in branch '3.7':bpo-36235: Fix distutils test_customize_compiler() on macOS (GH-12764)https://github.com/python/cpython/commit/d9b25a2627ff6f4e10d46b4de4fff941b63497c7 | |||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:59:12 | admin | set | github: 80416 |
| 2019-04-11 01:07:51 | vstinner | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
| 2019-04-10 23:58:58 | miss-islington | set | nosy: +miss-islington messages: +msg339901 |
| 2019-04-10 23:39:00 | miss-islington | set | pull_requests: +pull_request12697 |
| 2019-04-10 23:38:51 | vstinner | set | messages: +msg339899 |
| 2019-04-10 12:56:46 | vstinner | set | messages: +msg339859 |
| 2019-04-10 12:56:02 | vstinner | set | pull_requests: +pull_request12692 |
| 2019-04-09 17:54:28 | vstinner | set | messages: +msg339795 |
| 2019-04-09 17:08:17 | vstinner | set | stage: resolved -> patch review pull_requests: +pull_request12678 |
| 2019-04-09 17:02:29 | vstinner | set | status: closed -> open resolution: fixed -> (no value) messages: +msg339785 |
| 2019-03-18 17:41:35 | yan12125 | set | messages: +msg338268 |
| 2019-03-18 17:35:09 | vstinner | set | status: open -> closed resolution: fixed messages: +msg338267 stage: patch review -> resolved |
| 2019-03-18 17:34:44 | vstinner | link | issue969718 superseder |
| 2019-03-18 17:34:35 | vstinner | set | messages: +msg338265 |
| 2019-03-18 17:34:34 | vstinner | set | messages: +msg338264 |
| 2019-03-18 16:37:35 | vstinner | set | messages: +msg338254 |
| 2019-03-18 16:32:16 | vstinner | set | pull_requests: +pull_request12371 |
| 2019-03-18 16:25:01 | vstinner | set | pull_requests: +pull_request12369 |
| 2019-03-18 16:19:04 | vstinner | set | messages: +msg338252 |
| 2019-03-18 14:26:39 | yan12125 | set | messages: +msg338229 |
| 2019-03-18 11:41:47 | vstinner | set | messages: +msg338199 |
| 2019-03-18 11:40:48 | vstinner | set | pull_requests: +pull_request12358 |
| 2019-03-17 16:31:58 | yan12125 | set | pull_requests: +pull_request12338 |
| 2019-03-16 03:48:40 | yan12125 | set | nosy: +yan12125 messages: +msg338051 |
| 2019-03-15 15:03:53 | vstinner | set | messages: +msg337995 |
| 2019-03-15 15:03:46 | vstinner | set | messages: +msg337994 |
| 2019-03-15 14:19:36 | vstinner | set | pull_requests: +pull_request12315 |
| 2019-03-15 14:16:44 | vstinner | set | pull_requests: +pull_request12314 |
| 2019-03-15 13:58:03 | vstinner | set | messages: +msg337990 |
| 2019-03-12 03:03:42 | koobs | set | nosy: +koobs |
| 2019-03-08 16:16:49 | ned.deily | set | nosy: +ned.deily messages: +msg337505 |
| 2019-03-08 12:34:54 | vstinner | set | keywords: +patch stage: patch review pull_requests: +pull_request12223 |
| 2019-03-08 12:23:45 | vstinner | create | |