Bug 2250675 - pygsl fails to build with numpy 1.26: No module named 'numpy.distutils' -> 'pygsl.errno'
Summary: pygsl fails to build with numpy 1.26: No module named 'numpy.distutils' -> 'p...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: pygsl
Version: 40
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: José Matos
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 2291591 (view as bug list)
Depends On:
Blocks: F40FTBFS F41FTBFS F41FailsToInstall PYTHON3.13
TreeView+ depends on / blocked
 
Reported: 2023-11-20 13:58 UTC by Karolina Surma
Modified: 2024-08-21 03:07 UTC (History)
4 users (show)

Fixed In Version: pygsl-2.4.0-1.fc39 pygsl-2.4.0-1.fc40
Clone Of:
Environment:
Last Closed: 2024-08-13 00:00:58 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Karolina Surma 2023-11-20 13:58:17 UTC
pygsl fails to build with Python 3.13.0a1.

This report is automated and not very verbose, but we'll try to get back here with details.

+ /usr/bin/python3 setup.py gsl_wrappers
/builddir/build/BUILD/pygsl-2.3.3/gsl_dist/gsl_Location.py:63: SyntaxWarning: invalid escape sequence '\.'
  return re.split('\.',version)
Traceback (most recent call last):
  File "/builddir/build/BUILD/pygsl-2.3.3/gsl_dist/gsl_Extension.py", line 25, in <module>
    from array_includes import array_include_dirs
  File "/builddir/build/BUILD/pygsl-2.3.3/gsl_dist/array_includes.py", line 7, in <module>
    from numpy.distutils.misc_util import get_numpy_include_dirs
ModuleNotFoundError: No module named 'numpy.distutils'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/builddir/build/BUILD/pygsl-2.3.3/setup.py", line 99, in <module>
    from gsl_Extension import gsl_Extension
  File "/builddir/build/BUILD/pygsl-2.3.3/gsl_dist/gsl_Extension.py", line 27, in <module>
    from pygsl.gsl_dist.array_includes import array_include_dirs
  File "/builddir/build/BUILD/pygsl-2.3.3/pygsl/__init__.py", line 47, in <module>
    import pygsl.errno
ModuleNotFoundError: No module named 'pygsl.errno'

https://docs.python.org/3.13/whatsnew/3.13.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.13/fedora-rawhide-x86_64/06660912-pygsl/

For all our attempts to build pygsl with Python 3.13, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/package/pygsl/

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.13:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/

Let us know here if you have any questions.

Python 3.13 is planned to be included in Fedora 41.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.13.
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.

Comment 1 Miro Hrončok 2023-11-20 14:30:35 UTC
See https://koschei.fedoraproject.org/package/pygsl -- this is not Python 3.13 specific.

Comment 2 José Matos 2024-02-05 15:26:35 UTC
Don't you love when there are not than just one problem at once?

What comes here is just the situation until now. I will report this upstream and continue the followup here.

As far as I can see there are two issue:

1. `numpy.distutils` issue. Since there is a call to a single function the code can be replace easily:

-array_include_dirs = []
-from numpy.distutils.misc_util import get_numpy_include_dirs
-array_include_dirs = get_numpy_include_dirs()
+import numpy
+array_include_dirs = [ numpy.get_include() ]


