Skip to content

Compile fails when --enable-pystats #131281

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
xuantengh opened this issue Mar 15, 2025 · 2 comments
Closed

Compile fails when --enable-pystats #131281

xuantengh opened this issue Mar 15, 2025 · 2 comments
Labels
build The build process and cross-build interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@xuantengh
Copy link
Contributor

xuantengh commented Mar 15, 2025

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_SUBSCRundeclared (first use in this function); did you meanBINARY_SLICE’?
  705 |             STAT_INC(BINARY_SUBSCR, hit);
      |                      ^~~~~~~~~~~~~
../Include/internal/pycore_code.h:362:76: note: in definition of macroSTAT_INC362 | #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 macroSTAT_INC362 | #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

@xuantengh xuantengh added the type-bug An unexpected behavior, bug, or error label Mar 15, 2025
@picnixz picnixz added interpreter-core (Objects, Python, Grammar, and Parser dirs) build The build process and cross-build labels Mar 15, 2025
Fidget-Spinner pushed a commit that referenced this issue Mar 15, 2025
* fix compile error due to `BINARY_SUBSCR`

* replace stat_inc with `BINARY_OP`
@tomasr8
Copy link
Member

tomasr8 commented Mar 15, 2025

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

@Fidget-Spinner
Copy link
Member

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

Fidget-Spinner added a commit that referenced this issue Mar 17, 2025
Add include to for pystats builds
plashchynski pushed a commit to plashchynski/cpython that referenced this issue Mar 17, 2025
…31283)

* fix compile error due to `BINARY_SUBSCR`

* replace stat_inc with `BINARY_OP`
plashchynski pushed a commit to plashchynski/cpython that referenced this issue Mar 17, 2025
seehwan pushed a commit to seehwan/cpython that referenced this issue Apr 16, 2025
…31283)

* fix compile error due to `BINARY_SUBSCR`

* replace stat_inc with `BINARY_OP`
seehwan pushed a commit to seehwan/cpython that referenced this issue Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build The build process and cross-build interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

4 participants