FS#62221 - qtcreator 4.8.2-2 cannot find the Clazy plugin

Attached to Project: Arch Linux
Opened by Angelo Theodorou (encelo) - Wednesday, 03 April 2019, 15:06 GMT
Last edited by Antonio Rojas (arojas) - Monday, 06 May 2019, 16:17 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Antonio Rojas (arojas)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:
With version 4.8.2-2 Qt Creator was recompiled against LLVM 8.0.
It seems that now the patch that was added to support Clazy 1.5 is not working anymore: https://git.archlinux.org/svntogit/packages.git/tree/trunk/qtcreator-clang-plugins.patch?h=packages/qtcreator

Steps to reproduce:
First be sure to have Clazy enabled in the Diagnostic Configurations window that is accessible from the Code Model tab in Tools->Options->C++ (Level 0 is enough).

Then start the IDE from the console with `QT_LOGGING_RULES=qtc.clang*=true qtcreator` to enable additional debug output.

Then, when opening a C++ file, you could read in the console the following message:
`error: unable to find plugin 'clazy'`
At this point the whole Code Model plugin will stop working, this means no syntax highlighting and no auto-completion.

In order to make it work again it is sufficient to disable Clazy support from the Diagnostic Configurations.
This task depends upon

Closed by  Antonio Rojas (arojas)
Monday, 06 May 2019, 16:17 GMT
Reason for closing:  Fixed
Additional comments about closing:  qtcreator 4.9.0-2 (only when running from the .desktop file)
Comment by Evangelos Foutras (foutrelis) - Friday, 05 April 2019, 03:35 GMT
EDIT: Never mind, it is reproducible.

I can't reproduce the issue; clazy checks seem to work fine.

Check that all your packages are at the correct version:

$ pacman -Q qtcreator clazy clang llvm-libs
qtcreator 4.8.2-2
clazy 1.5-2
clang 8.0.0-3
llvm-libs 8.0.0-1
Comment by Angelo Theodorou (encelo) - Friday, 05 April 2019, 09:34 GMT
Hi Evangelos,
I confirm I have the exact same package versions as you.
Anyway, as QtCreator 4.9 is just days away from release maybe we can just wait for it first.

Thanks for your time,
Angelo
Comment by Antonio Rojas (arojas) - Friday, 05 April 2019, 09:40 GMT
That is not going to help, this is reproducible with qtcreator and clazy from git.
Comment by Antonio Rojas (arojas) - Friday, 05 April 2019, 13:46 GMT
Offending clang commit is https://github.com/llvm-mirror/clang/commit/5f2efcd632

Loading the clazy plugin still works fine when invoking clang from the command line

/usr/bin/clang -fsyntax-only -Xclang -load -Xclang ClazyPlugin.so -Xclang -add-plugin -Xclang clazy foo.cpp
Comment by Deleted account (Nic264) - Sunday, 05 May 2019, 00:54 GMT
I think this bug is resolved when it comes to changing Qt Creator's code model (ie the checks run in real time during edit).
However it still applies to the one-time launch of clazy (via Analyze → Clang-tidy and Clazy…).

The thing is the patch does not make Qt Creator call -Xclang clazy but -Xclang clang-lazy in this case.

The attached patch patch fixes the bug for me.

EDIT :
I just saw OP's error was the other way around, with `error: unable to find plugin 'clazy'`, while I've got `error: unable to find plugin 'clang-lazy'`.
Also the patch I attached should read 'Fix clang-lazy to clazy rename patch'.
Comment by Antonio Rojas (arojas) - Sunday, 05 May 2019, 09:09 GMT
@Nic264 thanks for the patch, that was indeed wrong. Unfortunately this is unrelated to the issue at hand, which is caused by a behavior change in clang.
Comment by Antonio Rojas (arojas) - Monday, 06 May 2019, 16:16 GMT
The best I can do for now is preload the plugins in the desktop file - this will at least fix the issue when qtcreator is launched from the desktop file. Not much else I can do with upstream relying on their own clang fork.

Loading...