linuxdeployqt icon indicating copy to clipboard operation
linuxdeployqt copied to clipboard

Add partial Qt 6 support.

Open RICCIARDI-Adrien opened this issue 1 year ago • 20 comments

With this PR most of the Qt 6 libraries and plugins should be deployed. QWebengine is not yet supported because it requires some specific actions. The tests have been made with Qt 6.3.1 on 64-bit Ubuntu 18.04. See https://github.com/probonopd/linuxdeployqt/pull/495 comments for more details about the tests.

RICCIARDI-Adrien avatar Jul 28 '22 14:07 RICCIARDI-Adrien

Build, and hence merge, blocked by https://github.com/probonopd/linuxdeployqt/issues/542

probonopd avatar Jul 29 '22 14:07 probonopd

You should open a new issue in this repository to finally fix the bundling of appimagetool.

TheAssassin avatar Jul 29 '22 14:07 TheAssassin

You should open a new issue in this repository to finally fix the bundling of appimagetool.

https://github.com/probonopd/linuxdeployqt/issues/542

probonopd avatar Jul 29 '22 15:07 probonopd

Question, how do you install Qt 6.3.1 on Ubuntu 18.04?

martinrotter avatar Sep 01 '22 08:09 martinrotter

I built it from sources with a little script I wrote : https://github.com/RICCIARDI-Adrien/Qt_Builder.

RICCIARDI-Adrien avatar Sep 01 '22 09:09 RICCIARDI-Adrien

I built it from sources with a little script I wrote : https://github.com/RICCIARDI-Adrien/Qt_Builder.

Use a recent Ubuntu/Debian distribution (at least Ubuntu 20.04).

martinrotter avatar Sep 01 '22 10:09 martinrotter

Use a recent Ubuntu/Debian distribution (at least Ubuntu 20.04).

At the beginning of Qt 6 I was not able to build it on Ubuntu versions older than 20.04, but now with Qt 6.2 and onward I am able to build it. Thank you for pointing that, I need to update the documentation !

RICCIARDI-Adrien avatar Sep 01 '22 11:09 RICCIARDI-Adrien

Unfortunately, my APP is based on QtWebEngine(Qt6.3.1), What can I do with it ?

gaojinhsu avatar Sep 03 '22 05:09 gaojinhsu

@gaojinhsu Is your app open source, so we can test the QtWebEngine deployment with it ? If not, have you tried deploying with this branch version of linuxdeployqt ? You could log the error messages and list the missing dependencies.

RICCIARDI-Adrien avatar Sep 03 '22 08:09 RICCIARDI-Adrien

@RICCIARDI-Adrien I built Qt6.3.1 from source code with ./configure -platform linux-clang -force-debug-info -nomake examples -nomake tests -opensource --prefix=/home/parallels/Qt/6.3.1/gcc_64/ -webengine-proprietary-codecs, my app is a very simple demo with a QWebEngineView on a MainWidget.

after running linuxdeployqt '/home/parallels/Desktop/build-demo-Desktop-Release/demo/opt/demo/demo' -verbose=2 -unsupported-allow-new-glibc -appimage >>~/Desktop/log.txt 2>&1, demo-x86_64.AppImage file was genarated. And here is the log when I tried to run this file in Terminal.

qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in "" libGL error: pci id for fd 10: 1ab8:0010, driver (null) pci id for fd 11: 1ab8:0010, driver (null) Could not find QtWebEngineProcess Aborted (core dumped) here is the linuxdeployqt log: log.txt

gaojinhsu avatar Sep 03 '22 10:09 gaojinhsu

@gaojinhsu Thank you for the logs.

  • A dump question : I assume that your application is running well when you launch it from Qt Creator, so the execution error you get when running the appimage is only related to the appimage creation ?
  • If you try to package the application without giving the option -appimage to linuxdeployqt you will get a standalone application in /home/parallels/Desktop/build-demo-Desktop-Release/demo/opt/demo/demo.
    • Can you try to run it and tell if the same qt.qpa.plugin error occurs ?
    • Can you also execute ldd on the application binary ?

RICCIARDI-Adrien avatar Sep 04 '22 07:09 RICCIARDI-Adrien

@RICCIARDI-Adrien

  • That's true, my application is running well when I launch it from Qt Creator.
  • The standalone application still gets this error. qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in "" This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. Available platform plugins are: xcb. Aborted (core dumped) here are the logs, ldd_before_linuxdeployqt.txt linuxdeployqt_log.txt ldd_after_linuxdeployqt.txt
  • A dump question : I assume that your application is running well when you launch it from Qt Creator, so the execution error you get when running the appimage is only related to the appimage creation ?

gaojinhsu avatar Sep 05 '22 03:09 gaojinhsu

Well, I will not compile Qt 6.3.x from sources. Really out-of-scope since I build my stuff on github actions.

I switched to "linuxdeploy" instead.

https://github.com/martinrotter/rssguard/blob/master/resources/scripts/github-actions/build-linux-mac.sh#L69

martinrotter avatar Sep 05 '22 05:09 martinrotter

@martinrotter Does linuxdeploy work well with Qt 6 ?

RICCIARDI-Adrien avatar Sep 05 '22 12:09 RICCIARDI-Adrien

@martinrotter Does linuxdeploy work well with Qt 6 ?

@RICCIARDI-Adrien @martinrotter I tried linuxdeploy and linuxdeployqt (git branch:add_qt6_support) both, here is the result.

  1. os: ubuntu 22.04 + Qt6(built from sources with ./configure -platform linux-clang -force-debug-info -nomake examples -nomake tests -opensource --prefix=/home/parallels/Qt/6.3.1/gcc_64/ -webengine-proprietary-codecs)
  • linuxdeploy : Demo with QWebEngineView: AppImage file generated, but failed to launch by double-clicking. Demo without QWebEngineView: AppImage file generated, but failed to launch by double-clicking.

    tried to run the above two Demos in Terminal, also get this error both: qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in "" This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. Aborted (core dumped)

  • linuxdeployqt(git branch:add_qt6_support) : Demo with QWebEngineView: AppImage file generated, but failed to launch by double-clicking. get same error when runing in Termial.

    Demo without QWebEngineView: AppImage file generated, succeed to launch by double-clicking.

  1. os: ubuntu 12.04 + Qt5.15.2
  • linuxdeployqt(git branch: master) : Demo with QWebEngineView: AppImage file generated, succeed to launch by double-clicking. compare to other cases, an additional folder libexec containing QtWebEngineProcess and qt.conf was created.

    Demo without QWebEngineView: AppImage file generated, succeed to launch by double-clicking.

Seems Qt5.15.2 + ubuntu 12.04 is a better choice, but the tragedy is errors occur when building Qt5.15.2 from sources . I have to build QtWebEngine with option -webengine-proprietary-codecs.

Is still there a chance that linuxdeployqt(git branch:add_qt6_support) can fix the QtWebEngine issue?

gaojinhsu avatar Sep 06 '22 07:09 gaojinhsu

@martinrotter Does linuxdeploy work well with Qt 6 ?

For me, yes.

martinrotter avatar Sep 06 '22 07:09 martinrotter

@martinrotter Does linuxdeploy work well with Qt 6 ?

For me, yes.

Does your app include QtWebEngine?

gaojinhsu avatar Sep 06 '22 10:09 gaojinhsu

@martinrotter Does linuxdeploy work well with Qt 6 ?

For me, yes.

Does your app include QtWebEngine?

Yes, I published link to my build script few comments above. I was using linuxdeployQT with Qt 5 for a long time but now I want to migrate to Qt 6 and linux deploy seems to work well in linuxdeploy.

martinrotter avatar Sep 06 '22 11:09 martinrotter

@martinrotter Does linuxdeploy work well with Qt 6 ?

For me, yes.

Does your app include QtWebEngine?

Yes, I published link to my build script few comments above. I was using linuxdeployQT with Qt 5 for a long time but now I want to migrate to Qt 6 and linux deploy seems to work well in linuxdeploy.

I adapt your build scrip for building my app, as a result, appimage file is created, and I can launch it by double-clicking on my PC, but when I copy the file to another PC, I can only launch it from Terminal. here is the log

qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
libGL error: pci id for fd 10: 1ab8:0010, driver (null)
pci id for fd 11: 1ab8:0010, driver (null)
qt.webenginecontext: 

GL Type: desktop
Surface Type: OpenGL
Surface Profile: CompatibilityProfile
Surface Version: 4.0
QSG RHI Backend: OpenGL
Using Supported QSG Backend: yes
Using Software Dynamic GL: no
Using Multithreaded OpenGL: yes

Init Parameters:
  *  application-name AppRun.wrapped 
  *  browser-subprocess-path /tmp/.mount_Gamer-f4SSi8/usr/libexec/QtWebEngineProcess 
  *  create-default-gl-context  
  *  disable-features ConsolidatedMovementXY,InstalledApp,BackgroundFetch,WebOTP,WebPayments,WebUSB,PictureInPicture 
  *  disable-setuid-sandbox  
  *  disable-speech-api  
  *  enable-features NetworkServiceInProcess,TracingServiceInProcess 
  *  enable-threaded-compositing  
  *  in-process-gpu  
  *  use-gl desktop 

I think maybe this error qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in "" can be ingored. Anyway, thanks, dude. I can see victory is just at the corner.

gaojinhsu avatar Sep 07 '22 09:09 gaojinhsu

@martinrotter Does linuxdeploy work well with Qt 6 ?

For me, yes.

Does your app include QtWebEngine?

Yes, I published link to my build script few comments above. I was using linuxdeployQT with Qt 5 for a long time but now I want to migrate to Qt 6 and linux deploy seems to work well in linuxdeploy.

I adapt your build scrip for building my app, as a result, appimage file is created, and I can launch it by double-clicking on my PC, but when I copy the file to another PC, I can only launch it from Terminal. here is the log

qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
libGL error: pci id for fd 10: 1ab8:0010, driver (null)
pci id for fd 11: 1ab8:0010, driver (null)
qt.webenginecontext: 

GL Type: desktop
Surface Type: OpenGL
Surface Profile: CompatibilityProfile
Surface Version: 4.0
QSG RHI Backend: OpenGL
Using Supported QSG Backend: yes
Using Software Dynamic GL: no
Using Multithreaded OpenGL: yes

Init Parameters:
  *  application-name AppRun.wrapped 
  *  browser-subprocess-path /tmp/.mount_Gamer-f4SSi8/usr/libexec/QtWebEngineProcess 
  *  create-default-gl-context  
  *  disable-features ConsolidatedMovementXY,InstalledApp,BackgroundFetch,WebOTP,WebPayments,WebUSB,PictureInPicture 
  *  disable-setuid-sandbox  
  *  disable-speech-api  
  *  enable-features NetworkServiceInProcess,TracingServiceInProcess 
  *  enable-threaded-compositing  
  *  in-process-gpu  
  *  use-gl desktop 

I think maybe this error qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in "" can be ingored. Anyway, thanks, Dude. I can see victory is just at the corner.

I have some problems with gstreamer via linuxdeploy. Perhaps report it as a bug in their github page. maybe they will be able to help/fix.

martinrotter avatar Sep 07 '22 10:09 martinrotter

What's the status of this, any chance of this getting merged @probonopd ?

arximboldi avatar Oct 11 '22 19:10 arximboldi

All checks have failed

First step would be to get this to build "green" rather than "red" on the GitHub Actions CI. Then we could consider it for merging.

probonopd avatar Oct 12 '22 18:10 probonopd

Builds "green" now. Thanks @RICCIARDI-Adrien.

Fingers crossed. Hopefully it will not break things. Otherwise will need to rollback.

probonopd avatar Apr 04 '23 19:04 probonopd