Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/libcamera: force-disable qcam for now
@ 2025-03-11 11:48 Quentin Schulz
  2025-03-11 18:15 ` Peter Korsgaard
  2025-03-16 20:25 ` Peter Korsgaard
  0 siblings, 2 replies; 6+ messages in thread
From: Quentin Schulz @ 2025-03-11 11:48 UTC (permalink / raw)
  To: buildroot; +Cc: Kieran Bingham, Marcus Folkesson, Quentin Schulz

From: Quentin Schulz <quentin.schulz@cherry.de>

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 <quentin.schulz@cherry.de>
---
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(-)

diff --git a/package/libcamera/libcamera.mk b/package/libcamera/libcamera.mk
index dcfa54e5dd7fcafcdaaf012ab30df5992ba1d4ce..b3132dc01658ed2fe9e5f780951f3152596dcfcf 100644
--- a/package/libcamera/libcamera.mk
+++ b/package/libcamera/libcamera.mk
@@ -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,
-- 
Quentin Schulz <quentin.schulz@cherry.de>

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Buildroot] [PATCH] package/libcamera: force-disable qcam for now
  2025-03-11 11:48 [Buildroot] [PATCH] package/libcamera: force-disable qcam for now Quentin Schulz
@ 2025-03-11 18:15 ` Peter Korsgaard
  2025-03-12  9:51   ` Quentin Schulz via buildroot
  2025-03-18 11:22   ` Quentin Schulz via buildroot
  2025-03-16 20:25 ` Peter Korsgaard
  1 sibling, 2 replies; 6+ messages in thread
From: Peter Korsgaard @ 2025-03-11 18:15 UTC (permalink / raw)
  To: Quentin Schulz
  Cc: buildroot, Kieran Bingham, Marcus Folkesson, Quentin Schulz

>>>>> "Quentin" == Quentin Schulz <foss+buildroot@0leil.net> writes:

 > From: Quentin Schulz <quentin.schulz@cherry.de>
 > 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 <quentin.schulz@cherry.de>

Committed after adding an autobuilder reference, thanks.

> ---
 > 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.

Thanks for investigating!


 > 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?

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Buildroot] [PATCH] package/libcamera: force-disable qcam for now
  2025-03-11 18:15 ` Peter Korsgaard
@ 2025-03-12  9:51   ` Quentin Schulz via buildroot
  2025-03-18 11:22   ` Quentin Schulz via buildroot
  1 sibling, 0 replies; 6+ messages in thread
From: Quentin Schulz via buildroot @ 2025-03-12  9:51 UTC (permalink / raw)
  To: Peter Korsgaard, Quentin Schulz
  Cc: buildroot, Kieran Bingham, Marcus Folkesson

Hi Peter,

On 3/11/25 7:15 PM, Peter Korsgaard wrote:
>>>>>> "Quentin" == Quentin Schulz <foss+buildroot@0leil.net> writes:
> 
>   > From: Quentin Schulz <quentin.schulz@cherry.de>
>   > 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 <quentin.schulz@cherry.de>
> 
> Committed after adding an autobuilder reference, thanks.
> 

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

>> ---
>   > 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.
> 
> 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).

> 
>   > 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
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Buildroot] [PATCH] package/libcamera: force-disable qcam for now
  2025-03-11 11:48 [Buildroot] [PATCH] package/libcamera: force-disable qcam for now Quentin Schulz
  2025-03-11 18:15 ` Peter Korsgaard
@ 2025-03-16 20:25 ` Peter Korsgaard
  1 sibling, 0 replies; 6+ messages in thread
From: Peter Korsgaard @ 2025-03-16 20:25 UTC (permalink / raw)
  To: Quentin Schulz
  Cc: buildroot, Kieran Bingham, Marcus Folkesson, Quentin Schulz

>>>>> "Quentin" == Quentin Schulz <foss+buildroot@0leil.net> writes:

 > From: Quentin Schulz <quentin.schulz@cherry.de>
 > 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 <quentin.schulz@cherry.de>

Committed to 2024.11.x, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Buildroot] [PATCH] package/libcamera: force-disable qcam for now
  2025-03-11 18:15 ` Peter Korsgaard
  2025-03-12  9:51   ` Quentin Schulz via buildroot
@ 2025-03-18 11:22   ` Quentin Schulz via buildroot
  2025-03-18 14:48     ` Quentin Schulz via buildroot
  1 sibling, 1 reply; 6+ messages in thread
From: Quentin Schulz via buildroot @ 2025-03-18 11:22 UTC (permalink / raw)
  To: Peter Korsgaard, Quentin Schulz
  Cc: buildroot, Kieran Bingham, Marcus Folkesson

Hi Peter,

On 3/11/25 7:15 PM, Peter Korsgaard wrote:
>>>>>> "Quentin" == Quentin Schulz <foss+buildroot@0leil.net> writes:
> 
>   > From: Quentin Schulz <quentin.schulz@cherry.de>
>   > 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 <quentin.schulz@cherry.de>
> 
> Committed after adding an autobuilder reference, thanks.
> 
>> ---
>   > 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
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Buildroot] [PATCH] package/libcamera: force-disable qcam for now
  2025-03-18 11:22   ` Quentin Schulz via buildroot
@ 2025-03-18 14:48     ` Quentin Schulz via buildroot
  0 siblings, 0 replies; 6+ messages in thread
From: Quentin Schulz via buildroot @ 2025-03-18 14:48 UTC (permalink / raw)
  To: Peter Korsgaard, Quentin Schulz
  Cc: buildroot, Kieran Bingham, Marcus Folkesson

Hi all,

On 3/18/25 12:22 PM, Quentin Schulz wrote:
> Hi Peter,
> 
> On 3/11/25 7:15 PM, Peter Korsgaard wrote:
>>>>>>> "Quentin" == Quentin Schulz <foss+buildroot@0leil.net> writes:
>>
>>   > From: Quentin Schulz <quentin.schulz@cherry.de>
>>   > 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 <quentin.schulz@cherry.de>
>>
>> Committed after adding an autobuilder reference, thanks.
>>
>>> ---
>>   > 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?
> 

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):

"""
diff --git a/package/libcamera/libcamera.mk b/package/libcamera/libcamera.mk
index b3132dc016..5f5435eaf7 100644
--- a/package/libcamera/libcamera.mk
+++ b/package/libcamera/libcamera.mk
@@ -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
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-03-18 14:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-11 11:48 [Buildroot] [PATCH] package/libcamera: force-disable qcam for now Quentin Schulz
2025-03-11 18:15 ` Peter Korsgaard
2025-03-12  9:51   ` Quentin Schulz via buildroot
2025-03-18 11:22   ` Quentin Schulz via buildroot
2025-03-18 14:48     ` Quentin Schulz via buildroot
2025-03-16 20:25 ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox