Bug 1997204 - ClangCodeModel plugin does not find header files after clang-libs update
Summary: ClangCodeModel plugin does not find header files after clang-libs update
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: qt-creator
Version: 34
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Sandro Mani
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-08-24 15:50 UTC by Lennart Brinkmann
Modified: 2021-09-24 20:10 UTC (History)
8 users (show)

Fixed In Version: qt-creator-4.14.1-6.fc34 qt-creator-5.0.0-4.fc35
Clone Of: 1881480
Environment:
Last Closed: 2021-09-04 19:31:49 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.