Bug 1655852 - Qt Creator is unusable on the Linux kernel source
Summary: Qt Creator is unusable on the Linux kernel source
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: qt-creator
Version: 29
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Itamar Reis Peixoto
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-12-04 05:39 UTC by Ivan Mironov
Modified: 2018-12-20 12:17 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-12-20 12:17:17 UTC
Type: Bug


Attachments (Terms of Use)
Version from https://koji.fedoraproject.org/koji/taskinfo?taskID=31261958 (807.36 KB, image/png)
2018-12-04 19:53 UTC, Ivan Mironov
no flags Details
Original binary from https://download.qt.io/development_releases/qtcreator/4.8/4.8.0-rc1/qt-creator-opensource-linux-x86_64-4.8.0-rc1.run (852.01 KB, image/png)
2018-12-04 19:54 UTC, Ivan Mironov
no flags Details
Version built manually from https://src.fedoraproject.org/rpms/qt-creator/pull-request/3 (617.38 KB, image/png)
2018-12-04 19:55 UTC, Ivan Mironov
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Qt Bug Tracker QTCREATORBUG-21637 0 None None None 2018-12-04 20:19:01 UTC

Description Ivan Mironov 2018-12-04 05:39:37 UTC
Description of problem:
Qt Creator from Fedora 29 repositories fails to properly parse and follow Linux kernel source code.


Version-Release number of selected component (if applicable):
qt-creator-4.7.1-1.fc29, also tested qt-creator-4.7.2-1.fc29 from https://koji.fedoraproject.org/koji/buildinfo?buildID=1164004


How reproducible:
Always.


Steps to Reproduce:
1. Clone Linux kernel git repository (for example, from https://github.com/torvalds/linux/)
2. git checkout 0072a0c14d5b7cb72c611d396f143f5dcd73ebe2  # to reproduce this precisely
3. In Qt Creator, open "File" -> "New File or Project"
4. Choose "Import Project" template
5. Choose "Import Existing Project"
6. Press "Choose..."
7. Set some project name (like "linux-kernel"), point "Location" to the git-cloned kernel source tree
8. Press "Next"
9. Press "Next" again in file selection dialog
10. Set "Add to version control" to "<None>"
11. Press "Finish"
12. In $PROJECT_NAME.includes remove everything and then add:
	arch/x86/include
	arch/x86/include/uapi
	include
	include/uapi
13. In $PROJECT_NAME.config add:
	#include "linux/kconfig.h"
	#define __KERNEL__ 1
14. Wait until Qt Creator finishes parsing the source code. It is slow... Progress bar is at bottom right.
15. Using left panel, open "drivers/scsi/hpsa.c"
16. Find first occurrence of "dma_map_single"
17. Hold "Ctrl" and try left click on "dma_map_single"


Actual results:
Nothing happens.


Expected results:
Qt Creator should open another file and jump to definition of "dma_map_single".


Additional info:
This works as expected in official build of the same version: http://download.qt.io/official_releases/qtcreator/4.7/4.7.2/qt-creator-opensource-linux-x86_64-4.7.2.run

Comment 2 Sandro Mani 2018-12-04 10:07:17 UTC
I've submitted a f29 scratch build of qt-creator-4.8.0-rc here [1], can you give it a try? I'm planning for 4.8.0 final in f29 anyways, and release should happen any moment now.

[1] https://koji.fedoraproject.org/koji/taskinfo?taskID=31261958

Comment 3 Ivan Mironov 2018-12-04 18:45:40 UTC
(In reply to Sandro Mani from comment #2)
> I've submitted a f29 scratch build of qt-creator-4.8.0-rc here [1], can you
> give it a try? I'm planning for 4.8.0 final in f29 anyways, and release
> should happen any moment now.
> 
> [1] https://koji.fedoraproject.org/koji/taskinfo?taskID=31261958

Same problem.

Comment 4 Ivan Mironov 2018-12-04 18:47:05 UTC
By the way, I just noticed that there is a reproduction step missing:

2.1 make defconfing && make  # among other things, this generates some header files

Comment 7 Ivan Mironov 2018-12-04 19:55:09 UTC
Created attachment 1511460 [details]
Version built manually from https://src.fedoraproject.org/rpms/qt-creator/pull-request/3

Comment 8 Ivan Mironov 2018-12-04 19:57:40 UTC
Rebuilt 4.8.0-rc1 with LLVM/Clang 6.0 libraries[1]. Works as expected.

To clarify this a bit: there is no full support of kernel development in Qt Creator either way, but it works significantly better when built with LLVM/Clang libraries 6.0 than with 7.0. See attached screenshots:

1. qtcreator-kernel-bad.png - https://bugzilla.redhat.com/attachment.cgi?id=1511458 - Version from your Koji link[2].
2. qtcreator-kernel-bad.origbin.png - https://bugzilla.redhat.com/attachment.cgi?id=1511459 - Original binary from Qt developers[3]. Seems that starting with 4.8.* they are using LLVM 7.0 too, so it is broken in the same way. I'll create upstream bug report about this.
3. qtcreator-kernel-good.png - https://bugzilla.redhat.com/attachment.cgi?id=1511460 - Version built manually from[1]. Much more usable than the first two. Note the reduced amount of errors.

[1] https://src.fedoraproject.org/rpms/qt-creator/pull-request/3
[2] https://koji.fedoraproject.org/koji/taskinfo?taskID=31261958
[3] https://download.qt.io/development_releases/qtcreator/4.8/4.8.0-rc1/qt-creator-opensource-linux-x86_64-4.8.0-rc1.run

Comment 9 Sandro Mani 2018-12-05 09:29:58 UTC
Have you already reported the issue with

   nothing provides clang6.0(x86-64) = 6.0.1-5.fc29 needed by clang6.0-devel-6.0.1-5.fc29.x86_64

?

Comment 10 Ivan Mironov 2018-12-05 12:30:48 UTC
Already reported by someone else: https://bugzilla.redhat.com/show_bug.cgi?id=1652292

Comment 11 Tom Stellard 2018-12-07 06:46:34 UTC
How much better is LLVM 6.0 than LLVM 7.0?  The clang6.0 package really only exists so that packages can have extra time to transition from 6.0 -> 7.0.  It's not really meant to be used as an alternative to the main packages.

Comment 12 Ivan Mironov 2018-12-07 09:53:39 UTC
(In reply to Tom Stellard from comment #11)
> How much better is LLVM 6.0 than LLVM 7.0?  The clang6.0 package really only
> exists so that packages can have extra time to transition from 6.0 -> 7.0. 
> It's not really meant to be used as an alternative to the main packages.

With 6.0 code navigation works fine (find usages/follow symbol/etc.). With 7.0 it does not work because Qt Creator fails to parse the source code. Also, see attached screen shots.

Comment 13 Ivan Mironov 2018-12-08 05:31:52 UTC
Reproduced this again on Qt Creator 4.8.0 release (official binaries).

Still works fine when rebuilt from source with LLVM/Clang 6.0.

Comment 14 Sandro Mani 2018-12-20 12:17:17 UTC
Given Tom Stellards comment, realistically this is a WONTFIX, we will need upstream to improve the support for LLVM 7.


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