Bug 2258823

Summary: scipy fails to build with GCC 14 on i686: error: assignment to ‘npy_int32 *’ {aka ‘long int *’} from incompatible pointer type ‘int *’ [-Wincompatible-pointer-types]
Product: [Fedora] Fedora Reporter: Miro Hrončok <mhroncok>
Component: scipyAssignee: Nikola Forró <nforro>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: rawhideCC: cstratak, david08741, fweimer, ksurma, mmuzila, nforro, psimovec, python-packagers-sig, tomspur
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: scipy-1.11.3-5.fc40 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-01-29 20:55:22 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2137516, 2231791, 2244836    
Attachments:
Description Flags
The easy fix none

Description Miro Hrončok 2024-01-17 15:46:46 UTC
FAILED: scipy/interpolate/_fitpack.cpython-312-i386-linux-gnu.so.p/src__fitpackmodule.c.o
  gcc -Iscipy/interpolate/_fitpack.cpython-312-i386-linux-gnu.so.p -Iscipy/interpolate -I../scipy/interpolate -I../scipy/interpolate/src -I../../../../../usr/lib/python3.12/site-packages/numpy/core/include -I/usr/include/python3.12 -fvisibility=hidden -fdiagnostics-color=always -DNDEBUG -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c99 -O3 -Wno-unused-but-set-variable -Wno-unused-function -Wno-conversion -Wno-misleading-indentation -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m32 -march=i686 -mtune=generic -msse2 -mfpmath=sse -mstackrealign -fasynchronous-unwind-tables -fstack-clash-protection -fPIC -DNPY_NO_DEPRECATED_API=NPY_1_9_API_VERSION -MD -MQ scipy/interpolate/_fitpack.cpython-312-i386-linux-gnu.so.p/src__fitpackmodule.c.o -MF scipy/interpolate/_fitpack.cpython-312-i386-linux-gnu.so.p/src__fitpackmodule.c.o.d -o scipy/interpolate/_fitpack.cpython-312-i386-linux-gnu.so.p/src__fitpackmodule.c.o -c ../scipy/interpolate/src/_fitpackmodule.c
  ../scipy/interpolate/src/_fitpackmodule.c: In function ‘fitpack_bispev’:
  ../scipy/interpolate/src/_fitpackmodule.c:255:10: error: assignment to ‘npy_int32 *’ {aka ‘long int *’} from incompatible pointer type ‘int *’ [-Wincompatible-pointer-types]
    255 |     iwrk = (int *)(wrk + lwrk);
        |          ^

Reproducible: Always

Steps to Reproduce:
`fedpkg build --scratch` on i686
Actual Results:  
  ../scipy/interpolate/src/_fitpackmodule.c:255:10: error: assignment to ‘npy_int32 *’ {aka ‘long int *’} from incompatible pointer type ‘int *’ [-Wincompatible-pointer-types]

Expected Results:  
build should work

scipy-1.11.3-3.fc40

Comment 1 Florian Weimer 2024-01-29 16:34:21 UTC
Created attachment 2011390 [details]
The easy fix

This patch is needed to reach the good bits in the f2py-converted code.

Any idea how to teach the build system to preserve .mesonpy-*/scipy/interpolate/dfitpackmodule.c on error? Right now, I count on hitting C-z at the right time, so that the ninja build still proceeds far enough, but the cleanup doesn't run because the supervising process is stopped.

We'll have to downgrade C type safety on i686, I think.

Comment 2 Florian Weimer 2024-01-29 20:55:22 UTC
Worked around with an i686-specific compiler flags downgrade.