Uh oh!
There was an error while loading. Please reload this page.
gh-117549: Match declaration order for _Py_BackoffCounter initializer - #117551
Conversation
gvanrossum
left a comment
There was a problem hiding this comment.
LGTM. Let's wait for @tacaswell to give us a thumbs up here before we merge.
tacaswell
commented
Apr 4, 2024
I can confirm that scipy compiles with cpython from this branch. |
gvanrossum
commented
Apr 4, 2024
Thanks for your help! Merging now... |
…alizer (python#117551) Otherwise it might not compile with C++ (or certain C compilers/flags?).
methane
commented
Apr 20, 2024
Cython includes this file and g++ 9 and 10 (available on Ubuntu 22.04 LTS) doesn't compile this. msgpack/msgpack-python#593 (comment) // foo.cpp
#definePy_BUILD_CORE1
#include<Python.h>
#include"frameobject.h"
#include"internal/pycore_frame.h"intmain() {}
// g++-10 -std=c++17 -I include/python3.13 foo.cppI confirmed Using temporary variable fix it. _Py_BackoffCounterc;
c.backoff=backoff;
c.value=value;
returnc;But I am not sure we should support g++ 9/10 in Python 3.13. |
gvanrossum
commented
Apr 20, 2024
I am despairing. We make all these efforts to indicate things are internal and they are still included in half the packages in the world. :-( |
methane
commented
May 4, 2024
FYI, this caused compile error on MSVC too. Should we add |
gvanrossum
commented
May 4, 2024
Wait— if it failed on MSVC how could the original code have passed CI? |
methane
commented
May 4, 2024
Because we don't test C++. |
methane
commented
May 4, 2024
|
gvanrossum
commented
May 4, 2024
So let’s fix it. Do you have time for a PR? |
gvanrossum
commented
May 6, 2024
That should be fixed now. |
methane
commented
May 7, 2024
thank you. |
methane
commented
May 7, 2024
By the way, Cython uses this only for building custom traceback object. Adding https://github.com/cython/cython/blob/45db483cbe128c29a1e9ffe9f5a4db12cf77cddd/Cython/Utility/Exceptions.c#L1007C1-L1007C52 |
gvanrossum
commented
May 7, 2024
So IIUC you are proposing to add a new public API to set the |
This is to fix the build for Scipy, which includes this header from C++ code which seems to really care about such things.
To be clear, I didn't confirm that this fixes the Scipy build -- there are a bunch of other patches required to its build system to even compile with Python 3.13 and I'm not sure it's worth the effort there.
But this warning seems legitimate and the fix is harmless. It's possible there are other errors in Scipy behind it, but this is the only struct initializer added in #117144.