Skip to contentSkip to conversation

package/libcamera: force-disable qcam for now

PATCH In review Quentin Schulz 3 participants 6 messages Mar 11, 2025 – Mar 18, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/libcamera: force-disable qcam for now

From: Quentin Schulz <[email protected]>

qcam is based on Qt6 since commit 71aa3ceec30b ("apps: qcam: Port to Qt 6") which is part of the v0.3.1 release.

qcam being enabled when BR2_PACKAGE_QT5BASE_WIDGETS symbol is defined breaks the build as it's missing the qt6 dependencies.

The migration to Qt 6 for the Buildroot package isn't straightforward though as we're hitting a meson bug[1].

For now, let's just always disable qcam until we can get everything fixed and migrated properly.

[1] https://github.com/mesonbuild/meson/issues/13018

Fixes 72757d111a5d ("package/libcamera: bump to version 0.3.2")

---
This is suboptimal solution to unbreaking Buildroot builds of libcamera when Qt5 Widgets are enabled but that should do for Buildroot 2025.02 release.

We should ideally work on adding proper support for qcam in a later commit, once the issue reported in
https://github.com/mesonbuild/meson/issues/13018 is either fixed or worked around in Buildroot.

FWIW, I went as far as:

```
ifeq ($(BR2_PACKAGE_QT6BASE_WIDGETS)$(BR2_PACKAGE_QT6_OPENGL),yy)
LIBCAMERA_CONF_OPTS += -Dqcam=enabled
LIBCAMERA_DEPENDENCIES += qt6base
else
LIBCAMERA_CONF_OPTS += -Dqcam=disabled
endif
```

as Qt6 OpenGL module seems required now. Additionally, the Qt6 tools dependency is doing nothing so it can be removed. It actually never did anything but turn a check from meson from red to green in the configure step, the binaries with and without Qt tools (qt5 or qt6) were always identical to the bit.

There are also a number of other changes we should be making to the recipe as libcamera is extended without knobs if libdrm, libsdl2, libjpeg, libdw and/or libunwind are provided. So we should add those to LIBCAMERA_DEPENDENCIES if they are part of the build, to make builds reproducible.

---
 package/libcamera/libcamera.mk | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)
package/libcamera/libcamera.mk +1 -10
index dcfa54e5dd7fcafcdaaf012ab30df5992ba1d4ce..b3132dc01658ed2fe9e5f780951f3152596dcfcf 100644
@@ -18,6 +18,7 @@ LIBCAMERA_DEPENDENCIES = \
 LIBCAMERA_CONF_OPTS = \
 	-Dandroid=disabled \
 	-Ddocumentation=disabled \
+	-Dqcam=disabled \
 	-Dtest=false \
 	-Dwerror=false
 LIBCAMERA_INSTALL_STAGING = YES
@@ -83,16 +84,6 @@ LIBCAMERA_CONF_OPTS += -Dgstreamer=enabled
 LIBCAMERA_DEPENDENCIES += gstreamer1 gst1-plugins-base
 endif
 
-ifeq ($(BR2_PACKAGE_QT5BASE_WIDGETS),y)
-LIBCAMERA_CONF_OPTS += -Dqcam=enabled
-LIBCAMERA_DEPENDENCIES += qt5base
-ifeq ($(BR2_PACKAGE_QT5TOOLS_LINGUIST_TOOLS),y)
-LIBCAMERA_DEPENDENCIES += qt5tools
-endif
-else
-LIBCAMERA_CONF_OPTS += -Dqcam=disabled
-endif
-
 ifeq ($(BR2_PACKAGE_LIBEVENT),y)
 LIBCAMERA_CONF_OPTS += -Dcam=enabled
 LIBCAMERA_DEPENDENCIES += libevent

---
base-commit: f2498258d4d0c7e4f181a54a5334b45ab73612d8
change-id: 20250310-libcamera-qt6-ff1f8144f7e1

Best regards,

Signature · 6 lines
Quentin Schulz <[email protected]>

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 12 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Quentin" == Quentin Schulz <[email protected]> writes:

From: Quentin Schulz <[email protected]>
qcam is based on Qt6 since commit 71aa3ceec30b ("apps: qcam: Port to Qt 6") which is part of the v0.3.1 release.

qcam being enabled when BR2_PACKAGE_QT5BASE_WIDGETS symbol is defined breaks the build as it's missing the qt6 dependencies.

The migration to Qt 6 for the Buildroot package isn't straightforward though as we're hitting a meson bug[1].

Quoted 7 lines

For now, let's just always disable qcam until we can get everything fixed and migrated properly.

[1] https://github.com/mesonbuild/meson/issues/13018

Fixes 72757d111a5d ("package/libcamera: bump to version 0.3.2")

Committed after adding an autobuilder reference, thanks.

Quoted 21 lines

---
This is suboptimal solution to unbreaking Buildroot builds of libcamera when Qt5 Widgets are enabled but that should do for Buildroot 2025.02 release.

We should ideally work on adding proper support for qcam in a later commit, once the issue reported in
https://github.com/mesonbuild/meson/issues/13018 is either fixed or worked around in Buildroot.

FWIW, I went as far as:

```
ifeq ($(BR2_PACKAGE_QT6BASE_WIDGETS)$(BR2_PACKAGE_QT6_OPENGL),yy)
LIBCAMERA_CONF_OPTS += -Dqcam=enabled
LIBCAMERA_DEPENDENCIES += qt6base
else
LIBCAMERA_CONF_OPTS += -Dqcam=disabled
endif
```
Quoted 5 lines

as Qt6 OpenGL module seems required now. Additionally, the Qt6 tools dependency is doing nothing so it can be removed. It actually never did anything but turn a check from meson from red to green in the configure step, the binaries with and without Qt tools (qt5 or qt6) were always identical to the bit.

Thanks for investigating!

Quoted 5 lines

There are also a number of other changes we should be making to the recipe as libcamera is extended without knobs if libdrm, libsdl2, libjpeg, libdw and/or libunwind are provided. So we should add those to LIBCAMERA_DEPENDENCIES if they are part of the build, to make builds reproducible.

Will you send patches for that as well?

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

Hi Peter,

Quoted 15 lines · Peter Korsgaard
Quoted 14 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Quentin" == Quentin Schulz <[email protected]> writes:

From: Quentin Schulz <[email protected]>
qcam is based on Qt6 since commit 71aa3ceec30b ("apps: qcam: Port to Qt 6") which is part of the v0.3.1 release.

qcam being enabled when BR2_PACKAGE_QT5BASE_WIDGETS symbol is defined breaks the build as it's missing the qt6 dependencies.

The migration to Qt 6 for the Buildroot package isn't straightforward though as we're hitting a meson bug[1].

For now, let's just always disable qcam until we can get everything fixed and migrated properly.

Quoted 7 lines
Quoted 4 lines

[1] https://github.com/mesonbuild/meson/issues/13018

Fixes 72757d111a5d ("package/libcamera: bump to version 0.3.2")

Committed after adding an autobuilder reference, thanks.

Ah, wasn't aware this was a known issue!

Quoted 21 lines
Quoted 20 lines

---
This is suboptimal solution to unbreaking Buildroot builds of libcamera when Qt5 Widgets are enabled but that should do for Buildroot 2025.02 release.

We should ideally work on adding proper support for qcam in a later commit, once the issue reported in
https://github.com/mesonbuild/meson/issues/13018 is either fixed or worked around in Buildroot.

FWIW, I went as far as:

```
ifeq ($(BR2_PACKAGE_QT6BASE_WIDGETS)$(BR2_PACKAGE_QT6_OPENGL),yy)
LIBCAMERA_CONF_OPTS += -Dqcam=enabled
LIBCAMERA_DEPENDENCIES += qt6base
else
LIBCAMERA_CONF_OPTS += -Dqcam=disabled
endif
```
Quoted 8 lines
Quoted 5 lines

