probonopd / linuxdeployqt

Makes Linux applications self-contained by copying in the libraries and plugins that the application uses, and optionally generates an AppImage. Can be used for Qt and other applications
Other
2.17k stars 408 forks source link

linuxdeployqt doesn't always include all QtQuick files #102

Open kubark42 opened 7 years ago

kubark42 commented 7 years ago

MyAwesomeQtApp depends on both QtQuick and QtQuick2.0. It runs fine after a normal build. Strangely, if I am in my build directory, which is one level above the source code, and I run

linuxdeployqt-continuous-x86_64.AppImage MyAwesomeQtApp -qmldir=../

it all works. Yay!

However,

linuxdeployqt-continuous-x86_64.AppImage MyAwesomeQtApp -qmldir=../ -appimage

or

linuxdeployqt-continuous-x86_64.AppImage MyAwesomeQtApp -qmldir=../ -bundle-non-qt-libs

leads to

./AppRun 
QQmlApplicationEngine failed to load component
qrc:/parc-ul.qml:37 Type MissionForm unavailable
qrc:/qml/MissionForm.qml:100 Type CCalendar unavailable
qrc:/qml/CCalendar.qml:2 module "QtQuick.Controls" version 1.4 is not installed

If I look in the directory of the successful linuxdeployqt run, then I see that there are files in ~/Documents/sandbox/PARC-ul/build/qml/QtQuick/Controls. However, in the "failed" runs, there are no files in that directory. But when I manually copy over the files, with cp ../build.works/qml/QtQuick/Controls/* ./qml/QtQuick/Controls/, everything works.

Kind of a head scratcher. Unfortunately, I can't figure out how to inject these files into the AppImage, so that leaves it a little broken for me. Aside from that, everything is good, and thanks so much for making this!

P.S. Unrelated, but I have the same problem as identified in https://github.com/probonopd/linuxdeployqt/issues/25.

kubark42 commented 7 years ago

So weird. Now linuxdeployqt-continuous-x86_64.AppImage MyAwesomeQtApp -qmldir=../ also doesn't work properly anymore. There's some combination of commands which yielded the working results, though, grr...

kubark42 commented 7 years ago

Further update. I can get the AppImage to work by copying in the missing files before running linuxdeployqt-continuous-x86_64.AppImage MyAwesomeQtApp -qmldir=../ -bundle-non-qt-libs -appimage a second time.

probonopd commented 7 years ago

Please try with an absolute path instead of -qmldir=../ - does it make any difference?

probonopd commented 7 years ago

@kubark42 is your application available for testing?

kubark42 commented 7 years ago

Please try with an absolute path instead of -qmldir=../ - does it make any difference?

Lemme give that a shot. It's on a testing server so it might take me a bit to try that approach.

is your application available for testing?

It's an internal project, so not available for external testing. :(

kubark42 commented 7 years ago

Yes, identical behavior when using an absolute path. The other QML files are found and copied, just not the ones in QtQuick 1.0

andeplane commented 7 years ago

I have the same problem in my project (which is available github.com/ovilab/atomify).

I've actually seen this exact same problem with the macdeployqt tool also (not in my project though).

probonopd commented 7 years ago

Run the exact same command twice, does it make a difference? Sometimes we need 2 runs.

andeplane commented 7 years ago

Nope, that didn't solve this problem, but was my solution to another problem actually (if I run the command once, I get runtime problems with OpenGL context, but running it twice solves that issue). But the Quick Controls 1.4 problem is still here. My solution is to do cp /path/to/qt/qml/QtQuick/Controls/* qml/QtQuick/Controls/, so I'm happy enough. But as I said, this is also a problem with macdeployqt. I have planned to dig into it, but haven't thus far.

I must say thanks though, because this tool really helps!

If you're interested, my project linked to above (rather big though) reproduces the problem on my machine. Build instructions in the readme.

probonopd commented 7 years ago

What did you specify as -qmldir=? Try experimenting with that. You can specify multiple ones.

andeplane commented 7 years ago

That might solve the problem, but main.qml contains both 2.2 and 1.4 so ideally the tool should fix this. The deployment script I have that works can be found here. I have also tried a full path to the qml files.