mixxx icon indicating copy to clipboard operation
mixxx copied to clipboard

Enable qmllint in qt6 builds.

Open daschuer opened this issue 3 years ago • 11 comments

I am still struggling to build Mixxx wit Qt 6 on ubuntu focal. It turns out that the issues at runtime are with the qml files reported by qmllint.

Has One an idea how to fix it, or is the failure expected?

daschuer avatar Feb 05 '22 22:02 daschuer

Has One an idea how to fix it, or is the failure expected?

Yes, it is expected. I didn't have time to fix every qmllint warning.

Holzhaus avatar Feb 06 '22 01:02 Holzhaus

Btw, I don't think this should be merged. There is no reason to add the linter to the all target IMHO.

Holzhaus avatar Feb 06 '22 01:02 Holzhaus

Any Idea why CI is not running? I will try a rebase.

daschuer avatar Feb 06 '22 11:02 daschuer

Ci is working now:

Warning: res/qml/Mixxx/Controls/Knob.qml:113:21: Type not found in namespace
            value = Mixxx.MathUtils.clamp(value, 0, 1);
                    ^^^^^^^^^^^^^^^
Warning: res/qml/Mixxx/Controls/WaveformOverview.qml:12:5: Cannot assign to non-existent default property
    Mixxx.ControlProxy {
    ^^^^^
Warning: res/qml/Mixxx/Controls/WaveformOverview.qml: QQuickPaintedItem was not found. Did you add all import paths?

I can confirm the same issue here on Ubuntu Focal. Any ideas?

Do you know which parent in the QmlWaveformOverview class defines the "DefaultProterty"? It looks like qmllint does not find the parent QQuickPaintedItem which should be part of Qt6::Quick.

I expect the Mixxx.MathUtils issue to be a similar one.

daschuer avatar Feb 06 '22 13:02 daschuer

I expect the Mixxx.MathUtils issue to be a similar one.

That issue is a Qt bug: https://bugreports.qt.io/browse/QTBUG-100326

Holzhaus avatar Feb 06 '22 13:02 Holzhaus

What are the pros and cons to have qmllint running with the all target?

Compared to the qmllint during the pre commit hook, this one is called from the correct toolset and using the correct include paths. It only runs like a compiler whenever a qml file has been changed.

On the contra side we have the issue that it currently produces false positives that unnecessary fail a build.

I think If we like to rely on qmllint, we should make it happy all the time anyway.

Would it be an option to run the qmllint make target during the commit hook? Sounds scary ...

What do you think?

daschuer avatar Feb 15 '22 16:02 daschuer

It turns out that the pre-commit hook calls qmllint from qt5 which produces false positives. qmllint form qt6 needs to be called with the correct include paths. They are only known when building with QT6=1. So I think it is just the right solution to run qmllint with the build process.

daschuer avatar Feb 16 '22 23:02 daschuer

Arch CI failure is fixed here: https://github.com/mixxxdj/mixxx/pull/4680

daschuer avatar Feb 17 '22 06:02 daschuer

So I think it is just the right solution to run qmllint with the build process.

This won't work. Only files that are built as qml modules are linted, but the majority of the qml code belongs to the skin which is not a module.

Holzhaus avatar Feb 17 '22 10:02 Holzhaus

What would be the solution? I think it would be straight forward to add a module for the skin as well. We can skip it during linking and use the plain qml files when installing Mixxx. This way qt/cmake will take care that the correct call to qmllint is issued.

daschuer avatar Feb 17 '22 13:02 daschuer

This PR is marked as stale because it has been open 90 days with no activity.

github-actions[bot] avatar Jun 15 '22 00:06 github-actions[bot]

QT6 build fails now with:

Warning: /__w/mixxx/mixxx/res/qml/Mixxx/Controls/WaveformOverview.qml:10:13: Cannot assign binding of type QObject to mixxx::qml::QmlPlayerProxy
    player: Mixxx.PlayerManager.getPlayer(root.group)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Warning: /__w/mixxx/mixxx/res/qml/Mixxx/Controls/WaveformOverview.qml:33:18: Cannot assign binding of type double to bool
        visible: trackLoadedControl.value
                 ^^^^^^^^^^^^^^^^^^^^^^^^
make[2]: *** [CMakeFiles/mixxx-qml-mixxxcontrols_qmllint.dir/build.make:76: CMakeFiles/mixxx-qml-mixxxcontrols_qmllint] Error 255

is this expected?

daschuer avatar Oct 28 '22 09:10 daschuer