as Qt6 OpenGL module seems required now. Additionally, the Qt6 tools dependency is doing nothing so it can be removed. It actually never did anything but turn a check from meson from red to green in the configure step, the binaries with and without Qt tools (qt5 or qt6) were always identical to the bit.

Thanks for investigating!

To be fair, I may be wrong. https://lists.libcamera.org/pipermail/libcamera-devel/2025-March/049157.html for following discussion on the libcamera ML (no answer at the moment but it's not even been 24h :) ).

Before I forget, it seems qcam also has a dependency on TIFF that we forgot to enforce (there's a knob to add a dependency on TIFF if the package is built, but that won't be enough).

Quoted 9 lines
Quoted 6 lines

There are also a number of other changes we should be making to the recipe as libcamera is extended without knobs if libdrm, libsdl2, libjpeg, libdw and/or libunwind are provided. So we should add those to LIBCAMERA_DEPENDENCIES if they are part of the build, to make builds reproducible.

Will you send patches for that as well?

I may, but anyone feel free to work on that if you feel like it. That will be a build-tested patch only though from me.

Looking at it a few more seconds, seems like there are also other knobs we don't support right now, e.g. the virtual and mali-c55 pipelines.

Cheers,
Quentin
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#3 lore raw
In reply to Peter Korsgaard

Hi Peter,

Quoted 15 lines · Peter Korsgaard
Quoted 14 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Quentin" == Quentin Schulz <[email protected]> writes:

From: Quentin Schulz <[email protected]>
qcam is based on Qt6 since commit 71aa3ceec30b ("apps: qcam: Port to Qt 6") which is part of the v0.3.1 release.

qcam being enabled when BR2_PACKAGE_QT5BASE_WIDGETS symbol is defined breaks the build as it's missing the qt6 dependencies.

The migration to Qt 6 for the Buildroot package isn't straightforward though as we're hitting a meson bug[1].

For now, let's just always disable qcam until we can get everything fixed and migrated properly.

Quoted 17 lines
Quoted 4 lines

[1] https://github.com/mesonbuild/meson/issues/13018

Fixes 72757d111a5d ("package/libcamera: bump to version 0.3.2")

Committed after adding an autobuilder reference, thanks.

Quoted 9 lines

---
This is suboptimal solution to unbreaking Buildroot builds of libcamera when Qt5 Widgets are enabled but that should do for Buildroot 2025.02 release.

We should ideally work on adding proper support for qcam in a later commit, once the issue reported in
https://github.com/mesonbuild/meson/issues/13018 is either fixed or worked around in Buildroot.

OK so seems like the proper way to do this with meson would be to add moc, rcc, uic, lrelease, etc... to the cross-compilation.conf [binaries] section.

The issue is that a path to a tool that doesn't exist will crash meson instead of simply marking the tool as not found, c.f. https://paste.ack.tf/a12d3b Or at least, it'll crash when using a qt module trying to find qt tools.

I guess this can be mitigated by making use of _MESON_EXTRA_BINARIES for each package, that are only added when some symbols are enabled/dependencies met. But does it make sense since it'll likely be necessary for most qt6 packages?

We could also have some logic directly in package/pkg-meson.mk to add those paths provided the appropriate symbols are selected? (but that could still make meson fail if someone forgets to add the appropriate Qt packages as _DEPENDENCIES of said package).

Maybe there's a third option as well?

Which would best suit Buildroot?

Cheers,
Quentin
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#4 lore raw

Hi all,

Quoted 38 lines · Quentin Schulz

Hi Peter,

Quoted 23 lines · Peter Korsgaard
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Quentin" == Quentin Schulz <[email protected]> writes:

  > From: Quentin Schulz <[email protected]>
  > qcam is based on Qt6 since commit 71aa3ceec30b ("apps: qcam: Port to Qt > 6") which is part of the v0.3.1 release.

  > qcam being enabled when BR2_PACKAGE_QT5BASE_WIDGETS symbol is defined > breaks the build as it's missing the qt6 dependencies.

  > The migration to Qt 6 for the Buildroot package isn't straightforward > though as we're hitting a meson bug[1].

  > For now, let's just always disable qcam until we can get everything > fixed and migrated properly.

  > [1] https://github.com/mesonbuild/meson/issues/13018

  > Fixes: 72757d111a5d ("package/libcamera: bump to version 0.3.2") > Signed-off-by: Quentin Schulz <[email protected]>

Committed after adding an autobuilder reference, thanks.

Quoted 1 line

---

Quoted 9 lines

  > This is suboptimal solution to unbreaking Buildroot builds of libcamera > when Qt5 Widgets are enabled but that should do for Buildroot 2025.02 > release.

  > We should ideally work on adding proper support for qcam in a later > commit, once the issue reported in
  > https://github.com/mesonbuild/meson/issues/13018 is either fixed or > worked around in Buildroot.

OK so seems like the proper way to do this with meson would be to add moc, rcc, uic, lrelease, etc... to the cross-compilation.conf [binaries] section.

Quoted 8 lines

The issue is that a path to a tool that doesn't exist will crash meson instead of simply marking the tool as not found, c.f. https:// paste.ack.tf/a12d3b Or at least, it'll crash when using a qt module trying to find qt tools.

I guess this can be mitigated by making use of _MESON_EXTRA_BINARIES for each package, that are only added when some symbols are enabled/ dependencies met. But does it make sense since it'll likely be necessary for most qt6 packages?

We could also have some logic directly in package/pkg-meson.mk to add those paths provided the appropriate symbols are selected? (but that could still make meson fail if someone forgets to add the appropriate Qt packages as _DEPENDENCIES of said package).

Maybe there's a third option as well?

It seems like there may be something better:

https://github.com/mesonbuild/meson/pull/14381

Let's see what meson maintainers have to say about this, but this makes it possible to build qcam (qt6) with libcamera and the following diff (plus the meson patch of course):

"""

package/libcamera/libcamera.mk +7 -1
index b3132dc016..5f5435eaf7 100644
@@ -18,7 +18,6 @@ LIBCAMERA_DEPENDENCIES = \
 LIBCAMERA_CONF_OPTS = \
 	-Dandroid=disabled \
 	-Ddocumentation=disabled \
-	-Dqcam=disabled \
 	-Dtest=false \
 	-Dwerror=false
 LIBCAMERA_INSTALL_STAGING = YES
@@ -84,6 +83,13 @@ LIBCAMERA_CONF_OPTS += -Dgstreamer=enabled
 LIBCAMERA_DEPENDENCIES += gstreamer1 gst1-plugins-base
 endif
 
+ifeq ($(BR2_PACKAGE_QT6BASE_WIDGETS)$(BR2_PACKAGE_QT6BASE_OPENGL),yy)
+LIBCAMERA_CONF_OPTS += -Dqcam=enabled
+LIBCAMERA_DEPENDENCIES += qt6base
+else
+LIBCAMERA_CONF_OPTS += -Dqcam=disabled
+endif
+
 ifeq ($(BR2_PACKAGE_LIBEVENT),y)
 LIBCAMERA_CONF_OPTS += -Dcam=enabled
 LIBCAMERA_DEPENDENCIES += libevent

"""

Cheers,
Quentin
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#5 lore raw
In reply to Quentin Schulz
Quoted 12 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Quentin" == Quentin Schulz <[email protected]> writes:

From: Quentin Schulz <[email protected]>
qcam is based on Qt6 since commit 71aa3ceec30b ("apps: qcam: Port to Qt 6") which is part of the v0.3.1 release.

qcam being enabled when BR2_PACKAGE_QT5BASE_WIDGETS symbol is defined breaks the build as it's missing the qt6 dependencies.

The migration to Qt 6 for the Buildroot package isn't straightforward though as we're hitting a meson bug[1].

Quoted 7 lines

For now, let's just always disable qcam until we can get everything fixed and migrated properly.

[1] https://github.com/mesonbuild/meson/issues/13018

Fixes 72757d111a5d ("package/libcamera: bump to version 0.3.2")

Committed to 2024.11.x, thanks.

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot