Qt Creator uses Clang-8 and expects Clang-8 include files but has no dependency on clang-8 include files

Bug #1910551 reported by M W
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
qtcreator (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

```
lsb_release -rd
Description: Ubuntu 20.04.1 LTS
Release: 20.04
```

qtcreator version:

```
apt show qtcreator
Package: qtcreator
Version: 4.11.0-2build2
Priority: optional
Section: universe/devel
Origin: Ubuntu
Maintainer: Ubuntu Developers <email address hidden>
Original-Maintainer: Debian Qt/KDE Maintainers <email address hidden>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 115 MB
Depends: libqt5sql5-sqlite, qml-module-qtqml-models2, qml-module-qtquick-controls (>= 5.5.0~), qml-module-qtquick2 (>= 5.5.0~), qtchooser, qtcreator-data (= 4.11.0-2build2), libc6 (>= 2.29), libclang1-8 (>= 1:7~svn334604-1~+0~), libgcc-s1 (>= 3.0), libkf5syntaxhighlighting5, libllvm8 (>= 1:8~svn298832-1~), libqbscore1.13 (>= 1.12.0), libqt5concurrent5 (>= 5.6.2~), libqt5core5a (>= 5.12.2), libqt5designer5 (>= 5.6.2~), libqt5designercomponents5 (>= 5.6.2~), libqt5gui5 (>= 5.12.2) | libqt5gui5-gles (>= 5.12.2), libqt5help5 (>= 5.9.0), libqt5network5 (>= 5.6.2~), libqt5printsupport5 (>= 5.6.2~), libqt5qml5 (>= 5.2.0~rc1), libqt5quick5 (>= 5.9.0~beta) | libqt5quick5-gles (>= 5.9.0~beta), libqt5quickwidgets5 (>= 5.11.0), libqt5script5 (>= 5.6.2~), libqt5serialport5 (>= 5.9.0), libqt5sql5 (>= 5.6.2~), libqt5widgets5 (>= 5.12.2), libqt5xml5 (>= 5.6.2~), libstdc++6 (>= 9), qtbase-abi-5-12-8, qtdeclarative-abi-5-12-8
Recommends: clang, clang-tidy, gdb, make, qmlscene, qt5-doc, qt5-qmltooling-plugins, qtbase5-dev-tools, qtcreator-doc, qtdeclarative5-dev-tools, qttools5-dev-tools, qttranslations5-l10n, qtxmlpatterns5-dev-tools, xterm | x-terminal-emulator
Suggests: clazy (>= 1.5), cmake, g++, git, kate-data, subversion, valgrind
Breaks: qtcreator-data (<< 4.5.2-2~)
Replaces: qtcreator-data (<< 4.5.2-2~)
Homepage: https://doc.qt.io/qt-5/topics-app-development.html
Download-Size: 29.0 MB
APT-Manual-Installed: yes
APT-Sources: http://gb.archive.ubuntu.com/ubuntu focal/universe amd64 Packages
Description: integrated development environment (IDE) for Qt
 Qt Creator is a cross-platform integrated development environment (IDE)
 designed to make development with the Qt application framework faster
 and easier.
 .
 It includes:
  * An advanced C++ code editor
  * Integrated GUI layout and forms designer
  * Project and build management tools
  * Integrated, context-sensitive help system
  * Visual debugger
  * Rapid code navigation tools
  * Supports multiple platforms
  * Qt Quick Designer
```

Qt Creator has a code model which shows errors as the project is being worked on.

However, in the event that clang-8's include files are missing (which was the case because I did not have clang-8 installed, just libclang1-8 which was the actual dependency, and clang-10), the Clang code model shows errors about "stddef" not being found, thus indirectly causing C++ Qt projects to show a lot of phantom errors.

This is essentially a missing-dependency issue; Qt Creator expects the include files of the Clang version it was compiled with, and it doesn't get them.

The exact issue was determined via:
```
ldd /usr/lib/x86_64-linux-gnu/qtcreator/libexec/clangbackend
 linux-vdso.so.1 (0x00007ffde3bee000)
 libSqlite.so.4 => /usr/lib/x86_64-linux-gnu/qtcreator/libexec/../libSqlite.so.4 (0x00007fe611caf000)
 libClangsupport.so.4 => /usr/lib/x86_64-linux-gnu/qtcreator/libexec/../libClangsupport.so.4 (0x00007fe611c2d000)
 libUtils.so.4 => /usr/lib/x86_64-linux-gnu/qtcreator/libexec/../libUtils.so.4 (0x00007fe61196d000)
 libclang-8.so.1 => /lib/x86_64-linux-gnu/libclang-8.so.1 (0x00007fe60ffc2000)
<...further details omitted...>
```

Installing package "clang-8" completely resolved the issue.
If that is not an available workaround, providing /usr/include/clang/8/include (symlink to other Clang include directory?) should be sufficient, but I haven't tested this.

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: qtcreator 4.11.0-2build2
ProcVersionSignature: Ubuntu 5.4.0-58.64-generic 5.4.73
Uname: Linux 5.4.0-58-generic x86_64
ApportVersion: 2.20.11-0ubuntu27.14
Architecture: amd64
CasperMD5CheckResult: skip
CurrentDesktop: MATE
Date: Thu Jan 7 14:20:01 2021
InstallationDate: Installed on 2020-10-06 (93 days ago)
InstallationMedia: Ubuntu 20.04.1 LTS "Focal Fossa" - Release amd64 (20200731)
SourcePackage: qtcreator
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
M W (20kdc) wrote :
summary: - Qt Creator has dependency on Clang-10 but uses Clang-8 and expects
- Clang-8 include files
+ Qt Creator uses Clang-8 and expects Clang-8 include files but has no
+ dependency on clang-8 include files
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in qtcreator (Ubuntu):
status: New → Confirmed
Revision history for this message
Kristian (kmk) wrote :

Also present in 20.04.4 LTS. Installing clang-8 from apt fixes code model.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.