Skip to content

Bogus usage of floatclock in timemodule #66814

Description

@LinkMauve
mannequin
BPO 22624
Nosy @vstinner
Files
  • pyconfig.h
  • 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 = None
    closed_at = <Date 2016-07-08.15:23:05.957>
    created_at = <Date 2014-10-13.18:34:55.777>
    labels = ['build']
    title = 'Bogus usage of floatclock in timemodule'
    updated_at = <Date 2016-07-08.15:55:55.755>
    user = 'https://bugs.python.org/LinkMauve'

    bugs.python.org fields:

    activity = <Date 2016-07-08.15:55:55.755>
    actor = 'python-dev'
    assignee = 'none'
    closed = True
    closed_date = <Date 2016-07-08.15:23:05.957>
    closer = 'vstinner'
    components = ['Build']
    creation = <Date 2014-10-13.18:34:55.777>
    creator = 'Link Mauve'
    dependencies = []
    files = ['36911']
    hgrepos = []
    issue_num = 22624
    keywords = []
    message_count = 7.0
    messages = ['229260', '229280', '229281', '229283', '229284', '269990', '269993']
    nosy_count = 3.0
    nosy_names = ['vstinner', 'python-dev', 'Link Mauve']
    pr_nums = []
    priority = 'normal'
    resolution = 'wont fix'
    stage = None
    status = 'closed'
    superseder = None
    type = 'compile error'
    url = 'https://bugs.python.org/issue22624'
    versions = ['Python 3.5']

    Activity

    1. LinkMauve commented on Oct 13, 2014

      LinkMauvemannequin
      MannequinAuthor

      In Modules/timemodule.c, py_process_time() still uses floatclock() even when HAVE_CLOCK isn’t defined.

    2. vstinner commented on Oct 14, 2014

      @vstinner
      Member

      What is your platform?

      time.process_time() supports many functions:

      • GetProcessTimes() (Windows only)
      • clock_gettime(CLOCK_PROF)
      • clock_gettime(CLOCK_PROCESS_CPUTIME_ID)
      • getrusage(RUSAGE_SELF)
      • times()
      • clock()

      On POSIX, clock() is always tried as a fallback. Does your platform support at least one of these functions?

    3. vstinner commented on Oct 14, 2014

      @vstinner
      Member
    4. LinkMauve commented on Oct 14, 2014

      LinkMauvemannequin
      MannequinAuthor

      I’m building against the Newlib libc, for the Wii, and it seems the issue leading to all of those functions not working is:
      (.text.clock+0x18): undefined reference to `_times_r'

      Threading is disabled, and reentrant functions as well, which could explain that.

      But still, when pyconfig.h doesn’t define any HAVE_ macro to get the system time, I would expect py_process_time() to return None or something instead of failing to build.

    5. vstinner commented on Oct 14, 2014

      @vstinner
      Member

      Please attach your pyconfig.h file.

    6. vstinner commented on Jul 8, 2016

      @vstinner
      Member

      Sorry but the Wii console is not supported. You have to maintain your fork/patch.

      Python 3 don't support platforms without clock().

    7. python-dev commented on Jul 8, 2016

      python-devmannequin
      Mannequin

      New changeset 1452520dfe7b by Victor Stinner in branch 'default':
      Issue bpo-22624: Python 3 requires clock() to build
      https://hg.python.org/cpython/rev/1452520dfe7b

    8. 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

    No one assigned

      Labels

      buildThe build process and cross-build

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions