Skip to content

Conversation

@messmerd
Copy link
Member

@messmerd messmerd commented Nov 3, 2025

Upgrades all builds (except Windows MinGW) to Qt6.

TODO:

  • Fix Linux packaging
    • Decide if bundling Qt5 for SUIL is wanted
  • Fix macOS x86_64 minimum deployment target
    • Decide if MACOSX_DEPLOYMENT_TARGET=14.0 is wanted
  • Remove x11 embed?

@messmerd
Copy link
Member Author

messmerd commented Nov 3, 2025

@tresf The Linux builds are failing in the packaging step, and the macOS x86_64 build is failing due to the macOS 10.13 target not supporting std::filesystem which is only available with >=10.15.

@tresf
Copy link
Member

tresf commented Nov 4, 2025

@tresf The Linux builds are failing in the packaging step

The SUIL dependency (LV2) links against Qt5 still. I'm unsure if we should bundle this or not (and until #7201 is merged, I'm not sure how easy this is to test). I would expect this dependency to be installed with libsuil-0-0, but apparently it's not?

# simplified for readiblity
linuxdeploy LMMS.AppDir
--desktop-file lmms.desktop
--plugin qt
--deploy-deps-only usr/lib/lmms
--deploy-deps-only usr/lib/lmms/ladspa
--deploy-deps-only usr/lib/jack/libjack.so.0
--deploy-deps-only /usr/lib/suil-0
--exclude-library *libgallium*
--verbosity 2
ERROR: Could not find dependency: libQt5Widgets.so.5 

Required by:

suil-0/libsuil_x11.so
suil-0/libsuil_x11_in_gtk2.so
suil-0/libsuil_x11_in_gtk3.so
suil-0/libsuil_x11_in_qt5.so # <---- HERE

Links against the following:

ldd suil-0/libsuil_x11_in_qt5.so
#	libQt5Widgets.so.5 => libQt5Widgets.so.5 (0x0000fae163bd0000)
#	libQt5Core.so.5 => libQt5Core.so.5 (0x0000fae163620000)
#	libQt5X11Extras.so.5 => libQt5X11Extras.so.5 (0x0000fae1635f0000)

... that's my best guess at least. Attempted via d95f598.

If we choose NOT to bundle this, we may tell linuxdeploy to ignore (--exclude-library) these dependencies.

I also noticed under mixed Qt environments (ones that contain both Qt5 and Qt6) testing locally that our linuxdeploy-plugin-qt plugin needs to be made aware of which Qt version to use. Addressed via 3ed4006.

@messmerd
Copy link
Member Author

messmerd commented Nov 4, 2025

Looks like Qt6 support for X11 was not added to suil until this commit from last year: lv2/suil@35804e3 This is a part of version 0.10.22 which was released in January.

To fix this, we may need to build suil from source like we do for fltk. Fortunately it's a tiny library, so it should not take much time to build it.

@tresf
Copy link
Member

tresf commented Nov 4, 2025

To fix this, we may need to build suil from source like we do for fltk. Fortunately it's a tiny library, so it should not take much time to build it.

Agreed however I think we should have unit tests to base this decision off of (the library is currently unused).

If the UIs in #7201 crash when Qt versions are mixed, that helps drive this decision. Pinging @JohannesLorenz as an FYI.

@tresf
Copy link
Member

tresf commented Nov 4, 2025

Also, somewhat related, but #8105 will drastically change the landscape of dependency decisions if we change our AppImages to use that. At time of writing this, AppImages produced by quick-sharun are better in just about every way when compared to those built with linuxdeploy.

@tresf
Copy link
Member

tresf commented Nov 4, 2025

the macOS 10.13 target not supporting std::filesystem which is only available with >=10.15.

Patched via 80ab858, however this will raise the minimum target significantly.

  • Testing this on macOS 15 (Apple Silicon), it raises the MACOSX_DEPLOYMENT_TARGET from 11.0 to 14.0.
  • Testing this on macOS 15 (Intel), it raises the MACOSX_DEPLOYMENT_TARGET from 10.13 to 14.0.

Related:

Quoting:

What's a bit more nuanced, is that qmake comes as quite the assumption, since it's not even a library we bundle, but rather a build-tool that we utilize, so it's more of "what are other people doing" test rather than a definitive "lowest common denominator".

@messmerd I'm also fine tossing-out the script and just hard-coding this.

@messmerd
Copy link
Member Author

messmerd commented Nov 4, 2025

Patched via 80ab858, however this will raise the minimum target significantly.

That's definitely an issue.

I'm also fine tossing-out the script and just hard-coding this.

That's fine with me. It could be set by variables in the matrix section like #8004 did originally. If needed, we could put comments there justifying the choice.

I still think the script is worth keeping if we could repurpose it as a sanity check for our manually chosen MACOSX_DEPLOYMENT_TARGET, ensuring it doesn't conflict with what the Homebrew libraries or system support.

@tresf
Copy link
Member

tresf commented Nov 4, 2025

That's fine with me. It could be set by variables in the matrix section like #8004 did originally. If needed, we could put comments there justifying the choice.

Well, when I originally fought this proposal I was under the false assumption that deployment targets were hard-limited. Since we know now that it's more nuanced, I'm just fine using that technique. Thanks for the reminder, it makes writing the yaml quicker. :D

I still think the script is worth keeping if we could repurpose it as a sanity check for our manually chosen MACOSX_DEPLOYMENT_TARGET, ensuring it doesn't conflict with what the Homebrew libraries or system support.

I'd love to keep it, but in my experience it's too unreliable as proven by the 10.13 -> 14.0 leap just by switching qt versions. Let's just ditch it and keep it hard-coded until we learn a better way (if a better way even exists). In hindsight, I find this easier to read as well. The one thing we lose is the logic telling us the lowest that the SDK supports, but that's so arbitrarily low, that I have a feeling we're more likely to remain at the mercy of which APIs us and our deps expect and never hit that lower boundary.

@tresf
Copy link
Member

tresf commented Nov 6, 2025

Builds are fixed. We should probably download and test the various platforms before switching. I'm fine back-burner-ing SUIL task (although I would love feedback from @JohannesLorenz if possible) as well as shelving the x11embed task.

@tresf tresf marked this pull request as ready for review November 6, 2025 18:21
@tresf tresf mentioned this pull request Nov 6, 2025
26 tasks
@JohannesLorenz
Copy link
Contributor

JohannesLorenz commented Nov 7, 2025

If the UIs in #7201 crash when Qt versions are mixed

I can surely test, but what exactly do you mean by "mixed"? I currently run CMake with this PR and get -- Qt version: 5.15.17. When I use -DWANT_QT6=ON, I get -- Qt version: 6.9.2.

Edit: I think I got it. My suil links to Qt5:

ldd /usr/lib/suil-0/libsuil_x11_in_qt5.so

So, you ask, what happens if I rebase #7201 on this PR and compile with -DWANT_QT6=ON?

@tresf
Copy link
Member

tresf commented Nov 7, 2025

So, you ask, what happens if I rebase #7201 on this PR and compile with -DWANT_QT6=ON?

Correction... if you rebase against this AND use the appimage provided by the CI (which will use the mismatched Qt versions)

what exactly do you mean by "mixed"?

In short, Ubuntu doesn't offer SUIL libs compiled against Qt6 yet (your distro likely does), so if we continue to use Ubuntu to build our AppImages, we're at the mercy of whatever Ubuntu has (or as @messmerd has stated, may require using CI to compile SUIL libs from source).

I'd like to know if SUIL compiled against Qt5 (when LMMS is compiled against Qt6) is a breaking change. If so, we'll have to leverage one of the above solutions.

Note that our reliance on Ubuntu dependencies may change soon thanks to #8105, but I don't want to hold up Qt6 support for that effort.

@JohannesLorenz
Copy link
Contributor

JohannesLorenz commented Nov 7, 2025

Thanks for explaining.

I just rebased #7201 on master, and the commit of #7339 causes segfaults for the Lv2 UIs when I start them (at the point where it chooses a suiting UI type) - assuming I configure with -DWANT_QT6=ON (without, it works). So I need to investigate that first before trying what you explained.

@JohannesLorenz
Copy link
Contributor

Here is a backtrace of mentioned crash:

#0  0x00007ffff589894c in ?? () from /usr/lib/libc.so.6
#1  0x00007ffff583e410 in raise () from /usr/lib/libc.so.6
#2  0x00007ffff582557a in abort () from /usr/lib/libc.so.6
#3  0x00007ffff5c97bf6 in __gnu_cxx::__verbose_terminate_handler ()
    at /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/vterminate.cc:95
#4  0x00007ffff5cb1eba in __cxxabiv1::__terminate (handler=<optimized out>)
    at /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:48
#5  0x00007ffff5c975d9 in std::terminate () at /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:58
#6  0x00007ffff5cb2176 in __cxxabiv1::__cxa_throw (obj=<optimized out>, tinfo=0x7ffff5e83a98 <typeinfo for std::bad_alloc>, 
    dest=0x7ffff5cb0160 <std::bad_alloc::~bad_alloc()>) at /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/eh_throw.cc:98
#7  0x00007ffff668f327 in qBadAlloc() () from /usr/lib/libQt6Core.so.6
#8  0x00007ffff66ae7a0 in ?? () from /usr/lib/libQt6Core.so.6
#9  0x00007ffff6830977 in QByteArray::insert(long long, QByteArrayView) () from /usr/lib/libQt6Core.so.6
#10 0x00005555558fcdcd in QByteArray::append (this=0x7fffffffb760, a=...) at /usr/include/qt6/QtCore/qbytearray.h:299
#11 0x00005555558fcd6c in QByteArray::append (this=0x7fffffffb760, s=0x7fff9b16c318 "QWidget", len=-1)
    at /usr/include/qt6/QtCore/qbytearray.h:296
#12 0x00005555558fcd04 in QByteArray::append (this=0x7fffffffb760, s=0x7fff9b16c318 "QWidget")
    at /usr/include/qt6/QtCore/qbytearray.h:294
#13 0x00007fff9adab253 in ?? () from /usr/lib/libQt5Widgets.so.5
#14 0x00007fff9ad4a2fd in ?? () from /usr/lib/libQt5Widgets.so.5
#15 0x00007ffff7fc82a7 in ?? () from /lib64/ld-linux-x86-64.so.2
#16 0x00007ffff7fc837d in ?? () from /lib64/ld-linux-x86-64.so.2
#17 0x00007ffff7fc44f5 in _dl_catch_exception () from /lib64/ld-linux-x86-64.so.2
#18 0x00007ffff7fcf2a9 in ?? () from /lib64/ld-linux-x86-64.so.2
#19 0x00007ffff7fc4456 in _dl_catch_exception () from /lib64/ld-linux-x86-64.so.2
#20 0x00007ffff7fcf75a in ?? () from /lib64/ld-linux-x86-64.so.2
#21 0x00007ffff5892d04 in ?? () from /usr/lib/libc.so.6
#22 0x00007ffff7fc4456 in _dl_catch_exception () from /lib64/ld-linux-x86-64.so.2
#23 0x00007ffff7fc45a9 in ?? () from /lib64/ld-linux-x86-64.so.2
#24 0x00007ffff58927f3 in ?? () from /usr/lib/libc.so.6
#25 0x00007ffff5892dbb in dlopen () from /usr/lib/libc.so.6
#26 0x00007ffff76fbf49 in suil_instance_new () from /usr/lib/libsuil-0.so.0
#27 0x0000555555af2d64 in lmms::gui::Lv2ViewProc::Lv2ViewProc (this=0x55555f6f79e0, parent=0x555560f31be0, 
    proc=0x7fffa00018e0, colNum=6) at src/gui/Lv2ViewBase.cpp:309

Note the different Qt versions between frames 12 and 13. It looks like this for all plugins.

@JohannesLorenz
Copy link
Contributor

JohannesLorenz commented Nov 8, 2025

Nonetheless I now tried running the Linux AppImage on my Arch PC. The same crashes, the backtrace looks almost the same:

#0  0x00007ffff5a9894c in ?? () from /usr/lib/libc.so.6
#1  0x00007ffff5a3e410 in raise () from /usr/lib/libc.so.6
#2  0x00007ffff5a2557a in abort () from /usr/lib/libc.so.6
#3  0x00007ffff5e97bf6 in __gnu_cxx::__verbose_terminate_handler ()
    at /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/vterminate.cc:95
#4  0x00007ffff5eb1eba in __cxxabiv1::__terminate (handler=<optimized out>)
    at /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:48
#5  0x00007ffff5e975d9 in std::terminate () at /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:58
#6  0x00007ffff5eb2176 in __cxxabiv1::__cxa_throw (obj=<optimized out>, tinfo=0x7ffff6083a98 <typeinfo for std::bad_alloc>, 
    dest=0x7ffff5eb0160 <std::bad_alloc::~bad_alloc()>) at /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/eh_throw.cc:98
#7  0x00007ffff68a23f5 in qBadAlloc() () from /tmp/.mount_lmms-1nFACBf/usr/bin/../lib/libQt6Core.so.6
#8  0x00007ffff6a16c0f in ?? () from /tmp/.mount_lmms-1nFACBf/usr/bin/../lib/libQt6Core.so.6
#9  0x00007ffff6a157f8 in QByteArray::insert(long long, QByteArrayView) ()
   from /tmp/.mount_lmms-1nFACBf/usr/bin/../lib/libQt6Core.so.6
#10 0x00007fffb89c6a08 in ?? () from /tmp/.mount_lmms-1nFACBf/usr/lib/suil-0//../libQt5Widgets.so.5
#11 0x00007fffb89c68ad in ?? () from /tmp/.mount_lmms-1nFACBf/usr/lib/suil-0//../libQt5Widgets.so.5
#12 0x00007ffff7fc82a7 in ?? () from /lib64/ld-linux-x86-64.so.2
#13 0x00007ffff7fc837d in ?? () from /lib64/ld-linux-x86-64.so.2
#14 0x00007ffff7fc44f5 in _dl_catch_exception () from /lib64/ld-linux-x86-64.so.2
#15 0x00007ffff7fcf2a9 in ?? () from /lib64/ld-linux-x86-64.so.2
#16 0x00007ffff7fc4456 in _dl_catch_exception () from /lib64/ld-linux-x86-64.so.2
#17 0x00007ffff7fcf75a in ?? () from /lib64/ld-linux-x86-64.so.2
#18 0x00007ffff5a92d04 in ?? () from /usr/lib/libc.so.6
#19 0x00007ffff7fc4456 in _dl_catch_exception () from /lib64/ld-linux-x86-64.so.2
#20 0x00007ffff7fc45a9 in ?? () from /lib64/ld-linux-x86-64.so.2
#21 0x00007ffff5a927f3 in ?? () from /usr/lib/libc.so.6
#22 0x00007ffff5a92dbb in dlopen () from /usr/lib/libc.so.6
#23 0x00007ffff7d6a02f in suil_instance_new () from /tmp/.mount_lmms-1nFACBf/usr/bin/../lib/libsuil-0.so.0
#24 0x000055555584b48e in lmms::gui::Lv2ViewProc::Lv2ViewProc (this=0x555565851350, parent=0x555566243ba0, 
    proc=0x7fffb0001940, colNum=<optimized out>) at /home/runner/work/lmms/lmms/src/gui/Lv2ViewBase.cpp:309

Once again, we see the Qt difference, now between frames 10 and 9.

In both backtraces, it looks like libQt5Gui is linked against libQt6Core (in the first case, both libs are from my system, in the second case, both are inside the AppImage). That makes 0 sense though, and using ldd shows in both cases that this is not true. I interpret the line

#10 0x00007fffb89c6a08 in ?? () from /tmp/.mount_lmms-1nFACBf/usr/lib/suil-0//../libQt5Widgets.so.5

that libsuil tries to dynamically load libQt5Gui, while we use it in Qt6 context.

In short, I think the problem is indeed that suil is compiled fixed, and we need to add it to our source tree to compile it with the correct Qt version.

Note: I do use suil 0.10.22 on my Arch Linux, so in theory, this should support Qt6.

@PhysSong
Copy link
Member

PhysSong commented Nov 8, 2025

Note: I do use suil 0.10.22 on my Arch Linux, so in theory, this should support Qt6.

@JohannesLorenz In #7201, Lv2ViewProc::hostUiTypeUri returns LV2_UI__Qt5UI, which should be LV2_UI_PREFIX "Qt6UI" on Qt 6 with suitable version of suil.

@JohannesLorenz
Copy link
Contributor

JohannesLorenz commented Nov 8, 2025

@JohannesLorenz In #7201, Lv2ViewProc::hostUiTypeUri returns LV2_UI__Qt5UI, which should be LV2_UI_PREFIX "Qt6UI" on Qt 6 with suitable version of suil.

Thanks for the hint! I added #define QT_VERSION_MAJOR @QT_VERSION_MAJOR@ into src/lmmsconfig.h.in and used it to now return the matching Qt version in Lv2ViewProc::hostUiTypeUri. This fixes the crashes. However, at first, no plugin UI seemed to support Qt6 :disappointed (both with my local version and the AppImage):

Searching for plugin UI matching Host UI http://lv2plug.in/ns/extensions/ui#Qt6UI ...
Skipping plugin UI https://github.com/asb2m10/dexed#ExternalUI - not supported
Skipping plugin UI https://github.com/asb2m10/dexed#ParentUI - not supported
... no matching plugin UI found. Defaulting to LMMS UI.

So I compiled suil from upstream (main) on my own and set LD_LIBRARY_PATH to point to it.

For the local version, this entirely fixed it. For the AppImage version, however, I got

Found supported plugin UI http://lv2plug.in/ns/extensions/ui#X11UI
suil error: Failed to open module /tmp/.mount_lmms-1hhHilA/usr/lib/suil-0//libsuil_x11_in_qt6.so (/tmp/.mount_lmms-1hhHilA/usr/lib/suil-0//libsuil_x11_in_qt6.so: Kann die Shared-Object-Datei nicht öffnen: Datei oder Verzeichnis nicht gefunden)

This is indeed true, there is no such libsuil_x11_in_qt6.so, only for qt5 (which is was tres mentioned) - neither in my Arch version, nor in the mounter AppImage.

Concluding: Many distros will still ship an old suil, which will make Lv2 not work anyways. Even for my Arch (which is pretty much up to date) I had to compile for myself. Since compiling suil only takes 5-6 seconds, I guess it's fair to add it as a submodule.

@JohannesLorenz
Copy link
Contributor

it's fair to add it as a submodule

Btw, I can offer to do this myself - add a submodule to src/3rdparty and append a commit to this PR. Might be easier, since I already have experience with suil and testing it. Since suil is built with meson, the interesting question is whether we let our CMakeLists simply execute meson (which adds another dependency to meson) or whether our CMakeLists should copy the meson logic and bypass the meson.build file.

Let me know if I should get involved here.

@tresf
Copy link
Member

tresf commented Nov 11, 2025

@JohannesLorenz In #7201, Lv2ViewProc::hostUiTypeUri returns LV2_UI__Qt5UI, which should be LV2_UI_PREFIX "Qt6UI" on Qt 6 with suitable version of suil.

Thanks for the hint! I added #define QT_VERSION_MAJOR @QT_VERSION_MAJOR@ into src/lmmsconfig.h.in and used it to now return the matching Qt version in Lv2ViewProc::hostUiTypeUri. This fixes the crashes. However, at first, no plugin UI seemed to support Qt6 :disappointed (both with my local version and the AppImage):

Searching for plugin UI matching Host UI http://lv2plug.in/ns/extensions/ui#Qt6UI ...
Skipping plugin UI https://github.com/asb2m10/dexed#ExternalUI - not supported
Skipping plugin UI https://github.com/asb2m10/dexed#ParentUI - not supported
... no matching plugin UI found. Defaulting to LMMS UI.

@PhysSong good catch! I had a feeling there was a lingering Qt5 reference somewhere!

So I compiled suil from upstream (main) on my own and set LD_LIBRARY_PATH to point to it.

For the local version, this entirely fixed it. For the AppImage version, however, I got

Found supported plugin UI http://lv2plug.in/ns/extensions/ui#X11UI
suil error: Failed to open module /tmp/.mount_lmms-1hhHilA/usr/lib/suil-0//libsuil_x11_in_qt6.so (/tmp/.mount_lmms-1hhHilA/usr/lib/suil-0//libsuil_x11_in_qt6.so: Kann die Shared-Object-Datei nicht öffnen: Datei oder Verzeichnis nicht gefunden)

Hmm... that's odd... I would expect all dependencies to deploy, since we call --deploy-deps-only on every file in suil-0 in our AppImage.

# Copy Suil modules
if(CPACK_SUIL_MODULES)
set(SUIL_MODULES_TARGET "${APP}/usr/lib/suil-0/")
file(MAKE_DIRECTORY "${SUIL_MODULES_TARGET}")
file(COPY ${CPACK_SUIL_MODULES} DESTINATION "${SUIL_MODULES_TARGET}")
list(APPEND DEPLOY_DEPS --deploy-deps-only "${APP}/usr/lib/suil-0/")
endif()

Note that the one line from this PR that was needed with mixed Qt versions is here. The rest of this PR only really pertains to the CI.

This is indeed true, there is no such libsuil_x11_in_qt6.so, only for qt5 (which is was tres mentioned) - neither in my Arch version, nor in the mounter AppImage.

Hmm... I don't understand... why would suil want a lib that doesn't exist? If x11 support for Qt6 is somehow missing or disabled, we need to gracefully handle this.

@JohannesLorenz what I was really curious about, was whether or not AppImages created from Ubuntu 22.04 were capable of running Qt5 SUIL alongside Qt6 LMMS. That's most easily done by making a branch and testing the artifacts created by the CI, making sure to cherry-pick this line to allow mixed Qt versions to coexist. Edit: by rebasing your branch atop this one so CI runs with Qt6 enabled.

@Rossmaxx
Copy link
Contributor

Rossmaxx commented Nov 12, 2025

If x11 support for Qt6 is somehow missing or disabled

It is disabled, because I didn't want to work on the x11embed submodule (I could if i wanted to, but I felt too lazy). Also, every single embedding method seems kinda broken lately. We should try to fix it but for now, I felt having no embed by default is fine. If embedding is really needed, I would prefer to use qt embedding, but that's my preference. But unfortunately, qt embedding is broken too the last time I tested.

@JohannesLorenz
Copy link
Contributor

@JohannesLorenz what I was really curious about, was whether or not AppImages created from Ubuntu 22.04 were capable of running Qt5 SUIL alongside Qt6 LMMS. That's most easily done by making a branch and testing the artifacts created by the CI, making sure to cherry-pick this line to allow mixed Qt versions to coexist. Edit: by rebasing your branch atop this one so CI runs with Qt6 enabled.

This was what I did before PhysSong's comment, right? Which leaded to the gdb logs showing the mismatching Qt versions and the crashes. Then PhysSong said I should run Qt6 SUIL alongside Qt6 LMMS - which I then did.

If you want to check, my branch is here - though this is with PhysSong's suggestion.

@tresf
Copy link
Member

tresf commented Nov 14, 2025

If you want to check, my branch is here - though this is with PhysSong's suggestion.

Thanks! (yes, the builds from CI are broken; LV2 UIs segfault for me too, Ubuntu 24.04, ARM64)

@JohannesLorenz In #7201, Lv2ViewProc::hostUiTypeUri returns LV2_UI__Qt5UI, which should be LV2_UI_PREFIX "Qt6UI" on Qt 6 with suitable version of suil.

I added #define QT_VERSION_MAJOR @QT_VERSION_MAJOR@ into src/lmmsconfig.h.in and used it to now return the matching Qt version in Lv2ViewProc::hostUiTypeUri

First, I think #cmakedefine does this assignment for you, so I think this can be simplified to match the others:

#cmakedefine QT_VERSION_MAJOR @QT_VERSION_MAJOR@

However I don't think this is correct in the context of SUIL since this assumes the LMMS' Qt version is always the same as the SUIL's Qt version...

  • ✅ Works great for systems that build their own SUIL
  • ⛔ Doesn't work for systems that have it prepackaged (such as Ubuntu 22.04, 24.04).

... Apparently I authored FindSuilModules.cmake to help us with locating suil-0... I suppose we could add some rube-goldberg Qt-version detection in there, but I'm uncertain if it'll be worth it (i.e if it'll work)... I guess as a trial we could simply revert the #cmakedefine QT_VERSION_MAJOR in our CI and let it fallback to Qt5... this will let us know for sure if Qt6 and Qt5 can play nicely before trying to leverage any detection tricks. I'm still a bit confused why this value isn't handled internal by the SUIL API... Since SUIL promises to embed a Qt UI without linking against Qt at compile time, I would expect the same to be possible for Qt6 and Qt5, but perhaps my understanding is wrong.

@messmerd
Copy link
Member Author

messmerd commented Nov 14, 2025

I'm fine with adding suil as a submodule and building it ourselves when LV2 support is enabled.

This option is simple and will always work regardless of Qt version. It's also easy on devs since no one needs to bother with providing a compatible suil themselves. And it should also allow us to use suil in MinGW builds.

The only downside is suil needs to be built, which may take a little time. But if that ends up being an issue for CI builds, we can just cache it.


If for some reason we instead want devs to provide their own pre-built suil (whether a system package or otherwise), we would need a way to detect whether it has Qt5/Qt6 support and fail if it doesn't match what LMMS is configured to build with.

If we have the libsuil-0.so file, here's one way to detect Qt support:

strings /usr/lib/x86_64-linux-gnu/libsuil-0.so | grep suil_x11_in_qt

For me, this just prints "suil_x11_in_qt5" which confirms the libsuil-dev on Linux Mint 22 (or Ubuntu 24.04) only supports Qt5.

EDIT: Or checking that libsuil-0-0 provides the file libsuil_x11_in_qt5.so or libsuil_x11_in_qt6.so.


@JohannesLorenz We don't need to set a QT_VERSION_MAJOR macro from CMake when we can do this:

#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
// Using Qt6
#else
// Using Qt5
#endif

Or:

#define QT_VERSION_MAJOR (QT_VERSION >> 24)

@tresf
Copy link
Member

tresf commented Nov 14, 2025

detect whether it has Qt5/Qt6 support and fail if it doesn't match what LMMS is configured to build with.

Hmm... this may very well be true, but so far, we have no evidence to support this claim.

checking that libsuil-0-0 provides the file libsuil_x11_in_qt5.so or libsuil_x11_in_qt6.so.

That's the crude solution I'd use.

@JohannesLorenz We don't need to set a QT_VERSION_MAJOR macro from CMake when we can do this

Good catch.

@tresf
Copy link
Member

tresf commented Nov 14, 2025

That's the crude solution I'd use.

Mockup here: da01ed2

include(FindSuilModules.cmake)

message("SUIL Module wants Qt${Suil_QT_VERSION_MAJOR}")

Output:

SUIL Module wants Qt5

@Rossmaxx
Copy link
Contributor

I'm fine with adding suil as a submodule and building it ourselves when LV2 support is enabled.

I agree with this approach, especially if building suil doesn't take long. Sounds better than fiddling around packaging and build tools.

@messmerd
Copy link
Member Author

Hmm... this may very well be true, but so far, we have no evidence to support this claim.

It seems clear to me that libsuil_x11_in_qt5.so is needed for suil to work with a Qt5 host, and libsuil_x11_in_qt6.so is needed for a Qt6 host? And that explains why libsuil_x11_in_qt5.so didn't work for Johannes when LMMS was built with Qt6.

@PhysSong
Copy link
Member

FYI, a suil installation may provide both Qt 5 and Qt 6 modules, like in Arch Linux:

usr/lib/suil-0/libsuil_x11.so
usr/lib/suil-0/libsuil_x11_in_gtk3.so
usr/lib/suil-0/libsuil_x11_in_qt5.so
usr/lib/suil-0/libsuil_x11_in_qt6.so

@tresf
Copy link
Member

tresf commented Nov 15, 2025

Hmm... this may very well be true, but so far, we have no evidence to support this claim.

It seems clear to me that libsuil_x11_in_qt5.so is needed for suil to work with a Qt5 host, and libsuil_x11_in_qt6.so is needed for a Qt6 host? And that explains why libsuil_x11_in_qt5.so didn't work for Johannes when LMMS was built with Qt6.

AFAIU, libsuil_x11_in_qt5.so caused issues in his local for exactly opposite reasons. We should rule out mixed working before writing it off. It's helpful to know if this is possible, even if we choose not to use it in our own AppImages.

FYI, a suil installation may provide both Qt 5 and Qt 6 modules, like in Arch Linux:

Good point, that's a fall through condition in the cmake code if we're to use it.

@tresf
Copy link
Member

tresf commented Nov 15, 2025

FYI, Homebrew seems to be a bit behind in this regard too and still only provides a qt5 version...

% ls -al /opt/homebrew/lib/suil-0/
total 288
drwxr-xr-x  4 user  staff    128 Nov 15 01:23 .
drwxr-xr-x  6 user  staff    192 Nov 15 01:23 ..
-r--r--r--  1 user  staff  76736 Nov 15 01:23 libsuil_cocoa_in_qt5.dylib
-r--r--r--  1 user  staff  68080 Nov 15 01:23 libsuil_x11.dylib

... I'm testing out mixed versions (Linux) on a separate branch to see if they're even possible, just waiting for the CI to finish.

@tresf
Copy link
Member

tresf commented Nov 15, 2025

We should rule out mixed working before writing it off.

The builds from https://github.com/tresf/lmms/actions/runs/19385835739#artifacts fail to load the LV2 UIs, but also don't segfault like the previous "Qt6UI" builds did. I'm not sure this matters though, if I force the AppImage to use /usr/lib/aarch64-linux-gnu/suil-0 as SUIL_MODULES_DIR it still segfaults suggesting that we really aren't going to have luck mixing Qt versions.

So I concede @messmerd 😅 let's just build them in. Even if we can mix them, I'm not sure it's worth our time to figure out how.

@PhysSong
Copy link
Member

Homebrew seems to be a bit behind in this regard too and still only provides a qt5 version...

Unfortunately, suil supports Qt 6 only on Linux + X11 for now. Even worse, there's no Qt support on Windows(gtk2 only).

@LoveBodhi
Copy link

For Windows, Qt 6.2+ require Win 10 V1809.

@JohannesLorenz
Copy link
Contributor

especially if building suil doesn't take long

It only took 5 seconds compiling, 5 seconds linking for me. Also, we may elide creating most libraries, we only need one (Qt5 OR Qt6). Which might be a reason to bypass the meson buildfile and use our own CMakeLists as usual. This also avoids the meson dependency.

FYI, a suil installation may provide both Qt 5 and Qt 6 modules, like in Arch Linux:

For me, it's still not available because I'm on "stable" branch :(

I'm fine with adding suil as a submodule

I think that's even vital, given how slow distros adapt.

If for some reason we instead want devs to provide their own pre-built suil

Do we want to support this, too? Like cmake ... -DSYSTEM_SUIL=ON ...?

All in all, I would be ready to make a PR against this PR, but I am also fine if anyone else wants to try...

@tresf
Copy link
Member

tresf commented Nov 21, 2025

Do we want to support this, too? Like cmake ... -DSYSTEM_SUIL=ON ...?

Probably overkill.

Also, we may elide creating most libraries, we only need one (Qt5 OR Qt6).

Why not Gtk?

@JohannesLorenz
Copy link
Contributor

Also, we may elide creating most libraries, we only need one (Qt5 OR Qt6).

Why not Gtk?

If you look at this, the in_... tells you what the host is:

usr/lib/suil-0/libsuil_x11.so
usr/lib/suil-0/libsuil_x11_in_gtk3.so
usr/lib/suil-0/libsuil_x11_in_qt5.so
usr/lib/suil-0/libsuil_x11_in_qt6.so

Here is the code which proves that (container_type_uri is indeed the host UI which we pass as 3rd argument in our Lv2ViewBase). LMMS is never Gtk, it's always Qt5 or Qt6.

@tresf
Copy link
Member

tresf commented Nov 22, 2025

Here is the code which proves that

So are you saying that LMMS is incapable of loading Gtk LV2 plugins at all? Is this intended behavior?

@tresf
Copy link
Member

tresf commented Nov 22, 2025

Here is the code which proves that

So are you saying that LMMS is incapable of loading Gtk LV2 plugins at all? Is this intended behavior?

For clarification, AFAIU, SUIL's entire point is to NOT need to be using the framework that the plugin was built against, quoting (again)

Since SUIL promises to embed a Qt UI without linking against Qt at compile time

... this should be the same for Gtk, no? Am I misunderstanding this framework?

@PhysSong
Copy link
Member

PhysSong commented Nov 23, 2025

To clarify, for example, libsuil_x11_in_gtk3.so means "for embedding X11 UIs into a GTK3 host".

@tresf
Copy link
Member

tresf commented Nov 23, 2025

To clarify, for example, libsuil_x11_in_gtk3.so means "for embedding X11 UIs into a GTK3 host".

Ok, that explains why mixing Qt versions would never work. if that's the case, we need to omit it from packaging, the Gtks and Qt5s are currently being processed by the AppImage and DMG scripts.

@tresf tresf mentioned this pull request Dec 14, 2025
10 tasks
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

Successfully merging this pull request may close these issues.

6 participants