[libcamera-devel] [PATCH v2 1/3] apps: qcam: Port to Qt 6
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Sun Jul 28 17:28:10 CEST 2024
On Sun, Jul 28, 2024 at 11:03:11AM -0400, Neal Gompa wrote:
> On Wed, Jul 24, 2024 at 3:00 PM Laurent Pinchart wrote:
> > On Wed, Jul 24, 2024 at 02:55:43PM +0100, Kieran Bingham wrote:
> > > Quoting Kieran Bingham (2024-07-24 11:38:07)
> > > > Quoting Laurent Pinchart (2024-07-23 19:53:52)
> > > > > On Tue, Jul 23, 2024 at 06:11:19PM +0100, Kieran Bingham wrote:
> > > > > > Quoting Laurent Pinchart (2024-07-22 16:13:57)
> > > > > > > On Mon, Jul 22, 2024 at 04:01:23PM +0100, Kieran Bingham wrote:
> > > > > > > > Quoting Kieran Bingham (2024-07-22 15:13:57)
> > > > > > > > > Quoting Kieran Bingham (2024-04-16 19:14:35)
> > > > > > > > > > Quoting Neal Gompa via libcamera-devel (2024-01-21 22:39:53)
> > > > > > > > > > > Open source Qt 5 has been effectively end of life since the release
> > > > > > > > > > > of Qt 6, and Qt 6 has current LTS releases now.
> > > > > > > > > > >
> > > > > > > > > > > This change ports qcam to Qt 6.2 and drops some of the baggage related
> > > > > > > > > > > to Qt 5 that is no longer applicable.
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > With Ubuntu 24.04 release 'imminent' (as well as the next libcamera-0.3
> > > > > > > > > > after I can merge the softISP) I believe it's time to merge this patch.
> > > > > > > > > >
> > > > > > > > > > However ...
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > > Signed-off-by: Neal Gompa <neal at gompa.dev>
> > > > > > > > > > > ---
> > > > > > > > > > > README.rst | 2 +-
> > > > > > > > > > > meson.build | 2 +-
> > > > > > > > > > > src/apps/qcam/meson.build | 45 +++++++++++----------------------------
> > > > > > > > > > > 3 files changed, 15 insertions(+), 34 deletions(-)
> > > > > > > > > > >
> > > > > > > > > > > diff --git a/README.rst b/README.rst
> > > > > > > > > > > index 315738ee..6f1c9302 100644
> > > > > > > > > > > --- a/README.rst
> > > > > > > > > > > +++ b/README.rst
> > > > > > > > > > > @@ -88,7 +88,7 @@ for cam: [optional]
> > > > > > > > > > > - libsdl2-dev: Enables the SDL sink
> > > > > > > > > > >
> > > > > > > > > > > for qcam: [optional]
> > > > > > > > > > > - libtiff-dev qtbase5-dev qttools5-dev-tools
> > > > > > > > > > > + libtiff-dev qt6-base-dev qt6-tools-dev-tools
> > > > > > > >
> > > > > > > > On debian bullseye there's no qt6-tools-dev-tools package ...
> > > > > > > >
> > > > > > > > Trying to identify either the correct package or when it gets added...
> > > > > > > >
> > > > > > > >
> > > > > > > > Hrm. ... it looks like it's only available in bullseye-backports:
> > > > > > > >
> > > > > > > > https://packages.debian.org/bullseye-backports/amd64/qt6-tools-dev-tools
> > > > > > > >
> > > > > > > > Now ... how do we handle this on the CI ...
> > > > > > >
> > > > > > > See commit 239de776df95044aa8efa7d19064a9d5c679f4ca in the CI, which
> > > > > > > removed handling of backports :-)
> > > > > >
> > > > > > This must be the hardest patch I've ever tried to land.
> > > > > >
> > > > > > So ... The CI builders now have QT6 packages, provided through backports
> > > > > > in the case of debian-bullseye.
> > > > > >
> > > > > > We have:
> > > > > >
> > > > > > - Debian 11 : Bullsye : QT 6.4.2
> > > > > > - Debian 12 : Bookworm : QT 6.4.2
> > > > > > - Debian 13 : Trixie : QT 6.6.2
> > > > > >
> > > > > >
> > > > > > But this QT6 qcam patch now has a set of failures:
> > > > > >
> > > > > > - https://gitlab.freedesktop.org/camera/libcamera/-/pipelines/1230127/
> > > > > >
> > > > > > Debian 11 : gcc 9 : https://gitlab.freedesktop.org/camera/libcamera/-/jobs/61356458
> > > > > > - [358/622] Compiling C++ object src/ipa/rpi/controller/librpi_ipa_controller.a.p/rpi_awb.cpp.o
> > > > > >
> > > > > > In file included from ../src/ipa/libipa/pwl.h:18,
> > > > > > from ../src/ipa/rpi/controller/rpi/awb.h:19,
> > > > > > from ../src/ipa/rpi/controller/rpi/awb.cpp:16:
> > > > > > ../src/ipa/libipa/vector.h: In instantiation of ‘constexpr libcamera::ipa::Vector<T, Rows> libcamera::ipa::Vector<T, Rows, <anonymous> >::operator-(const libcamera::ipa::Vector<T, Rows>&) const [with T = double; unsigned int Rows = 2; std::enable_if_t<is_arithmetic_v<T> >* <anonymous> = 0; std::enable_if_t<is_arithmetic_v<T> > = void]’:
> > > > > > ../src/ipa/rpi/controller/rpi/awb.cpp:506:27: required from here
> > > > > >
> > > > > > (This makes no sense to me at all)
> > > > >
> > > > > That's a note, not an error. I don't think it's related or new.
> > > >
> > > > Argh! I hadn't realised that. I thought we had a 'clean' build with no
> > > > warnings. I didn't see it was a 'note' (it really looks like a warning)
> > > > ... so I put more into this than it deserved.
> > > >
> > > > Ignored ...
> > > >
> > > > >
> > > > > > Debian 11 : gcc 10 :
> > > > > >
> > > > > > In file included from src/apps/qcam/qcam.p/moc_viewfinder_gl.cpp:10:
> > > > > > src/apps/qcam/qcam.p/../../../../../src/apps/qcam/viewfinder_gl.h:15:10: fatal error: QOpenGLBuffer: No such file or directory
> > > > > > 15 | #include <QOpenGLBuffer>
> > > > > > | ^~~~~~~~~~~~~~~
> > > > > > compilation terminated.
> > > > > >
> > > > > > (At least this looks related)
> > > > > >
> > > > > > Debian 12 : clang ... in fact all the Debian 12's have this error:
> > > > > >
> > > > > > In file included from src/apps/qcam/qcam.p/moc_viewfinder_gl.cpp:10:
> > > > > > src/apps/qcam/qcam.p/../../../../../src/apps/qcam/viewfinder_gl.h:15:10: fatal error: 'QOpenGLBuffer' file not found
> > > > > > #include <QOpenGLBuffer>
> > > > > > ^~~~~~~~~~~~~~~
> > > > > >
> > > > > >
> > > > > > And Buildhistory job also fails as it's based on Debian 12.
> > > > > >
> > > > > >
> > > > > > So ... there's a crazy-how-can-it-be-related-but-consistently-repeatable
> > > > > > failure on Debian 11 : gcc 9, and a missing QOpenGLBuffer on all the
> > > > > > other failures.
> > > > > >
> > > > > >
> > > > > > Does anyone know if QOpenGLBuffer is just missing from QT 6.4.2 or is
> > > > > > this just some spurious build configuration corner case failure we're
> > > > > > hitting?
> > > > >
> > > > > Aren't you just missing the libqt6opengl6-dev package ?
> > > >
> > > > Ok - so yes - that bit was that simple. I've added libqt6opengl6-dev to
> > > > the CI explicitly.
> > > >
> > > > I think that means the README needs to be updated again to reference
> > > > libqt6opengl6-dev in this patch too.
> > > >
> > > >
> > > > On to the next (final please?) failure:
> > > >
> > > >
> > > > https://gitlab.freedesktop.org/camera/libcamera/-/jobs/61434092
> > > >
> > > > [424/606] Linking target src/apps/qcam/qcam
> > > > FAILED: src/apps/qcam/qcam
> > > > clang++ -o src/apps/qcam/qcam src/apps/qcam/qcam.p/meson-generated_.._qt6-feathericons_qrc.cpp.o src/apps/qcam/qcam.p/meson-generated_.._qt6-shaders_qrc.cpp.o src/apps/qcam/qcam.p/meson-generated_moc_cam_select_dialog.cpp.o src/apps/qcam/qcam.p/meson-generated_moc_main_window.cpp.o src/apps/qcam/qcam.p/meson-generated_moc_viewfinder_gl.cpp.o src/apps/qcam/qcam.p/meson-generated_moc_viewfinder_qt.cpp.o src/apps/qcam/qcam.p/cam_select_dialog.cpp.o src/apps/qcam/qcam.p/format_converter.cpp.o src/apps/qcam/qcam.p/main.cpp.o src/apps/qcam/qcam.p/main_window.cpp.o src/apps/qcam/qcam.p/message_handler.cpp.o src/apps/qcam/qcam.p/viewfinder_gl.cpp.o src/apps/qcam/qcam.p/viewfinder_qt.cpp.o -Wl,--as-needed -Wl,--no-undefined -stdlib=libc++ -Wextra-semi -Wthread-safety -Wmissing-declarations -Wshadow -include /builds/camera/libcamera/build/config.h -Wno-c99-designator '-Wl,-rpath,$ORIGIN/../../libcamera:$ORIGIN/../../libcamera/base' -Wl,-rpath-link,/builds/camera/libcamera/build/src/libcamera -Wl,-rpath-link,/builds/camera/libcamera/build/src/libcamera/base -Wl,--start-group src/apps/common/libapps.a src/libcamera/libcamera.so.0.3.0 src/libcamera/base/libcamera-base.so.0.3.0 -latomic /usr/lib/x86_64-linux-gnu/libtiff.so /usr/lib/x86_64-linux-gnu/libQt6Core.so /usr/lib/x86_64-linux-gnu/libQt6Gui.so /usr/lib/x86_64-linux-gnu/libQt6OpenGL.so /usr/lib/x86_64-linux-gnu/libQt6OpenGLWidgets.so /usr/lib/x86_64-linux-gnu/libQt6Widgets.so -Wl,--end-group
> > > > /usr/bin/ld: src/apps/qcam/qcam.p/cam_select_dialog.cpp.o: in function `QString::toStdString() const':
> > > > /usr/include/x86_64-linux-gnu/qt6/QtCore/qstring.h:1477: undefined reference to `QByteArray::toStdString() const'
> > > > clang: error: linker command failed with exit code 1 (use -v to see invocation)
> > > >
> > > >
> > > > on the clang builds of debian-12 though gcc-12 builds fine there!
> > > >
> > > > digging ...
> > >
> > > I took Laurent's suggestion and disabled Qcam builds on debian-12 with
> > > clang.
> > >
> > > From the looks of this, the compilation of 'QByteArray::toStdString()
> > > const' in this specific version of qt6 on debian-12 ends up binary
> > > incompatible with the libstdc++ abi ... and thus fails to link.
> >
> > Did you mean libc++ ? libstdc++ is the library that comes with gcc. Does
> > Debian 12 compile packages with gcc + libc++ ?
>
> It is fairly common to have clang built against and linked to
> libstdc++. That ensures that you can use clang for some things and gcc
> for other things and they can be combined into a single executable.
Yes, it's the other way around that would puzzle me. Kieran mention a
Debian Qt 6 package incompatible with the *libstdc++* ABI.
--
Regards,
Laurent Pinchart
More information about the libcamera-devel
mailing list