Cantera / cantera

Chemical kinetics, thermodynamics, and transport tool suite
https://cantera.org
Other
582 stars 342 forks source link

Failed tests: kinetics: Reaction.PythonExtensibleRate under Python 3.12 #1602

Closed mefuller closed 10 months ago

mefuller commented 10 months ago

Problem description

Building Cantera 3.0.0 for Fedora succeeds on F38 under Python 3.11, but fails on F39 and Rawhide using Python 3.12

Steps to reproduce

  1. Open '...'
  2. Run '....'
  3. See error '....'

Behavior

A single test fails: kinetics: Reaction.PythonExtensibleRate

System information

Attachments

The failed build log: https://download.copr.fedorainfracloud.org/results/fuller/cantera-test/fedora-rawhide-x86_64/06343632-cantera/builder-live.log.gz

Additional context

This appears to be the only error introduced by moving from Python 3.11 to 3.12

speth commented 10 months ago

Thanks for reporting this, @mefuller.

As noted in the build log:

WARNING: Python 3.12 is not supported for Cantera 3.0.0. Python versions 3.12 and newer are untested and may result in unexpected behavior. Proceed with caution.

this failure isn't surprising.

Python 3.12.0rc1 was only released a couple of weeks ago, and many of our Python dependencies will need to be rebuilt or updated for Python 3.12 before we can test on 3.12 with our CI, which relies on installing Python from conda-forge or using the GitHub action, and on PyPI and conda-forge for all Python dependencies. I believe the latter will only start providing Python 3.12 packages after the final release.

Given that this seems to be an opportunity to get a preview of any issues, I'm pretty interested in these builds. I know we discussed this before, but can you remind me where the higher-level overview and status of these builds can be found? Also, what are the parameters of the builds? Are there builds for tagged versions, the current main branch, or both?

With regard to the specific failure here:

C++ exception with description "
*******************************************************************************
CanteraError thrown by Application::loadExtension:
Error loading Python extension support. Tried the following:
Python 3.11: boost::dll::shared_library::load() failed (dlerror system message: cantera_python3_11: cannot open shared object file: No such file or directory): Bad file descriptor

Python 3.10: boost::dll::shared_library::load() failed (dlerror system message: cantera_python3_10: cannot open shared object file: No such file or directory): Bad file descriptor

Python 3.9: boost::dll::shared_library::load() failed (dlerror system message: cantera_python3_9: cannot open shared object file: No such file or directory): Bad file descriptor

Python 3.8: boost::dll::shared_library::load() failed (dlerror system message: cantera_python3_8: cannot open shared object file: No such file or directory): Bad file descriptor
*******************************************************************************
" thrown in the test body.

the fix is potentially very simple. All that has to be done to try loading the extension support for Python 3.12 is to update the list here: https://github.com/Cantera/cantera/blob/806842dacc59203cfe98b8467a27a6b386cd5ece/src/base/application.h#L436-L437

mefuller commented 10 months ago

Yes, I know it's untested and unsupported (I put a little not in my issue next to the version). I figured reporting the failure might simply be good information. Thanks for the suggestion - that got the test to pass and I'm building updates now

Presently I'm only using the released version, not main, but I'm using Fedora's build system to test across versions and architectures. There's a front-end for unofficial projects at https://copr.fedorainfracloud.org that anyone can register for and use. Unfortunately, I never got the CI to work right for Cantera to test with each new commit to master.

Is there a way to use docker containers in Github's CI like in Gitlab CI? Fedora does have a rawhide container which is likely to be as or even more bleeding-edge than Debian Sid or openSUSE Tumbleweed on any given day (although)