Re: [bug-report]rdma-core v51.0 build error with Rocky Linux 8.8

Jason Gunthorpe
2024-05-24T16:57:07Z

On Fri, May 24, 2024 at 04:40:20PM +0000, Marciniszyn, Mike wrote:
> > > /home/mmarcini/rpmbuild/BUILDROOT/rdma-core-51.0-1.el8.x86_64/usr/shar
> > > e/doc/rdma-core/tests/*.py
> > >
> > > Earlier in the build this is seen:
> > > -- Found Python: /usr/bin/python3.9 (found version "3.9.16") found
> > > components: Interpreter
> > > -- Could NOT find cython (missing: CYTHON_EXECUTABLE
> > > CYTHON_VERSION_STRING)
> > >
> > > The issue appears to have been introduced by:
> > > 1462a8737 build: Fix cmake warning
> > >
> > > cmake appears to find the 3.9 python despite having:
> > > -DPYTHON_EXECUTABLE:PATH=%{__python3}
> >
> > I looked at this briefly but didn't guess what the issue really was?
> > Do you know more?
> >
> > Jason
>
> I looks like the above commit changes the cmake to use a new >= 3.12 code path:
>
> # FindPython looks preferably for Python3. If not found, version 2 is searched
> FIND_PACKAGE(Python COMPONENTS Interpreter REQUIRED)
> set(PYTHON_EXECUTABLE ${Python_EXECUTABLE})
> if (NOT NO_PYVERBS AND Python_VERSION_MAJOR EQUAL 3)
> FIND_PACKAGE(cython)
> endif()
>
> There is an additional refinement from:
> 5dcc1f402 Improve python searching logic in buildscripts.
>
> That patch does NOT fix the issue.
>
> The rhel 8.10 cython requires the 3.6.8 Python, but the FIND_PACKAGE() for python
> returns the python3.11 required by valgrind dependency resolution.
>
> The issue happens on any system where the cython required interpreter is older than the most recent python.
>
> This can be reproduced by loading a newer python and rebuilding the 51.0 rdma-core from a git clone using either 51.0 or master.
>
> An RPM based RHEL build can replace the existing PYTHON_EXECUABLE
> with Python_EXECUTABLE.

You mean at some point we lost that PYTHON_EXECUTABLE works and it got
renamed to Python_EXECUTABLE ?

Jason