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

python 3.12 build failure on macOS Sonoma #1558

Closed
externl opened this issue Oct 23, 2023 · 2 comments
Closed

python 3.12 build failure on macOS Sonoma #1558

externl opened this issue Oct 23, 2023 · 2 comments
Assignees
Milestone

Comments

@externl
Copy link
Member

externl commented Oct 23, 2023

❯ make PYTHON=(brew --prefix [email protected])/bin/python3.12
Compiling [macosx-shared] ../cpp/src/Slice/Grammar.cpp
Compiling [macosx-shared] ../cpp/src/Slice/MD5.cpp
Compiling [macosx-shared] ../cpp/src/Slice/FileTracker.cpp
Compiling [macosx-shared] ../cpp/src/Slice/MD5I.cpp
Compiling [macosx-shared] ../cpp/src/Slice/Checksum.cpp
Compiling [macosx-shared] ../cpp/src/Slice/Parser.cpp
Compiling [macosx-shared] ../cpp/src/Slice/Preprocessor.cpp
Compiling [macosx-shared] ../cpp/src/Slice/SliceUtil.cpp
Compiling [macosx-shared] ../cpp/src/Slice/Python.cpp
Compiling [macosx-shared] ../cpp/src/Slice/Scanner.cpp
Compiling [macosx-shared] ../cpp/src/Slice/PythonUtil.cpp
Compiling [macosx-shared] ../cpp/src/Slice/StringLiteralUtil.cpp
Compiling [macosx-shared] modules/IcePy/BatchRequestInterceptor.cpp
Compiling [macosx-shared] modules/IcePy/Communicator.cpp
Compiling [macosx-shared] modules/IcePy/Connection.cpp
Compiling [macosx-shared] modules/IcePy/ConnectionInfo.cpp
Compiling [macosx-shared] modules/IcePy/Current.cpp
Compiling [macosx-shared] modules/IcePy/Dispatcher.cpp
Compiling [macosx-shared] modules/IcePy/Endpoint.cpp
Compiling [macosx-shared] modules/IcePy/EndpointInfo.cpp
Compiling [macosx-shared] modules/IcePy/ImplicitContext.cpp
Compiling [macosx-shared] modules/IcePy/Init.cpp
Compiling [macosx-shared] modules/IcePy/Logger.cpp
Compiling [macosx-shared] modules/IcePy/ObjectAdapter.cpp
Compiling [macosx-shared] modules/IcePy/Operation.cpp
Compiling [macosx-shared] modules/IcePy/Properties.cpp
Compiling [macosx-shared] modules/IcePy/Proxy.cpp
Compiling [macosx-shared] modules/IcePy/PropertiesAdmin.cpp
Compiling [macosx-shared] modules/IcePy/Slice.cpp
Compiling [macosx-shared] modules/IcePy/Thread.cpp
Compiling [macosx-shared] modules/IcePy/Types.cpp
Compiling [macosx-shared] modules/IcePy/Util.cpp
Compiling [macosx-shared] modules/IcePy/ValueFactoryManager.cpp
modules/IcePy/Types.cpp:4627:5: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces]
    1, &UnsetType
    ^
    {}
1 error generated.
make: *** [modules/IcePy/build/macosx/shared/pic/Types.o] Error 1
make: *** Waiting for unfinished jobs....
@externl externl added this to the 3.7.10 milestone Oct 23, 2023
@externl
Copy link
Member Author

externl commented Oct 23, 2023

I looks like the PyObject (which is a typedef of _object) struct changed between 3.11 and 3.12

3.11

struct _object {
    _PyObject_HEAD_EXTRA
    Py_ssize_t ob_refcnt;
    PyTypeObject *ob_type;
};

3.12

struct _object {
    _PyObject_HEAD_EXTRA

#if (defined(__GNUC__) || defined(__clang__)) \
        && !(defined __STDC_VERSION__ && __STDC_VERSION__ >= 201112L)
    // On C99 and older, anonymous union is a GCC and clang extension
    __extension__
#endif
#ifdef _MSC_VER
    // Ignore MSC warning C4201: "nonstandard extension used:
    // nameless struct/union"
    __pragma(warning(push))
    __pragma(warning(disable: 4201))
#endif
    union {
       Py_ssize_t ob_refcnt;
#if SIZEOF_VOID_P > 4
       PY_UINT32_T ob_refcnt_split[2];
#endif
    };
#ifdef _MSC_VER
    __pragma(warning(pop))
#endif

    PyTypeObject *ob_type;
};

We're defining

//
PyObject UnsetValue =
{
    _PyObject_EXTRA_INIT
    1, &UnsetType
};

I wonder if we should be using PyObject_HEAD_INIT instead of manually doing it ourselves. Just need to ensure it's available everywhere.

@externl externl self-assigned this Oct 23, 2023
@externl
Copy link
Member Author

externl commented Oct 24, 2023

This was fixed in 4fa13cd

@externl externl closed this as completed Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant