Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.12 incompatibilities #69

Open
ArrayBolt3 opened this issue Jan 21, 2024 · 1 comment
Open

Python 3.12 incompatibilities #69

ArrayBolt3 opened this issue Jan 21, 2024 · 1 comment

Comments

@ArrayBolt3
Copy link

abinit is incapable of building or running unit tests on an Ubuntu 24.04 Alpha system with Python 3.12 installed.

Steps to reproduce:

  1. Install abinit's dependencies on a system.
  2. Ensure Python 3.12 is installed and that python3 --version shows that Python 3.12 is in use.
  3. Attempt to build abinit.

Expected result: The build should succeed.

Actual result: The build fails with error output similar to the following (copied from a failed abinit package build on Ubuntu 24.04):

make[1]: Entering directory '/<<PKGBUILDDIR>>'
if [ ! -f Makefile.am ]; then config/scripts/makemake; fi
/<<PKGBUILDDIR>>/config/scripts/makemake:254: SyntaxWarning: invalid escape sequence '\;'
  "find src -name '*.~[0-9]~' -exec rm -f {} \;")
/<<PKGBUILDDIR>>/config/scripts/makemake:258: SyntaxWarning: invalid escape sequence '\;'
  "find . -depth -name 'tmp-*' -exec rm -rf {} \;")
/<<PKGBUILDDIR>>/config/scripts/makemake:260: SyntaxWarning: invalid escape sequence '\;'
  "find src -name '*.old' -exec rm -f {} \;")
/<<PKGBUILDDIR>>/config/scripts/makemake:262: SyntaxWarning: invalid escape sequence '\;'
  "find . -name '*.pyc' -o -name '*.pyo' -exec rm -f {} \;")
/<<PKGBUILDDIR>>/config/scripts/makemake:264: SyntaxWarning: invalid escape sequence '\;'
  "find . -depth -name '__pycache__' -exec rm -rf {} \;")
/<<PKGBUILDDIR>>/config/scripts/makemake:266: SyntaxWarning: invalid escape sequence '\;'
  "find shared/common/src -type l -exec rm -f {} \;")
/<<PKGBUILDDIR>>/config/scripts/makemake:268: SyntaxWarning: invalid escape sequence '\;'
  "find src -type l -exec rm -f {} \;")
/<<PKGBUILDDIR>>/config/scripts/makemake:283: SyntaxWarning: invalid escape sequence '\;'
  "find %s -name 'abinit.dep' -exec rm {} \;" % abinit_blocks[block])
/<<PKGBUILDDIR>>/config/scripts/makemake:285: SyntaxWarning: invalid escape sequence '\;'
  "find %s -name 'abinit.dir' -exec rm {} \;" % abinit_blocks[block])
/<<PKGBUILDDIR>>/config/scripts/makemake:289: SyntaxWarning: invalid escape sequence '\;'
  "find %s -name '*.abirules' -exec rm -f {} \;" % abinit_blocks[block])
/<<PKGBUILDDIR>>/config/scripts/makemake:291: SyntaxWarning: invalid escape sequence '\;'
  "find %s -name '*.abiauty' -exec rm -f {} \;" % abinit_blocks[block])
/<<PKGBUILDDIR>>/config/scripts/makemake:323: SyntaxWarning: invalid escape sequence '\;'
  "find %s -depth -name '.deps' -exec rm -rf {} \;" % dcln)
/<<PKGBUILDDIR>>/config/scripts/makemake:325: SyntaxWarning: invalid escape sequence '\;'
  "find %s -name Makefile.am -exec rm -f {} \;" % dcln)
/<<PKGBUILDDIR>>/config/scripts/makemake:327: SyntaxWarning: invalid escape sequence '\;'
  "find %s -name Makefile.in -exec rm -f {} \;" % dcln)
/<<PKGBUILDDIR>>/config/scripts/makemake:329: SyntaxWarning: invalid escape sequence '\;'
  "find %s -name Makefile -exec rm -f {} \;" % dcln)
/<<PKGBUILDDIR>>/config/scripts/makemake:331: SyntaxWarning: invalid escape sequence '\;'
  "find %s -name '*.a' -o -name '*.o' -exec rm {} \;" % dcln)
/<<PKGBUILDDIR>>/config/scripts/makemake:334: SyntaxWarning: invalid escape sequence '\;'
  "find %s -name '*.mod' -exec rm {} \;" % abinit_blocks[block])
/<<PKGBUILDDIR>>/config/scripts/makemake:336: SyntaxWarning: invalid escape sequence '\;'
  "find src -name '*.pickle' -exec rm {} \;")
/<<PKGBUILDDIR>>/config/scripts/makemake:346: SyntaxWarning: invalid escape sequence '\;'
  "find src -name 'interfaces_*.F90' -exec rm {} \;")
/<<PKGBUILDDIR>>/config/scripts/makemake:380: SyntaxWarning: invalid escape sequence '\;'
  "find . -name 'abinit.srcc' -exec rm {} \;")
/<<PKGBUILDDIR>>/config/scripts/makemake:382: SyntaxWarning: invalid escape sequence '\;'
  "find . -name '*.py[co]' -exec rm {} \;")
/<<PKGBUILDDIR>>/config/scripts/makemake:384: SyntaxWarning: invalid escape sequence '\;'
  "find . -depth -name '__pycache__' -exec rm -r {} \;")
/<<PKGBUILDDIR>>/config/scripts/makemake:386: SyntaxWarning: invalid escape sequence '\;'
  "find . -depth -name '_project_py[23].pickle' -exec rm {} \;")
/<<PKGBUILDDIR>>/config/scripts/makemake:427: SyntaxWarning: invalid escape sequence '\('
  ac_version = re.sub(".*\(GNU Autoconf\) ", "", ac_version)
/<<PKGBUILDDIR>>/config/scripts/makemake:435: SyntaxWarning: invalid escape sequence '\('
  am_version = re.sub(".*\(GNU automake\) ", "", am_version)
/<<PKGBUILDDIR>>/config/scripts/makemake:443: SyntaxWarning: invalid escape sequence '\('
  lt_version = re.sub(".*\(GNU libtool\) ", "", lt_version)
    /<<PKGBUILDDIR>>/./config/scripts/make-macros-options:256: SyntaxWarning: invalid escape sequence '\.'
      ret += """ if test "${%s}" != ""; then
    /<<PKGBUILDDIR>>/./config/scripts/make-macros-options:284: SyntaxWarning: invalid escape sequence '\!'
      ret += """ if test "${%s}" != ""; then
    /<<PKGBUILDDIR>>/./config/scripts/make-macros-options:340: SyntaxWarning: invalid escape sequence '\!'
      ret += """ if test "${%s}" != ""; then
    
    /<<PKGBUILDDIR>>/./config/scripts/make-macros-corelibs:91: SyntaxWarning: invalid escape sequence '\.'
      if ( re.search("\.cf$",cnf_file) ):
    
    /<<PKGBUILDDIR>>/./config/scripts/make-macros-triggers:360: SyntaxWarning: invalid escape sequence '\.'
      if ( re.search("\.cf$",cnf_file) ):
    
    /<<PKGBUILDDIR>>/./config/scripts/make-macros-output:102: SyntaxWarning: invalid escape sequence '\.'
      if ( re.search("\.cf$",cnf_file) ):
    
    /<<PKGBUILDDIR>>/./config/scripts/make-symlink-maker:84: SyntaxWarning: invalid escape sequence '\.'
      if ( re.search("\.cf$",cnf_file) ):
    
    /<<PKGBUILDDIR>>/./config/scripts/clean-build-examples:34: SyntaxWarning: invalid escape sequence '\.'
      re_cf = re.compile("\.cf$")
    
    /<<PKGBUILDDIR>>/./config/scripts/make-cppopts-dumper:32: SyntaxWarning: invalid escape sequence '\s'
      cppopts_dumper_module = """\
    /<<PKGBUILDDIR>>/./config/scripts/make-cppopts-dumper:147: SyntaxWarning: invalid escape sequence '\.'
      re_m4file  = re.compile("\.m4$")
    

       ****************************************************************
       ***                     FATAL ERROR!                         ***
       ****************************************************************
       *** The abisrc.py script returned a non-zero exit status.    ***
       *** This usually means that the script found subroutines or  ***
       *** functions that are not declared inside modules or that   ***
       *** there is a syntax error in the Fortran code or a bug     ***
       *** See above error message.                                 ***
       ****                                                         ***
       *** Please note that procedures outside Fortran modules are  ***
       *** not allowed any longer. See abisrc.stderr for details    ***
       *** about the errors.                                        ***
       ****************************************************************
[makemake] Aborting now
[makemake] Starting at 2024/01/21 22:02:00 +0000
[makemake] -------------------------------------
[makemake] === Source tree consistency ===
[makemake]   Enabling write permission for all dirs & files
[makemake] === Build system update ===
[makemake]   Resetting configuration dumper
[makemake]   Generating macros for the Autotools
[makemake]   Generating macros for dumpers
[makemake]   Generating macros for environment variables
[makemake]   Generating macros for command-line options
[makemake]   Generating macros for hints
[makemake]   Generating macros for debugging
[makemake]   Generating macros for default optimizations
[makemake]   Generating macros for per-directory optimizations
[makemake]   Generating macros for core libraries
[makemake]   Generating macros for feature triggers
[makemake]   Generating macros for configure output
[makemake]   Generating source split symlink maker
[makemake] === Source tree update ===
[makemake]   Removing build examples
[makemake]   Generating build examples
[makemake]   Generating CPP option dumper
[makemake] ---> running ./abisrc.py makemake > abisrc.stdout 2> abisrc.stderr
make[1]: *** [debian/rules:36: override_dh_autoreconf] Error 1
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
make: *** [debian/rules:16: build] Error 2

This is not the only Python 3.12 incompatibility, but it's a rather easily visible one. As Ubuntu 24.04 is not expected to ship with Python 3.11, it would be helpful for abinit to have Python 3.12 support.

Note: I know next to nothing about abinit, but if it would be helpful, I can try to find the Python 3.12 incompatibilities and fix them.

@ArrayBolt3
Copy link
Author

abisrc.stderr from failed build:

/build/abinit-7a5fBd/abinit-9.10.4/fkiss/regex.py:126: SyntaxWarning: invalid escape sequence '\s'
  RE_SUBCALL = re.compile("^(?:if\s*\(.*\)\s*)?call\s+(?P<name>\w+)", re.I)
/build/abinit-7a5fBd/abinit-9.10.4/fkiss/regex.py:165: SyntaxWarning: invalid escape sequence '\s'
  RE_TYPECLASS_DEC = re.compile('^(?P<ftype>(type|class))\s*\(\s*(?P<name>\w+)\s*\)', re.I)
/build/abinit-7a5fBd/abinit-9.10.4/fkiss/regex.py:174: SyntaxWarning: invalid escape sequence '\s'
  RE_INCLUDE = re.compile("#?include\s+(?P<path>.+)", re.I)
Traceback (most recent call last):
  File "/build/abinit-7a5fBd/abinit-9.10.4/./abisrc.py", line 416, in <module>
    sys.exit(main())
             ^^^^^^
  File "/build/abinit-7a5fBd/abinit-9.10.4/./abisrc.py", line 257, in main
    proj = AbinitProject(".", processes=options.jobs, verbose=options.verbose)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/build/abinit-7a5fBd/abinit-9.10.4/fkiss/project.py", line 425, in __init__
    import imp
ModuleNotFoundError: No module named 'imp'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant