[QGIS-Developer] Increasing QGIS stability (clazy)

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[QGIS-Developer] Increasing QGIS stability (clazy)

Matthias Kuhn 🌍

Hi,

As you all know, Qt is heavily used by QGIS. Qt has some non-standard C++ concepts like signals and slots. These are very powerful but also bear some risks when not used properly. And it's not always easy to see what "properly" means.

Thanks to the folks at KDE, there is a tool named clazy, that can detect many of these risks at compile time. We have recently corrected a number of issues reported by clazy, which will result in an increased stability of QGIS.

We have also integrated clazy on our CI infrastructure (travis) which will help the stability of QGIS in the long run by disallowing risky code to enter the QGIS codebase.

Best regards


This work has been sponsored by the OPENGIS.ch Sustainability Initiative.

--
Matthias Kuhn
[hidden email]
<a href="tel:+41764356763">+41 (0)76 435 67 63

_______________________________________________
QGIS-Developer mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Increasing QGIS stability (clazy)

pcav
Great news, thanks Matthias, and thanks to all the donors.
Is there more documentation to help others developers not falling in these traps?
Cheers.

On 5 November 2019 10:11:38 CET, Matthias Kuhn <[hidden email]> wrote:

Hi,

As you all know, Qt is heavily used by QGIS. Qt has some non-standard C++ concepts like signals and slots. These are very powerful but also bear some risks when not used properly. And it's not always easy to see what "properly" means.

Thanks to the folks at KDE, there is a tool named clazy, that can detect many of these risks at compile time. We have recently corrected a number of issues reported by clazy, which will result in an increased stability of QGIS.

We have also integrated clazy on our CI infrastructure (travis) which will help the stability of QGIS in the long run by disallowing risky code to enter the QGIS codebase.

Best regards


This work has been sponsored by the OPENGIS.ch Sustainability Initiative.

--
Matthias Kuhn
[hidden email]
<a href="tel:+41764356763">+41 (0)76 435 67 63

--
Please excuse my brevity.
_______________________________________________
QGIS-Developer mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Increasing QGIS stability (clazy)

Matthias Kuhn 🌍

Hi Paolo

The reference is available under the link in my first mail, https://github.com/KDE/clazy/blob/master/README.md

In general, developers will notice if travis tells them that it cannot be merged.

Matthias

On 11/5/19 10:18 AM, Paolo Cavallini wrote:
Great news, thanks Matthias, and thanks to all the donors.
Is there more documentation to help others developers not falling in these traps?
Cheers.

On 5 November 2019 10:11:38 CET, Matthias Kuhn [hidden email] wrote:

Hi,

As you all know, Qt is heavily used by QGIS. Qt has some non-standard C++ concepts like signals and slots. These are very powerful but also bear some risks when not used properly. And it's not always easy to see what "properly" means.

Thanks to the folks at KDE, there is a tool named clazy, that can detect many of these risks at compile time. We have recently corrected a number of issues reported by clazy, which will result in an increased stability of QGIS.

We have also integrated clazy on our CI infrastructure (travis) which will help the stability of QGIS in the long run by disallowing risky code to enter the QGIS codebase.

Best regards


This work has been sponsored by the OPENGIS.ch Sustainability Initiative.

--
Matthias Kuhn
[hidden email]
<a href="tel:+41764356763" moz-do-not-send="true">+41 (0)76 435 67 63

--
Please excuse my brevity.

_______________________________________________
QGIS-Developer mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Increasing QGIS stability (clazy)

Alessandro Pasotti-2


On Tue, Nov 5, 2019 at 10:55 AM Matthias Kuhn <[hidden email]> wrote:

Hi Paolo

The reference is available under the link in my first mail, https://github.com/KDE/clazy/blob/master/README.md

In general, developers will notice if travis tells them that it cannot be merged.


Is that the same tool that is available in Qt creator in debug view under "Clang-Tidy and Clazy"?

I wonder if it can be easily integrated in my normal development build workflow.

 

Matthias

On 11/5/19 10:18 AM, Paolo Cavallini wrote:
Great news, thanks Matthias, and thanks to all the donors.
Is there more documentation to help others developers not falling in these traps?
Cheers.

On 5 November 2019 10:11:38 CET, Matthias Kuhn [hidden email] wrote:

Hi,

As you all know, Qt is heavily used by QGIS. Qt has some non-standard C++ concepts like signals and slots. These are very powerful but also bear some risks when not used properly. And it's not always easy to see what "properly" means.

Thanks to the folks at KDE, there is a tool named clazy, that can detect many of these risks at compile time. We have recently corrected a number of issues reported by clazy, which will result in an increased stability of QGIS.

We have also integrated clazy on our CI infrastructure (travis) which will help the stability of QGIS in the long run by disallowing risky code to enter the QGIS codebase.

Best regards


This work has been sponsored by the OPENGIS.ch Sustainability Initiative.

--
Matthias Kuhn
[hidden email]
<a href="tel:+41764356763" target="_blank">+41 (0)76 435 67 63

--
Please excuse my brevity.
_______________________________________________
QGIS-Developer mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer


--
Alessandro Pasotti
w3:   www.itopen.it

_______________________________________________
QGIS-Developer mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Increasing QGIS stability (clazy)

Matthias Kuhn 🌍
On 11/5/19 11:40 AM, Alessandro Pasotti wrote:


On Tue, Nov 5, 2019 at 10:55 AM Matthias Kuhn <[hidden email]> wrote:

Hi Paolo

The reference is available under the link in my first mail, https://github.com/KDE/clazy/blob/master/README.md

In general, developers will notice if travis tells them that it cannot be merged.


Is that the same tool that is available in Qt creator in debug view under "Clang-Tidy and Clazy"?

I wonder if it can be easily integrated in my normal development build workflow.


Clazy is a clang plugin. Some distributions have packages available for it, otherwise it's available for build or as AppImage. You can specify the AppImage as CXX Compiler or change the compiler flags according to the readme to run your system clang with clazy.

I haven't checked the QtCreator integration, I assume it will use the usual QtCreator warning highlight system.

You can manually fine tune the checks as documented in the Clazy README or specify the `-DADD_CLAZY_CHECKS=ON` cmake flag to enable those checks that are enforced on travis.

Hope this helps

Matthias


_______________________________________________
QGIS-Developer mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer