Bug 2139716

Summary: coccinelle fails to run on Fedora 37
Product: [Fedora] Fedora Reporter: Maxime Ripard <maxime.ripard>
Component: coccinelleAssignee: Richard W.M. Jones <rjones>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 37CC: ctwo0002, rjones
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-11-03 12:27:19 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Maxime Ripard 2022-11-03 10:06:41 UTC
The spatch executable, version 1.1.1, fails to run on Fedora 37

$ spatch --recursive-includes -sp_file /tmp/tmpw4wrzv0v.cocci drivers/clk/clk-apple-nco.c
init_defs_builtins: /usr/local/bin/../lib/coccinelle/standard.h
Py.find_library: unable to find the Python library [/lib64/libpython3.11.so.1.0 returned Cannot resolve _Py_fopen.
]

It seems to be related to https://bugzilla.redhat.com/show_bug.cgi?id=1912931 but affects Python 3.11

Comment 1 Richard W.M. Jones 2022-11-03 10:44:41 UTC
I don't think I'm able to reproduce this in a simple test:

$ spatch --recursive-includes -sp_file /dev/null /var/tmp/test.c 
init_defs_builtins: /usr/lib64/coccinelle/standard.h
unexpected code before the first rule: [0; (69, ("", [0], [0]))]

What version of python3 & python3-libs is installed?

Comment 2 Richard W.M. Jones 2022-11-03 11:11:49 UTC
I changed the RPM to use the forge macros so there's a new build
for Rawhide and F37.  Please try those out:

https://koji.fedoraproject.org/koji/taskinfo?taskID=93739751
https://koji.fedoraproject.org/koji/taskinfo?taskID=93739766

Comment 3 Maxime Ripard 2022-11-03 12:27:19 UTC
I didn't notice but I had an earlier build installed in /usr/local/ which was the buggy one. Removing it and actually using the one from the package works just fine.

Sorry for the noise.