petsc fails to build with Python 3.10.0b1: + make V=1 MAKE_NP=2 PETSC_DIR=/builddir/build/BUILD/petsc-3.15.0/petsc-3.15.0 PETSC_ARCH=x86_64 all /usr/bin/python3 ./config/gmakegen.py --petsc-arch=x86_64 /builddir/build/BUILD/petsc-3.15.0/petsc-3.15.0/./config/gmakegen.py:4: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives from distutils.sysconfig import parse_makefile /builddir/build/BUILD/petsc-3.15.0/petsc-3.15.0/./config/gmakegen.py:4: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead from distutils.sysconfig import parse_makefile Traceback (most recent call last): File "/builddir/build/BUILD/petsc-3.15.0/petsc-3.15.0/./config/gmakegen.py", line 345, in <module> main(petsc_arch=opts.petsc_arch, pkg_dir=opts.pkg_dir, pkg_name=opts.pkg_name, pkg_arch=opts.pkg_arch, pkg_pkgs=opts.pkg_pkgs, output=opts.output, verbose=opts.verbose) File "/builddir/build/BUILD/petsc-3.15.0/petsc-3.15.0/./config/gmakegen.py", line 328, in main petsc.summary() File "/builddir/build/BUILD/petsc-3.15.0/petsc-3.15.0/./config/gmakegen.py", line 255, in summary self.mistakes.summary() File "/builddir/build/BUILD/petsc-3.15.0/petsc-3.15.0/./config/gmakegen.py", line 79, in summary raise RuntimeError('PETSc makefiles contain mistakes or files are missing on filesystem.\n%s\nPossible reasons:\n\t1. Files were deleted locally, try "hg revert filename" or "git checkout filename".\n\t2. Files were deleted from repository, but were not removed from makefile. Send mail to petsc-maint.gov.\n\t3. Someone forgot to "add" new files to the repository. Send mail to petsc-maint.gov.' % ('\n'.join(self.mistakes))) RuntimeError: PETSc makefiles contain mistakes or files are missing on filesystem. Makefile contains directory not on filesystem: /builddir/build/BUILD/petsc-3.15.0/petsc-3.15.0/src/sys: ['\\'] Makefile contains directory not on filesystem: /builddir/build/BUILD/petsc-3.15.0/petsc-3.15.0/src/mat/impls/aij/seq: ['\\'] Makefile contains directory not on filesystem: /builddir/build/BUILD/petsc-3.15.0/petsc-3.15.0/src/ksp/ksp/impls: ['\\'] Makefile contains directory not on filesystem: /builddir/build/BUILD/petsc-3.15.0/petsc-3.15.0/src/ksp/pc/impls: ['ml\\'] Makefile contains directory not on filesystem: /builddir/build/BUILD/petsc-3.15.0/petsc-3.15.0/src/tao/complementarity/impls: ['#', 'isls', 'rscs'] Possible reasons: 1. Files were deleted locally, try "hg revert filename" or "git checkout filename". 2. Files were deleted from repository, but were not removed from makefile. Send mail to petsc-maint.gov. 3. Someone forgot to "add" new files to the repository. Send mail to petsc-maint.gov. gmakefile:67: x86_64/lib/petsc/conf/files: No such file or directory For the build logs, see: https://copr-be.cloud.fedoraproject.org/results/@python/python3.10/fedora-rawhide-x86_64/02175460-petsc/ For all our attempts to build petsc with Python 3.10, see: https://copr.fedorainfracloud.org/coprs/g/python/python3.10/package/petsc/ Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.10: https://copr.fedorainfracloud.org/coprs/g/python/python3.10/ Let us know here if you have any questions. Python 3.10 will be included in Fedora 35. To make that update smoother, we're building Fedora packages with early pre-releases of Python 3.10. A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon. We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.
Hi Miro. How is imported `parse_makefile` with Python-3.10?
I am sorry, but I don't understand your question.
Created attachment 1782125 [details] gmakegen.py petsc is failing with: + make V=1 MAKE_NP=2 PETSC_DIR=/builddir/build/BUILD/petsc-3.15.0/petsc-3.15.0 PETSC_ARCH=x86_64 all /usr/bin/python3 ./config/gmakegen.py --petsc-arch=x86_64 Traceback (most recent call last): File "/builddir/build/BUILD/petsc-3.15.0/petsc-3.15.0/./config/gmakegen.py", line 4, in <module> from sysconfig import parse_makefile ImportError: cannot import name 'parse_makefile' from 'sysconfig' (/usr/lib64/python3.10/sysconfig.py) gmakefile:67: x86_64/lib/petsc/conf/files: No such file or directory
Line 4 is actually "from distutils.sysconfig import parse_makefile" [~]$ python3.9 Python 3.9.5 (default, May 4 2021, 00:00:00) [GCC 10.3.1 20210422 (Red Hat 10.3.1-1)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from distutils.sysconfig import parse_makefile >>> [~]$ python3.10 Python 3.10.0b1 (default, May 4 2021, 00:00:00) [GCC 10.3.1 20210422 (Red Hat 10.3.1-1)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from distutils.sysconfig import parse_makefile <stdin>:1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives <stdin>:1: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead >>> Works in both versions, but is deprecated. Not sure where "from sysconfig import parse_makefile" comes from.
I don't know how to fix this error. Please, take a look.
(In reply to Antonio T. sagitter from comment #5) > I don't know how to fix this error. > Please, take a look. I refer to https://bugzilla.redhat.com/show_bug.cgi?id=1959088#c0
This is a mass-posted update. Sorry if it is not 100% accurate to this bugzilla. The Python 3.10 rebuild is in progress in a Koji side tag. If you manage to fix the problem, please commit the fix in the rawhide branch, but don't build the package in regular rawhide. You can either build the package in the side tag, with: $ fedpkg build --target=f35-python Or you can the build and we will eventually build it for you. Note that the rebuild is still in progress, so not all (build) dependencies of this package might be available right away. Thanks. See also https://fedoraproject.org/wiki/Changes/Python3.10 If you have general questions about the rebuild, please use this mailing list thread: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/G47SGOYIQLRDTWGOSLSWERZSSHXDEDH5/
The f35-python side tag has been merged to Rawhide. From now on, build as you would normally build.
*** Bug 1968855 has been marked as a duplicate of this bug. ***
I've set PYTHONWARNINGS=ignore::DeprecationWarning to verify the DeprecationWarning is not the problem. + make V=1 MAKE_NP=8 PETSC_DIR=/builddir/build/BUILD/petsc-3.15.0/petsc-3.15.0 PETSC_ARCH=x86_64 all /usr/bin/python3 ./config/gmakegen.py --petsc-arch=x86_64 Traceback (most recent call last): File "/builddir/build/BUILD/petsc-3.15.0/petsc-3.15.0/./config/gmakegen.py", line 345, in <module> main(petsc_arch=opts.petsc_arch, pkg_dir=opts.pkg_dir, pkg_name=opts.pkg_name, pkg_arch=opts.pkg_arch, pkg_pkgs=opts.pkg_pkgs, output=opts.output, verbose=opts.verbose) File "/builddir/build/BUILD/petsc-3.15.0/petsc-3.15.0/./config/gmakegen.py", line 328, in main petsc.summary() File "/builddir/build/BUILD/petsc-3.15.0/petsc-3.15.0/./config/gmakegen.py", line 255, in summary self.mistakes.summary() File "/builddir/build/BUILD/petsc-3.15.0/petsc-3.15.0/./config/gmakegen.py", line 79, in summary raise RuntimeError('PETSc makefiles contain mistakes or files are missing on filesystem.\n%s\nPossible reasons:\n\t1. Files were deleted locally, try "hg revert filename" or "git checkout filename".\n\t2. Files were deleted from repository, but were not removed from makefile. Send mail to petsc-maint.gov.\n\t3. Someone forgot to "add" new files to the repository. Send mail to petsc-maint.gov.' % ('\n'.join(self.mistakes))) RuntimeError: PETSc makefiles contain mistakes or files are missing on filesystem. Makefile contains directory not on filesystem: /builddir/build/BUILD/petsc-3.15.0/petsc-3.15.0/src/sys: ['\\'] Makefile contains directory not on filesystem: /builddir/build/BUILD/petsc-3.15.0/petsc-3.15.0/src/mat/impls/aij/seq: ['\\'] Makefile contains directory not on filesystem: /builddir/build/BUILD/petsc-3.15.0/petsc-3.15.0/src/ksp/pc/impls: ['ml\\'] Makefile contains directory not on filesystem: /builddir/build/BUILD/petsc-3.15.0/petsc-3.15.0/src/ksp/ksp/impls: ['\\'] Makefile contains directory not on filesystem: /builddir/build/BUILD/petsc-3.15.0/petsc-3.15.0/src/tao/complementarity/impls: ['#', 'isls', 'rscs'] Possible reasons: 1. Files were deleted locally, try "hg revert filename" or "git checkout filename". 2. Files were deleted from repository, but were not removed from makefile. Send mail to petsc-maint.gov. 3. Someone forgot to "add" new files to the repository. Send mail to petsc-maint.gov. gmakefile:67: x86_64/lib/petsc/conf/files: No such file or directory make: *** [gmakefile:63: x86_64/lib/petsc/conf/files] Error 1 make: *** Deleting file 'x86_64/lib/petsc/conf/files' And I found the cause: [petsc]$ cd petsc-3.15.0/petsc-3.15.0/src/ksp/pc/impls [impls]$ python3.9 Python 3.9.5 (default, May 14 2021, 00:00:00) [GCC 10.3.1 20210422 (Red Hat 10.3.1-1)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from distutils.sysconfig import parse_makefile >>> makevars = parse_makefile('makefile') >>> makevars.get('DIRS','').split() ['jacobi', 'none', 'sor', 'shell', 'bjacobi', 'mg', 'eisens', 'asm', 'ksp', 'composite', 'redundant', 'spai', 'is', 'pbjacobi', 'vpbjacobi', 'ml', 'mat', 'hypre', 'tfs', 'fieldsplit', 'factor', 'galerkin', 'cp', 'wb', 'python', 'chowiluviennacl', 'chowiluviennaclcuda', 'rowscalingviennacl', 'rowscalingviennaclcuda', 'saviennacl', 'saviennaclcuda', 'lsc', 'redistribute', 'gasm', 'svd', 'gamg', 'parms', 'bddc', 'kaczmarz', 'telescope', 'patch', 'lmvm', 'hmg', 'deflation', 'hpddm', 'hara'] [impls]$ python3.10 Python 3.10.0b2 (default, Jun 1 2021, 00:00:00) [GCC 10.3.1 20210422 (Red Hat 10.3.1-1)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from distutils.sysconfig import parse_makefile <stdin>:1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives <stdin>:1: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead >>> makevars = parse_makefile('makefile') >>> makevars.get('DIRS','').split() ['jacobi', 'none', 'sor', 'shell', 'bjacobi', 'mg', 'eisens', 'asm', 'ksp', 'composite', 'redundant', 'spai', 'is', 'pbjacobi', 'vpbjacobi', 'ml\\'] [petsc]$ cd petsc-3.15.0/petsc-3.15.0/src/ksp/ksp/impls [impls]$ python3.9 Python 3.9.5 (default, May 14 2021, 00:00:00) [GCC 10.3.1 20210422 (Red Hat 10.3.1-1)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from distutils.sysconfig import parse_makefile >>> makevars = parse_makefile('makefile') >>> makevars.get('DIRS','').split() ['cr', 'bcgs', 'bcgsl', 'cg', 'cgs', 'gmres', 'cheby', 'rich', 'lsqr', 'preonly', 'tcqmr', 'tfqmr', 'qcg', 'bicg', 'minres', 'symmlq', 'lcd', 'ibcgs', 'python', 'gcr', 'fcg', 'tsirm', 'fetidp', 'hpddm'] [impls]$ python3.10 Python 3.10.0b2 (default, Jun 1 2021, 00:00:00) [GCC 10.3.1 20210422 (Red Hat 10.3.1-1)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from distutils.sysconfig import parse_makefile <stdin>:1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives <stdin>:1: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead >>> makevars = parse_makefile('makefile') >>> makevars.get('DIRS','').split() ['cr', 'bcgs', 'bcgsl', 'cg', 'cgs', 'gmres', 'cheby', 'rich', 'lsqr', 'preonly', 'tcqmr', 'tfqmr', '\\'] [petsc]$ cd petsc-3.15.0/petsc-3.15.0/src/tao/complementarity/impls [impls]$ python3.9 Python 3.9.5 (default, May 14 2021, 00:00:00) [GCC 10.3.1 20210422 (Red Hat 10.3.1-1)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from distutils.sysconfig import parse_makefile >>> makevars = parse_makefile('makefile') >>> makevars.get('DIRS','').split() ['ssls', 'asls'] [impls]$ python3.10 Python 3.10.0b2 (default, Jun 1 2021, 00:00:00) [GCC 10.3.1 20210422 (Red Hat 10.3.1-1)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from distutils.sysconfig import parse_makefile <stdin>:1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives <stdin>:1: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead >>> makevars = parse_makefile('makefile') >>> makevars.get('DIRS','').split() ['ssls', 'asls', '#', 'isls', 'rscs'] parse_makefile chnaged behavior. I'll report that to Python upstream.
Reported as https://bugs.python.org/issue44351
I hope this will fix the build in the meantime: https://src.fedoraproject.org/rpms/petsc/pull-request/4
> I hope this will fix the build in the meantime: > https://src.fedoraproject.org/rpms/petsc/pull-request/4 Fixed. Thank you(In reply to Miro Hrončok from comment #12)