Skip to content
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

[tests] Backport test_cext and test_cppext (C API tests) from main to the 3.12 branch #127906

Closed
vstinner opened this issue Dec 13, 2024 · 9 comments
Labels
tests Tests in the Lib/test dir topic-C-API

Comments

@vstinner
Copy link
Member Author

On the 3.12 branch, test_cext currently fails with these warnings:

  C:\victor\python\3.12\include\cpython/unicodeobject.h(205): error C2220: the following warning is treated as an error
  C:\victor\python\3.12\include\cpython/unicodeobject.h(205): warning C4100: '_unused_op': unreferenced formal parameter
  C:\victor\python\3.12\include\cpython/unicodeobject.h(395): warning C4100: '_unused_op': unreferenced formal parameter
  C:\victor\python\3.12\include\cpython/pytime.h(192): warning C4115: 'timeval': named type definition in parentheses
  extension.c(22): warning C4100: '_unused_module': unreferenced formal parameter
  extension.c(44): warning C4100: '_unused_module': unreferenced formal parameter

I backported MSVC support in Py_UNUSED() to 3.12 to fix unicodeobject.h: PR gh-127907.

@vstinner
Copy link
Member Author

C:\victor\python\3.12\include\cpython/pytime.h(192): warning C4115: 'timeval': named type definition in parentheses

I wrote #127908 to fix this pytime.h warning.

vstinner added a commit that referenced this issue Dec 13, 2024
)

gh-127906: Declare timeval struct in pytime.h on Windows

Fix the following MSVC compiler warning:

    include\cpython\pytime.h(192): warning C4115: 'timeval':
    named type definition in parentheses
vstinner added a commit to vstinner/cpython that referenced this issue Dec 13, 2024
vstinner added a commit to vstinner/cpython that referenced this issue Dec 13, 2024
vstinner added a commit to vstinner/cpython that referenced this issue Dec 13, 2024
vstinner added a commit to vstinner/cpython that referenced this issue Dec 13, 2024
vstinner added a commit to vstinner/cpython that referenced this issue Dec 13, 2024
vstinner added a commit to vstinner/cpython that referenced this issue Dec 13, 2024
vstinner added a commit to vstinner/cpython that referenced this issue Dec 13, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Dec 13, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Dec 13, 2024
vstinner added a commit that referenced this issue Dec 13, 2024
…127919)

gh-127906: Test the limited C API in test_cppext (GH-127916)
(cherry picked from commit d05a4e6)

Co-authored-by: Victor Stinner <[email protected]>
vstinner added a commit that referenced this issue Dec 13, 2024
…127920)

gh-127906: Test the limited C API in test_cppext (GH-127916)
(cherry picked from commit d05a4e6)

Co-authored-by: Victor Stinner <[email protected]>
vstinner added a commit to vstinner/cpython that referenced this issue Dec 13, 2024
@vstinner
Copy link
Member Author

I tested manually: with "[3.12] gh-127906: Test the limited C API in test_cppext", test_cppext is able to catch #127902 regression!

@encukou
Copy link
Member

encukou commented Dec 16, 2024

A 3.13 buildbots is failing on test_cext: https://buildbot.python.org/#/builders/1419/builds/385

@encukou encukou reopened this Dec 16, 2024
@encukou
Copy link
Member

encukou commented Dec 16, 2024

Also, on 3.12, Py_LIMITED_API tests should be skipped under Py_TRACE_REFS; see https://buildbot.python.org/#/builders/1197/builds/1034/steps/6/logs/stdio

@vstinner
Copy link
Member Author

Also, on 3.12, Py_LIMITED_API tests should be skipped under Py_TRACE_REFS; see https://buildbot.python.org/#/builders/1197/builds/1034/steps/6/logs/stdio

Oh, right: I created PR gh-127993 to fix this buildbot.

vstinner added a commit to vstinner/cpython that referenced this issue Dec 16, 2024
Change Py_BUILD_ASSERT_EXPR implementation on Windows to avoid a
compiler warning about an unnamed structure.
@vstinner
Copy link
Member Author

A 3.13 buildbots is failing on test_cext: https://buildbot.python.org/#/builders/1419/builds/385

  extension.c(56): error C2220: the following warning is treated as an error
  extension.c(56): warning C4116: unnamed type definition in parentheses

Oh, I see. I forgot to backport yet another fix for Py_BUILD_ASSERT_EXPR() on Windows. I created PR gh-127994 to fix this buildbot as well.

Thanks @encukou for reporting these issues! Sadly, test_cext and test_cppext are skipped on GitHub CI jobs since they are too slow.

vstinner added a commit that referenced this issue Dec 16, 2024
…#127993)

gh-127906: Skip limited C API test_cext tests if Py_TRACE_REFS

Skip limited C API tests in test_cext and test_cppext if Python is
configured with --with-trace-refs (if the Py_TRACE_REFS macro is
defined).
vstinner added a commit that referenced this issue Dec 16, 2024
gh-127906: Fix Py_BUILD_ASSERT_EXPR() on Windows

Change Py_BUILD_ASSERT_EXPR implementation on Windows to avoid a
compiler warning about an unnamed structure.
@vstinner
Copy link
Member Author

The 3.12 TraceRefs and 3.13 buildbots are back to green. I close the issue.

@encukou
Copy link
Member

encukou commented Dec 17, 2024

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir topic-C-API
Projects
None yet
Development

No branches or pull requests

2 participants