Summary: | dev-libs/boost-1.85.0 USE="numpy" fails with error: ‘PyArray_Descr’ {aka ‘struct _PyArray_Descr’} has no member named ‘elsize’ | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Attila Tóth <atoth> |
Component: | Current packages | Assignee: | David Seifert <soap> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | atoth, bugs.gentoo.org, chicago, joost.ruis, leonchik1976, luke5083, mmw |
Priority: | Normal | Keywords: | PATCH |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: |
https://github.com/boostorg/python/issues/431 https://github.com/boostorg/python/pull/432 |
||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | 935739 | ||
Bug Blocks: | 930951 | ||
Attachments: | https://github.com/boostorg/python/pull/432 with the path fixed |
Description
Attila Tóth
2024-05-22 11:56:04 UTC
Hi Attila, I ran into this too. Try downgrading to =dev-python/numpy1.26.4 https://github.com/numpy/numpy/releases/tag/v1.26.4 Both boost v1.84 and v1.85 were failing for me and after downgrading numpy, "no more problems". Also, it compiled for me using =sys-devel/gcc-13.3.0. Best Regards, -Chicago (In reply to Chicago from comment #1) > Hi Attila, > > I ran into this too. > Try downgrading to =dev-python/numpy1.26.4 > https://github.com/numpy/numpy/releases/tag/v1.26.4 > > Both boost v1.84 and v1.85 were failing for me and after downgrading > numpy, "no more problems". > > Also, it compiled for me using =sys-devel/gcc-13.3.0. > > Best Regards, > -Chicago Thanks for sharing! What I don't understand is, that according to numpy's documentation elsize is still the member of PyArray_Descr struct in contrast to the error message. Or I have to take a closer look... (In reply to Attila Tóth from comment #2) > (In reply to Chicago from comment #1) > > Hi Attila, > > > > I ran into this too. > > Try downgrading to =dev-python/numpy1.26.4 > > https://github.com/numpy/numpy/releases/tag/v1.26.4 > > > > Both boost v1.84 and v1.85 were failing for me and after downgrading > > numpy, "no more problems". > > > > Also, it compiled for me using =sys-devel/gcc-13.3.0. > > > > Best Regards, > > -Chicago > > Thanks for sharing! > What I don't understand is, that according to numpy's documentation elsize > is still the member of PyArray_Descr struct in contrast to the error > message. Or I have to take a closer look... https://numpy.org/devdocs/numpy_2_0_migration_guide.html#the-pyarray-descr-struct-has-been-changed Yeah, I don't know. Boost breaks things ALL OF THE TIME. When I noticed the numpy 2 package was merely a release candidate, I went to the homepage and it looked like the 1.26.4 release was actually more fresh; so that's why I gave it a try. Created attachment 894689 [details, diff] https://github.com/boostorg/python/pull/432 with the path fixed dropping https://github.com/boostorg/python/pull/432.patch into "/etc/portage/patches/dev-libs/boost" wont work, because the patch is missing the path element "libs/python" since it should be patching "libs/python/src/numpy/dtype.cpp" The attached patch just fixes the paths, putting it in "/etc/portage/patches/dev-libs/boost" works for me. The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7c4165b90a91bb690c3a21dc686ab72ce2c741af commit 7c4165b90a91bb690c3a21dc686ab72ce2c741af Author: Sam James <sam@gentoo.org> AuthorDate: 2024-05-31 22:34:43 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2024-05-31 22:35:49 +0000 dev-libs/boost: fix build w/ numpy-2 Closes: https://bugs.gentoo.org/932459 Signed-off-by: Sam James <sam@gentoo.org> dev-libs/boost/boost-1.85.0.ebuild | 1 + .../boost/files/boost-1.85.0-python-numpy-2.patch | 26 ++++++++++++++++++++++ 2 files changed, 27 insertions(+) Additionally, it has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b3c11ad7888226360acbfca8ffc210dd3cf43ddd commit b3c11ad7888226360acbfca8ffc210dd3cf43ddd Author: Sam James <sam@gentoo.org> AuthorDate: 2024-05-31 22:37:35 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2024-05-31 22:37:35 +0000 dev-libs/boost: subslot depend on numpy no revbump as it didn't build for >=2 until now anyway Bug: https://bugs.gentoo.org/932459 Signed-off-by: Sam James <sam@gentoo.org> dev-libs/boost/boost-1.85.0.ebuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) This also happens on stable tree when you pull in dev-python/numpy:0/2 and compile dev-libs/boost-1.84.0-r3 against it. For now I masked this numpy slot and see if that resolves my issue. 17 | BOOST_PYTHON_IS_XXX_DEF(auto_ptr, std::auto_ptr, 1) | ^~~~~~~~ ./boost/detail/is_xxx.hpp4: note: in definition of macro ‘BOOST_DETAIL_IS_XXX_DEF’ 20 | qualified_name< BOOST_PP_ENUM_PARAMS_Z(1, nargs, T) > \ | ^~~~~~~~~~~~~~ ./boost/python/detail/is_auto_ptr.hpp1: note: in expansion of macro ‘BOOST_PYTHON_IS_XXX_DEF’ 17 | BOOST_PYTHON_IS_XXX_DEF(auto_ptr, std::auto_ptr, 1) | ^~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/memory:78, from ./boost/function/function_base.hpp:34, from ./boost/function/detail/prologue.hpp:18, from ./boost/function/function_template.hpp:13, from ./boost/function/detail/maybe_include.hpp:15, from ./boost/function/function0.hpp:11, from ./boost/python/errors.hpp:13, from ./boost/python/handle.hpp:11, from ./boost/python/args_fwd.hpp:10, from ./boost/python/args.hpp /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/unique_ptr.h28: note: declared here 65 | template<typename> class auto_ptr; | ^~~~~~~~ libs/python/src/numpy/dtype.cpp: In member function ‘int boost::get_itemsize() const’: libs/python/src/numpy/dtype.cpp83: error: ‘PyArray_Descr’ {aka ‘struct _PyArray_Descr’} has no member named ‘elsize’ (In reply to Joost Ruis from comment #7) > This also happens on stable tree when you pull in dev-python/numpy:0/2 and > compile dev-libs/boost-1.84.0-r3 against it. > > For now I masked this numpy slot and see if that resolves my issue. > > > 17 | BOOST_PYTHON_IS_XXX_DEF(auto_ptr, std::auto_ptr, 1) > | ^~~~~~~~ > ./boost/detail/is_xxx.hpp4: note: in definition of macro > ‘BOOST_DETAIL_IS_XXX_DEF’ > 20 | qualified_name< BOOST_PP_ENUM_PARAMS_Z(1, nargs, T) > > \ > | ^~~~~~~~~~~~~~ > ./boost/python/detail/is_auto_ptr.hpp1: note: in expansion of macro > ‘BOOST_PYTHON_IS_XXX_DEF’ > 17 | BOOST_PYTHON_IS_XXX_DEF(auto_ptr, std::auto_ptr, 1) > | ^~~~~~~~~~~~~~~~~~~~~~~ > In file included from > /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/memory:78, > from ./boost/function/function_base.hpp:34, > from ./boost/function/detail/prologue.hpp:18, > from ./boost/function/function_template.hpp:13, > from ./boost/function/detail/maybe_include.hpp:15, > from ./boost/function/function0.hpp:11, > from ./boost/python/errors.hpp:13, > from ./boost/python/handle.hpp:11, > from ./boost/python/args_fwd.hpp:10, > from ./boost/python/args.hpp > > /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/unique_ptr.h28: > note: declared here > 65 | template<typename> class auto_ptr; > | ^~~~~~~~ > libs/python/src/numpy/dtype.cpp: In member function ‘int > boost::get_itemsize() const’: > libs/python/src/numpy/dtype.cpp83: error: ‘PyArray_Descr’ {aka > ‘struct _PyArray_Descr’} has no member named ‘elsize’ Yes masking dev-python/numpy:0/2 on my stable tree resolved my issue! I am going to reopen this bug since it now affects stable tree. I filed bug 935739 the other day. |