Bug 1997204

Summary: ClangCodeModel plugin does not find header files after clang-libs update
Product: [Fedora] Fedora Reporter: Lennart Brinkmann <lebrinkma>
Component: qt-creatorAssignee: Sandro Mani <manisandro>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 34CC: extras-qa, helio, itamar, jreznik, kde-sig, manisandro, rdieter, tstellar
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: qt-creator-4.14.1-6.fc34 qt-creator-5.0.0-4.fc35 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1881480 Environment:
Last Closed: 2021-09-04 19:31:49 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 Lennart Brinkmann 2021-08-24 15:50:39 UTC
+++ This bug was initially created as a clone of Bug #1881480 +++

Description of problem:

After updating clang-libs to 12.0.1-1.fc34 the ClangCodeModel plugin in Qt Creator fails to find the clang header files, displaying warning messages. 

Version-Release number of selected component (if applicable):
qt-creator-4.14.1-5.fc34.x86_64

How reproducible:
always

Steps to Reproduce:
1. Open Qt Creator
2. Create a new Qt Widgets Application

Actual results:
Qt Creator displays a warning message
Warning: The code model could not parse an included file, which might lead to incorrect code completion and highlighting, for example.
cstddef:50:10: error: 'stddef.h' file not found
...

Expected results:
No warning

Additional info:
The ClangCodeModel plugin seems to hardcode the path to the clang headers.
strings /usr/lib64/qtcreator/plugins/libClangCodeModel.so | grep /usr/lib64/clang/
/usr/lib64/clang/12.0.0/include

Rebuilding the qt-creator package would probably fix the issue for now.

This error has also appeared before in Fedora 32 (see #1881480).

Comment 1 Sandro Mani 2021-08-27 11:03:44 UTC
@tstellar FYI, I've added a hard requires to clang-libs with the version qt-creator was built with to catch this in the future, i.e.

Requires:       clang-libs%{?_isa} = %(rpm -q --qf '%%{version}' clang-libs)

So this means qt-creator will need to be rebuilt also for minor clang updates.

Comment 2 Fedora Update System 2021-08-27 15:43:47 UTC
FEDORA-2021-00e393ef58 has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2021-00e393ef58

Comment 3 Fedora Update System 2021-08-27 17:26:20 UTC
FEDORA-2021-00e393ef58 has been pushed to the Fedora 35 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-00e393ef58`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-00e393ef58

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

Comment 4 Fedora Update System 2021-08-27 19:37:10 UTC
FEDORA-2021-848584e29c has been pushed to the Fedora 34 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-848584e29c`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-848584e29c

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

Comment 5 Tom Stellard 2021-08-30 16:18:09 UTC
(In reply to Sandro Mani from comment #1)
> @tstellar FYI, I've added a hard requires to clang-libs with the
> version qt-creator was built with to catch this in the future, i.e.
> 
> Requires:       clang-libs%{?_isa} = %(rpm -q --qf '%%{version}' clang-libs)
> 
> So this means qt-creator will need to be rebuilt also for minor clang
> updates.

I think the correct fix is to add a dependency on clang-resource-filesystem, which is the package that owns the header directory.

Comment 6 Sandro Mani 2021-08-30 19:53:39 UTC
That would not solve the problem that qt-creator hardcodes the (versioned) path to the clang headers though and will fail to find these headers when clang is updated?

Comment 7 Tom Stellard 2021-08-30 21:29:55 UTC
@manisandro It helps because then I know that the package depends on the header directory and I can be sure to rebuild it when doing an LLVM upgrade or if the resource path changes.

Comment 8 Sandro Mani 2021-08-31 06:06:40 UTC
Ok got it, done!

Comment 9 Fedora Update System 2021-09-04 19:31:49 UTC
FEDORA-2021-848584e29c has been pushed to the Fedora 34 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 10 Fedora Update System 2021-09-24 20:10:06 UTC
FEDORA-2021-00e393ef58 has been pushed to the Fedora 35 stable repository.
If problem still persists, please make note of it in this bug report.