Bug 2221585

Summary: clang-analyzer: cannot run scan-view after python 3.12 update
Product: [Fedora] Fedora Reporter: Jesus Checa <jchecahi>
Component: clangAssignee: Tulio Magno Quites Machado Filho <tuliom>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 39CC: airlied, jchecahi, kkleine, npopov, sbergman, sergesanspaille, siddharth.kde, tbaeder, tstellar, tuliom
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-10-02 17:52:33 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:

Description Jesus Checa 2023-07-10 08:05:11 UTC
After python has been updated to 3.12 in rawhide, running scan-view from clang-analyzer package fails to run, printing a traceback that states that module "imp" cannot be imported. This is caused because (https://docs.python.org/3.12/whatsnew/3.12.html) "The imp module has been removed. (Contributed by Barry Warsaw in gh-98040.)"


Reproducible: Always

Steps to Reproduce:
1.$ podman run -ti fedora:rawhide bash 
2.[container] # dnf install -y clang-analyzer
3.[container] # scan-view --help
Actual Results:  
[root@ffd9611a171e /]# scan-view --help
Traceback (most recent call last):
  File "/usr/bin/scan-view", line 9, in <module>
    import imp
ModuleNotFoundError: No module named 'imp'

Expected Results:  
Regular scan-view's help output.

The "imp" module seems to be unused in scan-view (as of clang-16), so it might be easy to fix just by removing the import statement:
[root@ffd9611a171e /]# pyflakes /usr/bin/scan-view 
/usr/bin/scan-view:9:1: 'imp' imported but unused
/usr/bin/scan-view:18:1: 'webbrowser' imported but unused
/usr/bin/scan-view:43:5: redefinition of unused 'webbrowser' from line 18

Comment 1 Tulio Magno Quites Machado Filho 2023-07-10 12:17:42 UTC
I'm working on the update to LLVM 16.0.6, which should also fix this.

Comment 2 Fedora Update System 2023-07-11 12:22:03 UTC
FEDORA-2023-afd7a38128 has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2023-afd7a38128

Comment 3 Jesus Checa 2023-07-12 10:45:10 UTC
I have tested the updated package from bodhi, unfortunately it seems the issue is still reproducible:

[root@ibm-z-109 ~]# rpm -q clang
clang-16.0.6-1.fc39.s390x
[root@ibm-z-109 ~]# scan-view --help
Traceback (most recent call last):
  File "/usr/bin/scan-view", line 9, in <module>
    import imp
ModuleNotFoundError: No module named 'imp'
[root@ibm-z-109 ~]# grep -Hn "import imp" `which scan-view`
/usr/bin/scan-view:9:import imp

Comment 4 Tulio Magno Quites Machado Filho 2023-07-13 14:39:00 UTC
I proposed a fix in this pull request: https://src.fedoraproject.org/rpms/clang/pull-request/208

Comment 5 Tulio Magno Quites Machado Filho 2023-07-14 17:54:00 UTC
The fix has been merged and is now available on https://bodhi.fedoraproject.org/updates/FEDORA-2023-afd7a38128

Comment 6 Fedora Update System 2023-07-18 20:30:58 UTC
FEDORA-2023-afd7a38128 has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 7 Fedora Release Engineering 2023-08-16 08:12:04 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 39 development cycle.
Changing version to 39.