epics-base / p4p

Python bindings for the PVAccess network client and server.
BSD 3-Clause "New" or "Revised" License
27 stars 38 forks source link

Build failure in _p4p.pyx #116

Closed ericonr closed 1 year ago

ericonr commented 1 year ago

Hi!

I'm using python 3.11.4, cython 0.29.36, and PVXS master (aba04ee95228369ba0f6f1843f85e830c2587317)

I get a build error when building _p4p.pyx, specifically in https://github.com/mdavidsaver/p4p/blob/141ad1fb75f8fc988d9338c36c4e76b1667c55da/src/p4p/_p4p.pyx#L298 :

In file included from _p4p.cpp:787:
../../../epics-7/../pvxs/include/pvxs/data.h: In instantiation of 'void pvxs::Value::from(const T&) [with T = std::nullptr_t]':
_p4p.cpp:5757:21:   required from here
../../../epics-7/../pvxs/include/pvxs/data.h:682:51: error: no type named 'store_t' in 'pvxs::impl::StoreAs<std::nullptr_t>' {aka 'struct pvxs::impl::StorageMap<std::nullptr_t, void>'}
  682 |         const typename impl::StoreAs<T>::store_t& norm(impl::StoreTransform<T>::in(val));
      |                                                   ^~~~
../../../epics-7/../pvxs/include/pvxs/data.h:682:51: error: no type named 'store_t' in 'pvxs::impl::StoreAs<std::nullptr_t>' {aka 'struct pvxs::impl::StorageMap<std::nullptr_t, void>'}
../../../epics-7/../pvxs/include/pvxs/data.h:683:41: error: 'code' is not a member of 'pvxs::impl::StoreAs<std::nullptr_t>' {aka 'pvxs::impl::StorageMap<std::nullptr_t, void>'}
  683 |         copyIn(&norm, impl::StoreAs<T>::code);
      |                                         ^~~~
make[2]: *** [../../../epics-7/configure/RULES_BUILD:267: _p4p.o] Error 1

I tried changing the line to be u._from(<void*>NULL);, but the error was similar, just using T = void * instead. Removing the else branch of the conditional fixed the build, but I have no idea if that's correct, or what a more adequate fix would be.

mdavidsaver commented 1 year ago

This should be fixed by e2eb24e709466594c397d8c97e58c107735cfde6. I am now surprised that this line ever worked.

ericonr commented 1 year ago

Indeed! Thanks :)