KEMBAR78
Update pythoncapi_compat.h by cdce8p · Pull Request #18535 · python/mypy · GitHub
Skip to content

Conversation

@cdce8p
Copy link
Collaborator

@cdce8p cdce8p commented Jan 26, 2025

@vstinner
Copy link
Member

Tests / mypyc runtime tests with py39-macos (pull_request) Failing after 4m

Oh, removing PyConfig.use_system_logger was not enough to fix the Python 3.9 CI:

In file included from test_capi.cc:5:
In file included from ./CPy.h:12:
In file included from ./pythonsupport.h:11:
./pythoncapi_compat.h:2095:26: error: expected '(' for function-style cast or type construction
    for (size_t i=0; i < Py_ARRAY_LENGTH(config_spec); i++) {
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/runner/hostedtoolcache/Python/3.9.21/x64/include/python3.9/pymacro.h:61:72: note: expanded from macro 'Py_ARRAY_LENGTH'
     + Py_BUILD_ASSERT_EXPR(!__builtin_types_compatible_p(typeof(array), \
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/Users/runner/hostedtoolcache/Python/3.9.21/x64/include/python3.9/pymacro.h:40:27: note: expanded from macro 'Py_BUILD_ASSERT_EXPR'
    (sizeof(char [1 - 2*!(cond)]) - 1)
                          ^~~~

@cdce8p
Copy link
Collaborator Author

cdce8p commented Jan 26, 2025

Tests / mypyc runtime tests with py39-macos (pull_request) Failing after 4m

Oh, removing PyConfig.use_system_logger was not enough to fix the Python 3.9 CI:

Yeah, it fixed another issue I had but it's still there. The test with sizeof(config_spec) / sizeof(config_spec[0] seems to be fine. I could reproduce the issue locally with 3.13.1 as well.

The marco docstring seems to be relevant: https://github.com/python/cpython/blob/0ef8d470b79889de065e94cecd0ee01e45037d3a/Include/pymacro.h#L86-L102

@cdce8p cdce8p force-pushed the mypyc-pythoncapi_compat branch from 906cf7e to a11fc87 Compare January 26, 2025 12:11
@cdce8p cdce8p marked this pull request as ready for review January 26, 2025 12:15
@cdce8p cdce8p requested a review from JukkaL January 27, 2025 16:11
@JukkaL JukkaL merged commit ae56892 into python:master Jan 27, 2025
12 checks passed
@cdce8p cdce8p deleted the mypyc-pythoncapi_compat branch January 27, 2025 16:56
@vstinner
Copy link
Member

Thanks @cdce8p for updating pythoncapi_compat.h and reporting regressions to pythoncapi_compat.h upstream :-)

@cdce8p
Copy link
Collaborator Author

cdce8p commented Jan 28, 2025

It seems there was another regression. The cp313-win wheel builds are failing now.
https://github.com/mypyc/mypy_mypyc-wheels/actions/runs/12993898514/job/36237171065#step:4:3848

Upstream fix: python/pythoncapi-compat#136
Will open a new PR was that's resolve.

Update: See #18560

JukkaL pushed a commit that referenced this pull request Jan 28, 2025
x612skm pushed a commit to x612skm/mypy-dev that referenced this pull request Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic-mypyc mypyc bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants