Qt6SerialBus not compatible with local debian debugging

I’ve been digging on this issue for a few days and have hit a wall beyond my control using Ubuntu 22.04 under WSL2 on up-to-date Windows 11. In typing all this up, I finally got the local build to work, but only with a hack around dependency problems.

I’m porting a VSCode extension v1, qmake qt5 project to the new V2 extension, cmake qt6 build tool.
The code is compiling in Qt6.2 and Qt6.6, build-debug-arm will build an executable for linux/arm7.

However, when I try to run build-debug-amd64-local, cmake fails at find_package on the library SerialBus (CAN and more) on the “native” Ubuntu.

Here’s the entire output:

CMake Error at /usr/lib/x86_64-linux-gnu/cmake/Qt6SerialBusTools/Qt6SerialBusToolsTargets.cmake:86 (message):
  The imported target "Qt6::canbusutil" references the file


  but this file does not exist.  Possible reasons include:

  * The file was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and contained


  but not all the files it references.

Call Stack (most recent call first):
  /usr/lib/x86_64-linux-gnu/cmake/Qt6SerialBusTools/Qt6SerialBusToolsConfig.cmake:47 (include)
  /usr/lib/x86_64-linux-gnu/cmake/Qt6SerialBus/Qt6SerialBusDependencies.cmake:76 (find_package)
  /usr/lib/x86_64-linux-gnu/cmake/Qt6SerialBus/Qt6SerialBusConfig.cmake:50 (include)
  /usr/lib/x86_64-linux-gnu/cmake/Qt6/Qt6Config.cmake:219 (find_package)
  CMakeLists.txt:10 (find_package)

CMake Warning at /usr/lib/x86_64-linux-gnu/cmake/Qt6/Qt6Config.cmake:219 (find_package):
  Found package configuration file:


  but it set Qt6SerialBus_FOUND to FALSE so package "Qt6SerialBus" is
  considered to be NOT FOUND.
Call Stack (most recent call first):
  CMakeLists.txt:10 (find_package)

-- Configuring incomplete, errors occurred!

Now I’ve already made sure that libqt6serialbus6-dev (and all libqt6serialbus6-*) packages are installed on the host. QtCreator and Qt6 are all installed and usable for other projects via WSL2.

My first guess was maybe the package qt6-serialbus-dev, which is not available in the repos till 23.01, thus not on the host debian, was allowing the arm build to succeed, but removing it from torizonPackages.json doesnt break the arm build. Somehow, torizonPackages.json is able to install qt6-serialbus-dev on the build container no problem (but not find libqt6serialbus6-plugins ???)

Hacking on it a bit, if I link /usr/lib/qt6/bin/canbusutil to a copy of canbusutil from one of the several other Qt installs on my machine, cmake does build the native app, but only after installing libqt6serialport6-dev, which isn’t a dependency for the amd64 libqt6serialbus6-dev, but maybe isn’t needed by the armv7 version? (or is already installed? or is a dependency?..)

Now this is not an immediate show stopper, because I can still build the qmake project directly via msys2 for desktop development, but it is unfeasibly dangerous to have to maintain two separate build systems for the project.
I can also run the cmake build via open-in-qt-creator, but only after fixing the Qt::SerialPort dep, and hacking in sudo ln -s /mnt/c/Qt/6.6.2/mingw_64/bin/canbusutil.exe /usr/lib/qt6/bin/canbusutil which should get figured out by package and build tool maintainers. Maybe its a minor version problem? e.g. 6.2 vs 6.6?

looking more like an Ubuntu vs Debian package issue… duh, you can find qt6-serialbus-dev in the Debian repos, just not Ubuntu’s…

SerialPort is definitely a dependency of Debian bookworm SerialBus, but not Ubuntu 22.04’s…

This is obviously how canbusutils binary gets omitted too… Maybe encourage us to dev on Debian installs?

Greetings @ed-bear,

Seems you’ve already came upon the answer here. But yes, while Ubuntu and Debian are similar in many ways. The way each distribution chooses to do their packaging can differ quite a bit on some packages. It’s why comparing an Ubuntu environment to a Debian one, is not as one to one as you would think.

As for your original issue you faced where the compiler couldn’t find /usr/lib/qt6/bin/canbusutil. I did some searching on the Ubuntu and Debian package feeds to figure this out. So the file /usr/lib/qt6/bin/canbusutil is provided by libqt6serialbus6-bin in Ubuntu: Ubuntu – Details of package libqt6serialbus6-bin in jammy

This seems to be the same for Debian as well: Debian -- Details of package libqt6serialbus6-bin in bookworm

The issue is the respective *-dev packages. On Debian Bookworm we have: Debian -- Details of package qt6-serialbus-dev in bookworm

Which includes libqt6serialbus6-bin as a dependency. But on Ubuntu Jammy we have: Ubuntu – Details of package libqt6serialbus6-dev in jammy

Which does not have libqt6serialbus6-bin as a dependency and therefore /usr/lib/qt6/bin/canbusutil does not get installed at all in Ubuntu, with just this package. Honestly this seems like a bit of an oversight to me in the Ubuntu packaging but maybe they had their reasons.

Best Regards,