-
-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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
gh-91321: Add _testcppext C++ extension #32175
Conversation
By the way, using
|
https://bugs.python.org/issue39355 is closed. What is the status of this PR? |
This PR is now for https://bugs.python.org/issue47165 I'm working on fixing C++ compiler warnings: https://bugs.python.org/issue47164 |
I updated this PR for #91320 |
Oops, sorry, this PR is for #91321 |
I created #91959 for the "CAST" commit. |
Oh, the build fails with MSVC:
I initialize structures with
|
Error:
|
FYI we were/are trying to address the same issue with HPy headers. My understanding is that this only tests the static inline functions and macros that are used in the example extension. It is still possible that some other macro or static inline function could cause warnings or for macros even errors. So my conclusion so far has been that to have a fully C++ compat tested headers, one has to write a C++ extension(s) that use all the static inline functions and macros from the headers. Something tested is way better than nothing tested, so no objections to this PR -- just wanted to check if you see it the same way? |
Sadly, my experience is the same: a C++ compiler doesn't complain when a static inline function is defined. Only when it's being used. My practical plan is:
Right now, my main blocker issue is to test if Python has a working C++ compiler. For example, the "Tests / Windows (x64)" fails with |
🤖 New build scheduled with the buildbot fleet by @vstinner for commit 31b7a4f7ab6092998865e06dd0f4b0d5ea79b13f 🤖 If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again. |
I simplified |
Oh, when Python is installed, the test fails with:
For example, it failed on these buildbots:
|
Build a basic C++ test extension to check that the Python C API is compatible with C++ and does not emit C++ compiler warnings. * Add Modules/_testcppext.cpp: C++ extension * Add Lib/test/test_cppext.py: test building the C++ extension.
I rewrote the PR to build the C++ extension in a temporary directory and fix the test on installed Python: _testcppext.cpp is now part of Lib/test/ and so is installed. |
The error is unrelated to my change:
|
Build a C++ test extension to check that the Python C API is
compatible with C++ and does not emit C++ compiler warnings.
Add test_cppext.py and setup_testcppext.py to Lib/test/.
https://bugs.python.org/issue39355