2. After fixing this there is a failure in the compiled code, either because gsl or gcc changed:

  swig_src/odeiv2_wrap.c:4336:66: error: passing argument 2 of ‘_pygsl_odeiv2_check_step_jacobian’ from incompatible pointer type [-Wincompatible-pointer-types]
   4336 |                 status = _pygsl_odeiv2_check_step_jacobian(step, &sys->dydt);
        |                                                                  ^~~~~~~~~~
        |                                                                  |
        |                                                                  const gsl_odeiv2_system *
  swig_src/odeiv2_wrap.c:3548:104: note: expected ‘const pygsl_odeiv2_system *’ but argument is of type ‘const gsl_odeiv2_system *’
   3548 | static int _pygsl_odeiv2_check_step_jacobian(const pygsl_odeiv2_step *step, const pygsl_odeiv2_system *sys)
        |                                                                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
  swig_src/odeiv2_wrap.c: In function ‘pygsl_odeiv2_driver_apply_fixed_step’:
  swig_src/odeiv2_wrap.c:4513:89: error: passing argument 2 of ‘_pygsl_odeiv2_check_step_jacobian’ from incompatible pointer type [-Wincompatible-pointer-types]
   4513 |                 status = _pygsl_odeiv2_check_step_jacobian(self->driver->s, self->driver->sys);
        |                                                                             ~~~~~~~~~~~~^~~~~
        |                                                                                         |
        |                                                                                         const gsl_odeiv2_system *
  swig_src/odeiv2_wrap.c:3548:104: note: expected ‘const pygsl_odeiv2_system *’ but argument is of type ‘const gsl_odeiv2_system *’
   3548 | static int _pygsl_odeiv2_check_step_jacobian(const pygsl_odeiv2_step *step, const pygsl_odeiv2_system *sys)
        |                                                                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
  swig_src/odeiv2_wrap.c: In function ‘pygsl_odeiv2_driver_apply’:
  swig_src/odeiv2_wrap.c:4554:89: error: passing argument 2 of ‘_pygsl_odeiv2_check_step_jacobian’ from incompatible pointer type [-Wincompatible-pointer-types]
   4554 |                 status = _pygsl_odeiv2_check_step_jacobian(self->driver->s, self->driver->sys);
        |                                                                             ~~~~~~~~~~~~^~~~~
        |                                                                                         |
        |                                                                                         const gsl_odeiv2_system *
  swig_src/odeiv2_wrap.c:3548:104: note: expected ‘const pygsl_odeiv2_system *’ but argument is of type ‘const gsl_odeiv2_system *’
   3548 | static int _pygsl_odeiv2_check_step_jacobian(const pygsl_odeiv2_step *step, const pygsl_odeiv2_system *sys)
        |                                                                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
...
error: command '/usr/bin/gcc' failed with exit code 1

This is quite reasonable because
typedef struct{
	gsl_odeiv2_system dydt;
	PyGSL_odeiv_parameter_pass params;
} pygsl_odeiv2_system;

Comment 3 José Matos 2024-02-08 11:03:20 UTC
Just for reference both issues were reported upstream.

The first one related with Python is already fixed:
https://github.com/pygsl/pygsl/issues/36

The second one is related with the compilation with gcc-14 and is still going:
https://github.com/pygsl/pygsl/issues/37

Comment 4 Aoife Moloney 2024-02-15 23:05:08 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 40 development cycle.
Changing version to 40.

Comment 5 Karolina Surma 2024-06-12 14:57:35 UTC
*** Bug 2291591 has been marked as a duplicate of this bug. ***

Comment 6 Fedora Update System 2024-08-12 09:19:37 UTC
FEDORA-2024-274360517e (pygsl-2.4.0-1.fc40) has been submitted as an update to Fedora 40.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-274360517e

Comment 7 Fedora Update System 2024-08-12 09:42:32 UTC
FEDORA-2024-4a717532ac (pygsl-2.4.0-1.fc39) has been submitted as an update to Fedora 39.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-4a717532ac

Comment 8 José Matos 2024-08-12 10:38:30 UTC
Upstream released a new version where the different issues were fixed.

Of course there are new ones, also reported upstream but this is life. :-)

Thanks for all the work here, this simplified my work a lot. :-)

Comment 9 Fedora Fails To Install 2024-08-13 00:00:58 UTC
Hello,

Please note that this comment was generated automatically by https://pagure.io/releng/blob/main/f/scripts/ftbfs-fti/follow-policy.py
If you feel that this output has mistakes, please open an issue at https://pagure.io/releng/

All subpackages of a package against which this bug was filled are now installable or removed from Fedora 41.

Thanks for taking care of it!

Comment 10 Fedora Update System 2024-08-13 01:32:10 UTC
FEDORA-2024-274360517e has been pushed to the Fedora 40 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-274360517e`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-274360517e

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 11 Fedora Update System 2024-08-13 02:38:22 UTC
FEDORA-2024-4a717532ac has been pushed to the Fedora 39 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-4a717532ac`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-4a717532ac

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 12 Fedora Update System 2024-08-21 02:18:34 UTC
FEDORA-2024-4a717532ac (pygsl-2.4.0-1.fc39) has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 13 Fedora Update System 2024-08-21 03:07:08 UTC
FEDORA-2024-274360517e (pygsl-2.4.0-1.fc40) has been pushed to the Fedora 40 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.