Skip to content

Compile fails when --enable-pystats #131281

Description

@xuantengh

Bug report

Bug description:

I've tried to compile CPython with --enable-pystats, but it fails

mkdir build && cd build
../configure --with-pydebug --enable-test-modules --enable-pystats
make -j8

...
In file included from ../Include/internal/pycore_interp.h:16,
                 from ../Include/internal/pycore_runtime.h:19,
                 from ../Include/internal/pycore_pystate.h:11,
                 from ../Include/internal/pycore_call.h:11,
                 from ../Python/ceval.c:9:
../Python/generated_cases.c.h: In function ‘_PyEval_EvalFrameDefault’:
../Python/generated_cases.c.h:705:22: error: ‘BINARY_SUBSCR’ undeclared (first use in this function); did you mean ‘BINARY_SLICE’?
  705 |             STAT_INC(BINARY_SUBSCR, hit);
      |                      ^~~~~~~~~~~~~
../Include/internal/pycore_code.h:362:76: note: in definition of macro ‘STAT_INC’
  362 | #define STAT_INC(opname, name) do { if (_Py_stats) _Py_stats->opcode_stats[opname].specialization.name++; } while (0)
      |                                                                            ^~~~~~
../Python/generated_cases.c.h:705:22: note: each undeclared identifier is reported only once for each function it appears in
  705 |             STAT_INC(BINARY_SUBSCR, hit);
      |                      ^~~~~~~~~~~~~
../Include/internal/pycore_code.h:362:76: note: in definition of macro ‘STAT_INC’
  362 | #define STAT_INC(opname, name) do { if (_Py_stats) _Py_stats->opcode_stats[opname].specialization.name++; } while (0)
      |                                                                            ^~~~~~

wth gcc 14.2.0

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

Activity

  1. added
    interpreter-core(Objects, Python, Grammar, and Parser dirs)
    buildThe build process and cross-build
    on Mar 15, 2025
  2. added a commit that references this issue on Mar 15, 2025
  3. tomasr8 commented on Mar 15, 2025

    @tomasr8
    Member

    Building with --enable-pystats is working again so I'll close the issue. Thanks @xuantengh!

  4. Fidget-Spinner commented on Mar 17, 2025

    @Fidget-Spinner
    Member

    This just failed again, and I think @markshannon 's recent work on headers caused it. Fixing now.

  5. added a commit that references this issue on Mar 17, 2025
  6. added 2 commits that reference this issue on Mar 17, 2025
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-buildinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions