Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QtQuick Controls not getting deployed, Controls.2 does #300

Closed
kviktor opened this issue Jun 14, 2018 · 16 comments
Closed

QtQuick Controls not getting deployed, Controls.2 does #300

kviktor opened this issue Jun 14, 2018 · 16 comments

Comments

@kviktor
Copy link

kviktor commented Jun 14, 2018

I'm trying to deploy a program that uses CircularGauge which uses QtQuick.Controls 1.4. In my own QML files I only use QtQuick.Controls 2.1/2.2. In the deployed filed I have both Controls and Controls.2 directories, the Controls directory has no files, however it has subfolders that have files in them. The Controls.2 directory has qml files and a .so file too. If I just manually copy the Controls folder from my build machine to the testing VM everything is great.

I've also tried adding a "dummy" import QtQuick.Controls 1.4 to my file and copying the CircularGauge.qml to my qmldir but neither worked.

@probonopd
Copy link
Owner

probonopd commented Jun 14, 2018

linuxdeployqt internally uses qmlscanner to determine which QML imports need to be bundled. Have you tried supplying an additiona -qmldir=... command line option pointing to the directory in which the file is that imports Controls?

Also, please run with -verbose=3 and search for Controls - do you see any error messages related to it?

@kviktor
Copy link
Author

kviktor commented Jun 15, 2018

I've tried adding a second -qmdir= parameter but it didn't work (it says Unknown argument) so instead I copied the CircularGauge.qml file into the the first qmldir directory but it didn't change anything. Here is the output of the log file: https://szi.app/shared/linuxqtdeploy.txt personally I didn't spot any errors, however it looks like the Controls directory is only getting deploy because of the Controls.Style.

Also this is shooting in the dark, but could it be this line that causes the trouble? https://github.com/probonopd/linuxdeployqt/blob/master/tools/linuxdeployqt/shared.cpp#L1505 (Controls directory already exists because of the different Styles, but does not contain the qml/shared object files)

@probonopd
Copy link
Owner

It's -qmldir=... not -qmdir=...

@probonopd
Copy link
Owner

It looks like CircularGauge gets deployed (at least partly):

Log: Deploying QML import "QtQuick.Extras"
Log: path: "/home/builder/Qt/5.9.1/gcc_64/qml/QtQuick/Extras"
Log: type: "module"
Log: copy: "/home/builder/Qt/5.9.1/gcc_64/qml/QtQuick/Extras" "/home/builder/myapp_build/myapp/myapp/qml/QtQuick/Extras"
Log:  copied: "/home/builder/Qt/5.9.1/gcc_64/qml/QtQuick/Extras/CircularGauge.qml"
Log:  to "/home/builder/myapp_build/myapp/myapp/qml/QtQuick/Extras/CircularGauge.qml"
Log: copyCopyrightFile: "/home/builder/Qt/5.9.1/gcc_64/qml/QtQuick/Extras/CircularGauge.qml"
Log:  copied: "/home/builder/Qt/5.9.1/gcc_64/qml/QtQuick/Extras/CircularGauge.qmlc"
Log:  to "/home/builder/myapp_build/myapp/myapp/qml/QtQuick/Extras/CircularGauge.qmlc"
Log: copyCopyrightFile: "/home/builder/Qt/5.9.1/gcc_64/qml/QtQuick/Extras/CircularGauge.qmlc"

In your logfile, there is a couple of instances of

Skip import: name or path is empty

Are these the files that are missing in the end, and are preventing the application from running correctly? Where do the original files live, in /home/builder/Qt/5.9.1/gcc_64/qml/ as well or somewhere else?

@kviktor
Copy link
Author

kviktor commented Jun 16, 2018

CircularGauge.qml itself is not a problem, it gets deployed properly. The problem is that it has an import QtQuick.Controls 1.4 statement in it but only Controls2 gets copied over (that I use from my code), Controls is not (apart from the Styles folders) even tho I tried manually copying the file to my qmldir before to make linuxdeployqt detect it.

Looking at the skips, I think it's the QtQuick.Controls.impl what I'm missing. Under /home/builder/Qt/5.9.1/gcc_64/ I have a regular Qt installation from their online installer.

Also may I ask where that qmlscanner program lives? Cause apparently after a Qt update our Mac release is showing the same problems, so it might not be an linuxdeployqt issue.

@probonopd
Copy link
Owner

Since linuxdeployqt was started off using from the macdeployqt codebase, we might well have inherited therecipe/qt#113...

@probonopd
Copy link
Owner

Indeed it seems from your log that libqtquickcontrolsplugin does not get deployed here but maybe should. What happens if you temporarily move away libqtquickcontrolsplugin from a working setup, does it still work then?

@probonopd
Copy link
Owner

Also may I ask where that qmlscanner program lives?

As your log says,

Log: Looking for qmlimportscanner at "/home/builder/Qt/5.9.1/gcc_64/bin/qmlimportscanner"
Log: qmlImportsPath (QT_INSTALL_QML): "/home/builder/Qt/5.9.1/gcc_64/qml"
Log: "/home/builder/Qt/5.9.1/gcc_64/bin/qmlimportscanner" ("-rootPath", "/home/builder/myapp_sources/client/gui_qt/layouts", "-importPath", "/home/builder/Qt/5.9.1/gcc_64/qml")

@kviktor
Copy link
Author

kviktor commented Jun 16, 2018

If I remove libqtquickcontrolsplugin.so I get

qrc:/myapp.qml:245 Type CircularGauge unavailable
file:///myapp/qml/QtQuick/Extras/CircularGauge.qml:42 module "QtQuick.Controls" plugin "qtquickcontrolsplugin" not found

If I remove the qmldir file from the Controls directory I get my original error

qrc:/myapp.qml:245 Type CircularGauge unavailable
file:///myapp/qml/QtQuick/Extras/CircularGauge.qml:42 module "QtQuick.Controls" version 1.4 is not installed

Could I have problems later if I just manually copy the folder over as a workaround?

@probonopd
Copy link
Owner

In which exact path does " qmldir file from the Controls directory" live and what is its contents?

@kviktor
Copy link
Author

kviktor commented Jun 16, 2018

I removed the qmldir file from my working app installation as a test, it lived in myapp/qml/QtQuick/Controls but the whole folder is the exact copy of the original Qt one.

@probonopd
Copy link
Owner

Please give the full paths of the original and copy qmldir file.

@kviktor
Copy link
Author

kviktor commented Jun 16, 2018

The original is in the Qt installation dir: /home/builder/Qt/5.9.1/gcc_64/qml/QtQuick/Controls
The one from the working application is in: /home/builder/myapp_build/myapp/myapp/qml/QtQuick/Controls (but this was manually copied over)

@probonopd
Copy link
Owner

probonopd commented Jun 16, 2018

I don't think manually copying over is a good thing to do. Instead, try passing in

-qmldir=/home/builder/Qt/5.9.1/gcc_64/qml/QtQuick -qmldir=/home/builder/Qt/5.9.1/gcc_64/qml/QtQuick/Controls

to your linuxdeployqt call.

@kviktor
Copy link
Author

kviktor commented Jun 18, 2018

With that QtQuick.Controls got copied over however QtQuick.Extras didn't (same thing, it had a Private directory so it was probably skipped).

With this workaround things seem to work great: 05e7f70 (originally I just removed the whole if/return part but with that the program ran for about 15 mins, with the current one it takes around 5 min to complete which is close to the original one, also it fixes the issue that xcbglintegrations is not getting copied over)

@probonopd
Copy link
Owner

Cool. Thanks @kviktor!

kviktor pushed a commit to kviktor/linuxdeployqt that referenced this issue Jun 19, 2018
turmary pushed a commit to turmary/linuxdeployqt that referenced this issue Jul 31, 2022
In probonopd/linuxdeployqt#300 (comment) @kviktor writes: 

> With this workaround things seem to work great (originally I just removed the whole if/return part but with that the program ran for about 15 mins, with the current one it takes around 5 min to complete which is close to the original one, also it fixes the issue that `xcbglintegrations` is not getting copied over)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants