Bug 2377370 - petsc: Stop using deprecated %py3_build/%py3_install macros
Summary: petsc: Stop using deprecated %py3_build/%py3_install macros
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: petsc
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Antonio T. sagitter
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 2376118 2387582
TreeView+ depends on / blocked
 
Reported: 2025-07-08 14:12 UTC by Miro Hrončok
Modified: 2026-01-13 22:08 UTC (History)
0 users

Fixed In Version: petsc-3.24.3-4.fc44
Clone Of:
Environment:
Last Closed: 2026-01-13 22:08:27 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Gitlab petsc petsc issues 1800 0 None opened Broken cpython libraries when pyproject.toml is used 2025-08-13 12:58:29 UTC

Description Miro Hrončok 2025-07-08 14:12:50 UTC
Dear package maintainer,

this bugzilla is automated becasue the number of impacted packages it too high to go trough manually.


It appears that your package uses the deprecated %py3_build and/or %py3_install macro.

See https://fedoraproject.org/wiki/Changes/DeprecateSetuppyMacros for why the macros are deprecated.

%py3_install expands to python setup.py install. This has been a deprecated command for 5 years and will likely stop working in Fedora 45.



Please migrate to %pyproject_buildrequires + %pyproject_wheel + %pyproject_install macros instead.

See https://fedoraproject.org/wiki/Changes/DeprecateSetuppyMacros#Migrating_to_%pyproject_macros for migration guide.

See https://github.com/hroncok/pyprojectize/ for a tool that can help you automate the migration.


Thank you. Let me know if you need help.

Comment 1 Antonio T. sagitter 2025-08-09 20:19:11 UTC
Looks like %pyproject_install is changing PETSc.cpython-313-x86_64-linux-gnu.so that is correctly compiled

$ ldd ./PETSc.cpython-313-x86_64-linux-gnu.so
	linux-vdso.so.1 (0x00007f57a3d32000)
	libpetsc.so.3.23 => /home/sagitter/rpmbuild/BUILD/petsc-3.23.5-build/petsc-3.23.5/buildopenmpi_dir/x86_64/lib/libpetsc.so.3.23 (0x00007f57a1a00000)
	libmpi.so.40 => /usr/lib64/openmpi/lib/libmpi.so.40 (0x00007f57a1600000)
	libc.so.6 => /lib64/libc.so.6 (0x00007f57a140f000)
	libHYPRE.so.2.1 => /usr/lib64/openmpi/lib/libHYPRE.so.2.1 (0x00007f57a0e00000)
	libsuperlu_dist.so.8 => /usr/lib64/openmpi/lib/libsuperlu_dist.so.8 (0x00007f57a0ca2000)
	libdmumps-5.7.so => /usr/lib64/openmpi/lib/libdmumps-5.7.so (0x00007f57a0a00000)
	libscalapack.so.2 => /usr/lib64/openmpi/lib/libscalapack.so.2 (0x00007f57a0400000)
	libflexiblas.so.3 => /lib64/libflexiblas.so.3 (0x00007f57a0000000)
	libptscotch.so.7.0 => /usr/lib64/openmpi/lib/libptscotch.so.7.0 (0x00007f57a3584000)
	libscotch.so.7.0 => /usr/lib64/openmpi/lib/libscotch.so.7.0 (0x00007f57a34f0000)
	libmetis.so.0 => /lib64/libmetis.so.0 (0x00007f57a1992000)
	libhdf5.so.310 => /usr/lib64/openmpi/lib/libhdf5.so.310 (0x00007f579fa00000)
	libm.so.6 => /lib64/libm.so.6 (0x00007f579ff12000)
	libX11.so.6 => /lib64/libX11.so.6 (0x00007f579f8bb000)
	libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f579f600000)
	libmpi_mpifh.so.40 => /usr/lib64/openmpi/lib/libmpi_mpifh.so.40 (0x00007f57a13a2000)
	libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f57a34c4000)
	libpvfs2.so.2.9.7 => /lib64/libpvfs2.so.2.9.7 (0x00007f579f501000)
	libpsm2.so.2 => /lib64/libpsm2.so.2 (0x00007f57a0396000)
	libopen-pal.so.80 => /usr/lib64/openmpi/lib/libopen-pal.so.80 (0x00007f579f405000)
	libfabric.so.1 => /lib64/libfabric.so.1 (0x00007f579ee00000)
	libucp.so.0 => /lib64/libucp.so.0 (0x00007f579fe43000)
	libucs.so.0 => /lib64/libucs.so.0 (0x00007f579f3a2000)
	libucm.so.0 => /lib64/libucm.so.0 (0x00007f57a1385000)
	libuct.so.0 => /lib64/libuct.so.0 (0x00007f57a0c67000)
	libevent_core-2.1.so.7 => /lib64/libevent_core-2.1.so.7 (0x00007f57a09c7000)
	libevent_pthreads-2.1.so.7 => /lib64/libevent_pthreads-2.1.so.7 (0x00007f57a3d1d000)
	libhwloc.so.15 => /lib64/libhwloc.so.15 (0x00007f579f33e000)
	libpmix.so.2 => /lib64/libpmix.so.2 (0x00007f579ec17000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f57a3d34000)
	libgomp.so.1 => /lib64/libgomp.so.1 (0x00007f579ebbf000)
	libptscotcherr.so.7.0 => /usr/lib64/openmpi/lib/libptscotcherr.so.7.0 (0x00007f57a3d17000)
	libptscotcherrexit.so.7.0 => /usr/lib64/openmpi/lib/libptscotcherrexit.so.7.0 (0x00007f57a3d13000)
	libcolamd.so.3 => /lib64/libcolamd.so.3 (0x00007f57a34bb000)
	libblas.so => /usr/lib64/openmpi/lib/libblas.so (0x00007f57a136b000)
	libmumps_common-5.7.so => /usr/lib64/openmpi/lib/libmumps_common-5.7.so (0x00007f579eb52000)
	libptscotchparmetisv3.so.7.0 => /usr/lib64/openmpi/lib/libptscotchparmetisv3.so.7.0 (0x00007f57a34b5000)
	libpord-5.7.so => /usr/lib64/openmpi/lib/libpord-5.7.so (0x00007f57a09ad000)
	libesmumps.so.7.0 => /usr/lib64/openmpi/lib/libesmumps.so.7.0 (0x00007f57a1989000)
	libscotcherr.so.7.0 => /usr/lib64/openmpi/lib/libscotcherr.so.7.0 (0x00007f57a34af000)
	libptesmumps.so.7.0 => /usr/lib64/openmpi/lib/libptesmumps.so.7.0 (0x00007f57a1980000)
	libmpi_usempif08.so.40 => /usr/lib64/openmpi/lib/libmpi_usempif08.so.40 (0x00007f579f87c000)
	libmpi_usempi_ignore_tkr.so.40 => /usr/lib64/openmpi/lib/libmpi_usempi_ignore_tkr.so.40 (0x00007f57a0c58000)
	libgfortran.so.5 => /lib64/libgfortran.so.5 (0x00007f579e800000)
	libquadmath.so.0 => /lib64/libquadmath.so.0 (0x00007f579e7b9000)
	libz.so.1 => /lib64/libz.so.1 (0x00007f579e796000)
	libbz2.so.1 => /lib64/libbz2.so.1 (0x00007f579fe2e000)
	liblzma.so.5 => /lib64/liblzma.so.5 (0x00007f579e761000)
	libpcre2-posix.so.3 => /lib64/libpcre2-posix.so.3 (0x00007f57a1367000)
	libsz.so.2 => /lib64/libsz.so.2 (0x00007f57a0c4e000)
	libxcb.so.1 => /lib64/libxcb.so.1 (0x00007f579e737000)
	libcrypto.so.3 => /lib64/libcrypto.so.3 (0x00007f579e200000)
	libibverbs.so.1 => /lib64/libibverbs.so.1 (0x00007f579e717000)
	libnuma.so.1 => /lib64/libnuma.so.1 (0x00007f57a0388000)
	librdmacm.so.1 => /lib64/librdmacm.so.1 (0x00007f579e6fb000)
	libefa.so.1 => /lib64/libefa.so.1 (0x00007f579e6ef000)
	libnl-3.so.200 => /lib64/libnl-3.so.200 (0x00007f579e6cd000)
	libnl-route-3.so.200 => /lib64/libnl-route-3.so.200 (0x00007f579e16b000)
	libuuid.so.1 => /lib64/libuuid.so.1 (0x00007f579fe25000)
	libudev.so.1 => /lib64/libudev.so.1 (0x00007f579e124000)
	libmunge.so.2 => /lib64/libmunge.so.2 (0x00007f579e6c5000)
	libsuitesparseconfig.so.7 => /lib64/libsuitesparseconfig.so.7 (0x00007f579f877000)
	libpcre2-8.so.0 => /lib64/libpcre2-8.so.0 (0x00007f579e079000)
	libXau.so.6 => /lib64/libXau.so.6 (0x00007f579e6bf000)
	libcap.so.2 => /lib64/libcap.so.2 (0x00007f579e6b3000)

But it is installed in buildroot as

$ ldd ./PETSc.cpython-313-x86_64-linux-gnu.so
	linux-vdso.so.1 (0x00007faf07940000)
	libpetsc.so.3.23 => not found
	libmpi.so.12 => not found
	libc.so.6 => /lib64/libc.so.6 (0x00007faf06fe0000)
	/lib64/ld-linux-x86-64.so.2 (0x00007faf07942000)

!?

You can see this behavior in latest petsc-3.23.5 build (https://koji.fedoraproject.org/koji/taskinfo?taskID=135875152); tests are disabled because ./PETSc.cpython-313-x86_64-linux-gnu.so is not working.

Since some days i'm trying to find a solution but without success.

Comment 2 Fedora Update System 2025-08-09 20:29:59 UTC
FEDORA-2025-8c03357409 (petsc-3.23.5-2.fc43) has been submitted as an update to Fedora 43.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-8c03357409

Comment 3 Fedora Update System 2025-08-09 20:34:14 UTC
FEDORA-2025-8c03357409 (petsc-3.23.5-2.fc43) has been pushed to the Fedora 43 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 4 Miro Hrončok 2025-08-11 10:27:52 UTC
(In reply to Antonio T. sagitter from comment #1)
> Looks like %pyproject_install is changing
> PETSc.cpython-313-x86_64-linux-gnu.so that is correctly compiled
> 
> $ ldd ./PETSc.cpython-313-x86_64-linux-gnu.so
> 	linux-vdso.so.1 (0x00007f57a3d32000)
> 	libpetsc.so.3.23 =>
> /home/sagitter/rpmbuild/BUILD/petsc-3.23.5-build/petsc-3.23.5/
> buildopenmpi_dir/x86_64/lib/libpetsc.so.3.23 (0x00007f57a1a00000)
> 	libmpi.so.40 => /usr/lib64/openmpi/lib/libmpi.so.40 (0x00007f57a1600000)
> 	libc.so.6 => /lib64/libc.so.6 (0x00007f57a140f000)
> 	libHYPRE.so.2.1 => /usr/lib64/openmpi/lib/libHYPRE.so.2.1
> (0x00007f57a0e00000)
> 	libsuperlu_dist.so.8 => /usr/lib64/openmpi/lib/libsuperlu_dist.so.8
> (0x00007f57a0ca2000)
> 	libdmumps-5.7.so => /usr/lib64/openmpi/lib/libdmumps-5.7.so
> (0x00007f57a0a00000)
> 	libscalapack.so.2 => /usr/lib64/openmpi/lib/libscalapack.so.2
> (0x00007f57a0400000)
> 	libflexiblas.so.3 => /lib64/libflexiblas.so.3 (0x00007f57a0000000)
> 	libptscotch.so.7.0 => /usr/lib64/openmpi/lib/libptscotch.so.7.0
> (0x00007f57a3584000)
> 	libscotch.so.7.0 => /usr/lib64/openmpi/lib/libscotch.so.7.0
> (0x00007f57a34f0000)
> 	libmetis.so.0 => /lib64/libmetis.so.0 (0x00007f57a1992000)
> 	libhdf5.so.310 => /usr/lib64/openmpi/lib/libhdf5.so.310 (0x00007f579fa00000)
> 	libm.so.6 => /lib64/libm.so.6 (0x00007f579ff12000)
> 	libX11.so.6 => /lib64/libX11.so.6 (0x00007f579f8bb000)
> 	libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f579f600000)
> 	libmpi_mpifh.so.40 => /usr/lib64/openmpi/lib/libmpi_mpifh.so.40
> (0x00007f57a13a2000)
> 	libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f57a34c4000)
> 	libpvfs2.so.2.9.7 => /lib64/libpvfs2.so.2.9.7 (0x00007f579f501000)
> 	libpsm2.so.2 => /lib64/libpsm2.so.2 (0x00007f57a0396000)
> 	libopen-pal.so.80 => /usr/lib64/openmpi/lib/libopen-pal.so.80
> (0x00007f579f405000)
> 	libfabric.so.1 => /lib64/libfabric.so.1 (0x00007f579ee00000)
> 	libucp.so.0 => /lib64/libucp.so.0 (0x00007f579fe43000)
> 	libucs.so.0 => /lib64/libucs.so.0 (0x00007f579f3a2000)
> 	libucm.so.0 => /lib64/libucm.so.0 (0x00007f57a1385000)
> 	libuct.so.0 => /lib64/libuct.so.0 (0x00007f57a0c67000)
> 	libevent_core-2.1.so.7 => /lib64/libevent_core-2.1.so.7 (0x00007f57a09c7000)
> 	libevent_pthreads-2.1.so.7 => /lib64/libevent_pthreads-2.1.so.7
> (0x00007f57a3d1d000)
> 	libhwloc.so.15 => /lib64/libhwloc.so.15 (0x00007f579f33e000)
> 	libpmix.so.2 => /lib64/libpmix.so.2 (0x00007f579ec17000)
> 	/lib64/ld-linux-x86-64.so.2 (0x00007f57a3d34000)
> 	libgomp.so.1 => /lib64/libgomp.so.1 (0x00007f579ebbf000)
> 	libptscotcherr.so.7.0 => /usr/lib64/openmpi/lib/libptscotcherr.so.7.0
> (0x00007f57a3d17000)
> 	libptscotcherrexit.so.7.0 =>
> /usr/lib64/openmpi/lib/libptscotcherrexit.so.7.0 (0x00007f57a3d13000)
> 	libcolamd.so.3 => /lib64/libcolamd.so.3 (0x00007f57a34bb000)
> 	libblas.so => /usr/lib64/openmpi/lib/libblas.so (0x00007f57a136b000)
> 	libmumps_common-5.7.so => /usr/lib64/openmpi/lib/libmumps_common-5.7.so
> (0x00007f579eb52000)
> 	libptscotchparmetisv3.so.7.0 =>
> /usr/lib64/openmpi/lib/libptscotchparmetisv3.so.7.0 (0x00007f57a34b5000)
> 	libpord-5.7.so => /usr/lib64/openmpi/lib/libpord-5.7.so (0x00007f57a09ad000)
> 	libesmumps.so.7.0 => /usr/lib64/openmpi/lib/libesmumps.so.7.0
> (0x00007f57a1989000)
> 	libscotcherr.so.7.0 => /usr/lib64/openmpi/lib/libscotcherr.so.7.0
> (0x00007f57a34af000)
> 	libptesmumps.so.7.0 => /usr/lib64/openmpi/lib/libptesmumps.so.7.0
> (0x00007f57a1980000)
> 	libmpi_usempif08.so.40 => /usr/lib64/openmpi/lib/libmpi_usempif08.so.40
> (0x00007f579f87c000)
> 	libmpi_usempi_ignore_tkr.so.40 =>
> /usr/lib64/openmpi/lib/libmpi_usempi_ignore_tkr.so.40 (0x00007f57a0c58000)
> 	libgfortran.so.5 => /lib64/libgfortran.so.5 (0x00007f579e800000)
> 	libquadmath.so.0 => /lib64/libquadmath.so.0 (0x00007f579e7b9000)
> 	libz.so.1 => /lib64/libz.so.1 (0x00007f579e796000)
> 	libbz2.so.1 => /lib64/libbz2.so.1 (0x00007f579fe2e000)
> 	liblzma.so.5 => /lib64/liblzma.so.5 (0x00007f579e761000)
> 	libpcre2-posix.so.3 => /lib64/libpcre2-posix.so.3 (0x00007f57a1367000)
> 	libsz.so.2 => /lib64/libsz.so.2 (0x00007f57a0c4e000)
> 	libxcb.so.1 => /lib64/libxcb.so.1 (0x00007f579e737000)
> 	libcrypto.so.3 => /lib64/libcrypto.so.3 (0x00007f579e200000)
> 	libibverbs.so.1 => /lib64/libibverbs.so.1 (0x00007f579e717000)
> 	libnuma.so.1 => /lib64/libnuma.so.1 (0x00007f57a0388000)
> 	librdmacm.so.1 => /lib64/librdmacm.so.1 (0x00007f579e6fb000)
> 	libefa.so.1 => /lib64/libefa.so.1 (0x00007f579e6ef000)
> 	libnl-3.so.200 => /lib64/libnl-3.so.200 (0x00007f579e6cd000)
> 	libnl-route-3.so.200 => /lib64/libnl-route-3.so.200 (0x00007f579e16b000)
> 	libuuid.so.1 => /lib64/libuuid.so.1 (0x00007f579fe25000)
> 	libudev.so.1 => /lib64/libudev.so.1 (0x00007f579e124000)
> 	libmunge.so.2 => /lib64/libmunge.so.2 (0x00007f579e6c5000)
> 	libsuitesparseconfig.so.7 => /lib64/libsuitesparseconfig.so.7
> (0x00007f579f877000)
> 	libpcre2-8.so.0 => /lib64/libpcre2-8.so.0 (0x00007f579e079000)
> 	libXau.so.6 => /lib64/libXau.so.6 (0x00007f579e6bf000)
> 	libcap.so.2 => /lib64/libcap.so.2 (0x00007f579e6b3000)
> 
> But it is installed in buildroot as
> 
> $ ldd ./PETSc.cpython-313-x86_64-linux-gnu.so
> 	linux-vdso.so.1 (0x00007faf07940000)
> 	libpetsc.so.3.23 => not found
> 	libmpi.so.12 => not found
> 	libc.so.6 => /lib64/libc.so.6 (0x00007faf06fe0000)
> 	/lib64/ld-linux-x86-64.so.2 (0x00007faf07942000)
> 
> !?
> 
> You can see this behavior in latest petsc-3.23.5 build
> (https://koji.fedoraproject.org/koji/taskinfo?taskID=135875152); tests are
> disabled because ./PETSc.cpython-313-x86_64-linux-gnu.so is not working.
> 
> Since some days i'm trying to find a solution but without success.

I am not entirely sure I understand the problem. Could you please describe this better, preferably at python-devel mailing list or in another (not closed) bugzilla?

Comment 5 Antonio T. sagitter 2025-08-11 12:23:39 UTC
Ticket reopened.

> I am not entirely sure I understand the problem. Could you please describe this better, preferably at python-devel mailing list or in another (not closed) bugzilla?

Sorry.

I have modified PETSc SPEC file to use %pyproject_wheel and %pyproject_install; starting build release 3.23.5-2, the rpms are successfully built but the `PETSc.cpython-313-x86_64-linux-gnu.so` library is broke somewhere during RPM builds.

If you try to locally rebuild this srpm https://koji.fedoraproject.org/koji/buildinfo?buildID=2787896, you'll see that the cpython library compiled in the buildsrc/buildopenmpi_dir/src/binding/petsc4py/build/lib.linux-x86_64-cpython-313/petsc4py/lib/x86_64/ (correctly compiled and linked to libmpi.so.40 in Fedora 42) is different by the same cpython library installed in the BUILDROOT/usr/lib64/python3.13/site-packages/openmpi/petsc4py/lib/x86_64/ (linked to libmpi.so.12 !!).

This not happen if i switch back to the old %py3_install

Comment 6 Antonio T. sagitter 2025-08-11 12:26:55 UTC
In fact, https://bugzilla.redhat.com/show_bug.cgi?id=2387582

Comment 7 Miro Hrončok 2025-08-11 17:13:24 UTC
Could this have something to do with the fixPythonWheel added in https://gitlab.com/petsc/petsc/-/commit/5ee53db2299ec483123346965f05fffc8e6cbc9f ?
Later amended by https://gitlab.com/petsc/petsc/-/commit/6e8294f68f5aed480a30b64681aaabebca5c529b


Try adding this into %prep:

  sed -i 's/self.fixPythonWheel()/pass/' %{name}-%{version}/config/install.py

And see if it helps.

-------------


As a side note I realized you run %pyproject_buildrequires in %prep, not in %generate_buildrequires section. That does nothing.

Comment 8 Antonio T. sagitter 2025-08-11 21:12:37 UTC
I have added the sed command, it did not work unfortunately.

(In reply to Miro Hrončok from comment #7)
> Could this have something to do with the fixPythonWheel added in
> https://gitlab.com/petsc/petsc/-/commit/
> 5ee53db2299ec483123346965f05fffc8e6cbc9f ?
> Later amended by
> https://gitlab.com/petsc/petsc/-/commit/
> 6e8294f68f5aed480a30b64681aaabebca5c529b
> 
> 
> Try adding this into %prep:
> 
>   sed -i 's/self.fixPythonWheel()/pass/' %{name}-%{version}/config/install.py
> 
> And see if it helps.
> 
> -------------
> 
> 
> As a side note I realized you run %pyproject_buildrequires in %prep, not in
> %generate_buildrequires section. That does nothing.

Comment 9 Miro Hrončok 2025-08-11 21:17:59 UTC
Let's revert the changes for now, then?

Comment 10 Antonio T. sagitter 2025-08-12 13:23:46 UTC
(In reply to Miro Hrončok from comment #9)
> Let's revert the changes for now, then?

Yes. I will contact the upstream maintainer about this issue.

Comment 11 Antonio T. sagitter 2025-08-14 12:24:28 UTC
Regard to my comment in upstream issue (https://gitlab.com/petsc/petsc/-/issues/1800#note_2686551393), can %pyproject_wheel be used two times in a SPEC file?

Comment 12 Miro Hrončok 2025-08-14 12:33:33 UTC
Yes it can, but it was not designed with mpich/openmpi/etc. in mind. Likely one wheel overrides the other here.

See also https://bugzilla.redhat.com/show_bug.cgi?id=2377285#c3

Comment 13 Fedora Admin user for bugzilla script actions 2026-01-05 04:10:42 UTC
This package has changed maintainer in Fedora. Reassigning to the new maintainer of this component.

Comment 14 Fedora Update System 2026-01-13 21:18:39 UTC
FEDORA-2026-152ccac3c1 (petsc-3.24.3-4.fc44) has been submitted as an update to Fedora 44.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-152ccac3c1

Comment 15 Fedora Update System 2026-01-13 22:08:27 UTC
FEDORA-2026-152ccac3c1 (petsc-3.24.3-4.fc44) has been pushed to the Fedora 44 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.