Skip to content

make profile-opt includes -fprofile* flags in _sysconfigdata CFLAGS #67093

Closed

Description

@gpshead
BPO 22904
Nosy @gpshead, @ned-deily
Superseder
  • bpo-23390: make profile-opt: test_distutils failure
  • Files
  • issue22904-test-workaround-gps01.diff
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/gpshead'
    closed_at = <Date 2015-02-04.04:21:00.974>
    created_at = <Date 2014-11-19.22:55:34.402>
    labels = ['type-bug']
    title = 'make profile-opt includes -fprofile* flags in _sysconfigdata CFLAGS'
    updated_at = <Date 2015-03-25.06:40:47.327>
    user = 'https://github.com/gpshead'

    bugs.python.org fields:

    activity = <Date 2015-03-25.06:40:47.327>
    actor = 'ned.deily'
    assignee = 'gregory.p.smith'
    closed = True
    closed_date = <Date 2015-02-04.04:21:00.974>
    closer = 'gregory.p.smith'
    components = []
    creation = <Date 2014-11-19.22:55:34.402>
    creator = 'gregory.p.smith'
    dependencies = []
    files = ['37231']
    hgrepos = []
    issue_num = 22904
    keywords = ['patch']
    message_count = 6.0
    messages = ['231401', '231402', '231403', '235371', '239135', '239224']
    nosy_count = 3.0
    nosy_names = ['gregory.p.smith', 'ned.deily', 'bkabrda']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '23390'
    type = 'behavior'
    url = 'https://bugs.python.org/issue22904'
    versions = ['Python 3.4']

    Activity

    1. gpshead commented on Nov 19, 2014

      @gpshead
      MemberAuthor
      1. Checkout a 3.4 tree. Mine was at revision d244e1770f1b.
      2. ./configure
      3. make -j14 profile-opt
      4. ./python -m test.regrtest -v test_distutils

      FAIL: test_sysconfig_module (distutils.tests.test_sysconfig.SysconfigTestCase)
      ----------------------------------------------------------------------

      Traceback (most recent call last):
        File "/.../oss/cpython/3.4/Lib/distutils/tests/test_sysconfig.py", line 131, in test_sysconfig_module
          sysconfig.get_config_var('CFLAGS'))
      AssertionError: '-Wno[38 chars] -Wall -Wstrict-prototypes  -fprofile-use -fprofile-correction' != '-Wno[38 chars] -Wall -Wstrict-prototypes'

      This can be traced to the built _sysconfigdata.py file which contains the command line passed CFLAGS from the build_all_use_profile target's sub-make vs the distutils.sysconfig module's Makefile parsing which finds the PY_CFLAGS value from the Makefile itself.

      One of either stripping the profile-opt related flags out when generating _sysconfigdata.py or explicitly generating a good _sysconfigdata.py file outside of the sub-make's with the profiling generate or use flags seems like a good idea. The latter is likely easier; just regenerate _sysconfigdata.py after the sub-make.

    2. self-assigned this
      on Nov 19, 2014
    3. added
      type-bug
      on Nov 19, 2014
    4. gpshead commented on Nov 19, 2014

      @gpshead
      MemberAuthor

      Should _sysconfigdata.py contain these flags for reference, implying that it is this test or distutils.sysconfig implementation which is really wrong?

    5. changed the title [-]make profile-opt fails to update _sysconfigdata.py during the rebuild[/-] [+]make profile-opt includes -fprofile* flags in _sysconfigdata CFLAGS[/+] on Nov 19, 2014
    6. gpshead commented on Nov 19, 2014

      @gpshead
      MemberAuthor

      attaching a proposed workaround in the unittest.

    7. gpshead commented on Feb 4, 2015

      @gpshead
      MemberAuthor

      see also bpo-23390

    8. bkabrda commented on Mar 24, 2015

      bkabrdamannequin
      Mannequin

      I'm also hitting an issue with test_sysconfig_module, but for a different reason: While building Python, I used "make EXTRA_CFLAGS='some flags'" and this makes test_sysconfig_module fail when I run "make test" or "python -m test.regrtest".

      The problem is that EXTRA_CFLAGS, like profile-opt, is not in the Makefile, so _sysconfigdata has it stored from build - unlike distutils, which can't see the EXTRA_CFLAGS variable in the environment, thus resulting in failure.

      I'm not sure what's the proper solution here, but I think requiring people to run "make test" with precisely the same EXTRA_CFLAGS as "make" is not right (although it solves the issue). This makes me think this is a bug - should I open a new issue?

    9. ned-deily commented on Mar 25, 2015

      @ned-deily
      Member

      Slavek, this issue and its superseder are both closed so comments here will likely not be acted on.

    10. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    Labels

    type-bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions