Re: [Buildroot] [PATCH] package/opencv: depend on webp mux/demux

Thomas Petazzoni via buildroot <[email protected]>
Newsgroups net.busybox.buildroot
Message-ID <aoglkraRzHufPBHQ@windsurf>
Hello Alessandro,

Thanks for your patch!

On Sun, Jul 26, 2026 at 11:59:31PM +0200, Alessandro Rubini wrote:
> Without this dependency, autoconfiguration fails:
> 
>     CMake Error: The following variables are used in this project,
>          but they are set to NOTFOUND.
>     Please set them or make sure they are set and tested correctly
>          in the CMake files:
>     WEBP_DEMUX_LIBRARY
>     linked by target "opencv_imgcodecs"
>          in directory [...]/build/opencv4-4.13.0/modules/imgcodecs
>     WEBP_MUX_LIBRARY
>     linked by target "opencv_imgcodecs"
>          in directory [...]/build/opencv4-4.13.0/modules/imgcodecs
> 
> Signed-off-by: Alessandro Rubini <[email protected]>
> ---
>  package/opencv4/Config.in  | 2 ++
>  package/opencv4/opencv4.mk | 1 +
>  2 files changed, 3 insertions(+)
> 
> diff --git a/package/opencv4/Config.in b/package/opencv4/Config.in
> index 47c1cf3f4a..856f3e8abd 100644
> --- a/package/opencv4/Config.in
> +++ b/package/opencv4/Config.in
> @@ -7,6 +7,8 @@ menuconfig BR2_PACKAGE_OPENCV4
>  	depends on !BR2_STATIC_LIBS # include dlfcn.h
>  	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 # C++11
>  	select BR2_PACKAGE_ZLIB
> +	select BR2_PACKAGE_WEBP_DEMUX
> +	select BR2_PACKAGE_WEBP_MUX

I don't think this is correct, because here a build of opencv4 with
nothing special works fine, so it means that webp doesn't seem to be a
mandatory dependency of opencv4, but your patch turns webp into a
mandatory dependency of opencv4.

Basically here:

BR2_aarch64=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_AARCH64_GLIBC_STABLE=y
BR2_PACKAGE_OPENCV4=y

builds fine.

But I do see autobuilder failures for this issue, for example:

  https://autobuild.buildroot.net/results/acb/acbddbea6d18272b5830be1b5fa5f40cf37e0389/build-end.log

In the autobuilders, I see that the few occurrences of this failures
occur when BR2_PACKAGE_OPENCV4_WITH_WEBP is enabled, which pulls in
webp as a dependency already.

So two things need to be figured out:

1. Under what conditions exactly is webp required, so that the
   dependency can be added only when needed

2. Since when the problem exists. Indeed, when we are fixing bugs, we
   always have to figure out if the fix needs to be backported to our
   stable branch (currently 2025.02.x), so every fix must come with a
   reference to the commit that introduced the problem in the first
   place. Or at least figure out whether 2025.02.x was affected or
   not.

Also, your patch could anyway not be correct, because we already have:

ifeq ($(BR2_PACKAGE_OPENCV4_WITH_WEBP),y)
OPENCV4_CONF_OPTS += -DWITH_WEBP=ON
OPENCV4_DEPENDENCIES += webp
else
OPENCV4_CONF_OPTS += -DWITH_WEBP=OFF
endif

which adds webp conditionally, and it wouldn't make sense to add it
unconditionally, and then have some logic to add it conditionally.

Could you have a look into this?

Thanks a lot!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.