diff mbox series

[meta-oe,1/2] protobuf: add abseil-cpp to RDEPENDS

Message ID 20240922073618.1359707-1-yi.zhao@windriver.com
State Accepted
Headers show
Series [meta-oe,1/2] protobuf: add abseil-cpp to RDEPENDS | expand

Commit Message

Yi Zhao Sept. 22, 2024, 7:36 a.m. UTC
Since commit[1], the libraries of abseil-cpp have been splitted into
separate packages. When protobuf is installed into the image, only 48
abseil libraries are installed as runtime dependencies. But the output
of 'pkg-config --libs protobuf' lists 66 abseil-cpp libraries are
required. Add abseil-cpp to RDEPENDS to ensure that all required
abseil-cpp libraries are installed.

[1] https://git.openembedded.org/meta-openembedded/commit/?id=dd6421e65eb75c35a904f4b487ba022075035ecc

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
---
 meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb | 2 ++
 1 file changed, 2 insertions(+)

Comments

Peter Kjellerstedt Sept. 23, 2024, 7:02 p.m. UTC | #1
> -----Original Message-----
> From: openembedded-devel@lists.openembedded.org <openembedded-devel@lists.openembedded.org> On Behalf Of Yi Zhao
> Sent: den 22 september 2024 09:36
> To: openembedded-devel@lists.openembedded.org
> Subject: [oe] [meta-oe][PATCH 1/2] protobuf: add abseil-cpp to RDEPENDS
> 
> Since commit[1], the libraries of abseil-cpp have been splitted into
> separate packages. When protobuf is installed into the image, only 48
> abseil libraries are installed as runtime dependencies. But the output
> of 'pkg-config --libs protobuf' lists 66 abseil-cpp libraries are
> required. Add abseil-cpp to RDEPENDS to ensure that all required
> abseil-cpp libraries are installed.
> 
> [1] https://git.openembedded.org/meta-openembedded/commit/?id=dd6421e65eb75c35a904f4b487ba022075035ecc
> 
> Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
> ---
>  meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb b/meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb
> index cc5204de4..354b3213a 100644
> --- a/meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb
> +++ b/meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb
> @@ -106,6 +106,8 @@ FILES:${PN}-lite = "${libdir}/libprotobuf-lite${SOLIBS}"
>  # CMake requires protoc binary to exist in sysroot, even if it has wrong architecture.
>  SYSROOT_DIRS += "${bindir}"
> 
> +RDEPENDS:${PN} = "abseil-cpp"
> +RDEPENDS:${PN}-lite = "abseil-cpp"

This defeats the whole purpose of splitting up the abseil 
libraries. What triggered this change? Was it an actual 
runtime error, or were you only looking at the output 
from pkg-config --libs protobuf?

Since the .pc files are in the protobuf-dev package, which 
depends on the abseil-cpp-dev package, all abseil libraries 
should be available if you are actually building on target 
or with an SDK.

>  RDEPENDS:${PN}-compiler = "${PN}"
>  RDEPENDS:${PN}-dev += "${PN}-compiler"
>  RDEPENDS:${PN}-ptest = "bash ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3-protobuf', '', d)}"
> --
> 2.25.1

//Peter
Yi Zhao Sept. 25, 2024, 2:17 a.m. UTC | #2
On 9/24/24 03:02, Peter Kjellerstedt wrote:
>> -----Original Message-----
>> From: openembedded-devel@lists.openembedded.org <openembedded-devel@lists.openembedded.org> On Behalf Of Yi Zhao
>> Sent: den 22 september 2024 09:36
>> To: openembedded-devel@lists.openembedded.org
>> Subject: [oe] [meta-oe][PATCH 1/2] protobuf: add abseil-cpp to RDEPENDS
>>
>> Since commit[1], the libraries of abseil-cpp have been splitted into
>> separate packages. When protobuf is installed into the image, only 48
>> abseil libraries are installed as runtime dependencies. But the output
>> of 'pkg-config --libs protobuf' lists 66 abseil-cpp libraries are
>> required. Add abseil-cpp to RDEPENDS to ensure that all required
>> abseil-cpp libraries are installed.
>>
>> [1] https://git.openembedded.org/meta-openembedded/commit/?id=dd6421e65eb75c35a904f4b487ba022075035ecc
>>
>> Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
>> ---
>>   meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb b/meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb
>> index cc5204de4..354b3213a 100644
>> --- a/meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb
>> +++ b/meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb
>> @@ -106,6 +106,8 @@ FILES:${PN}-lite = "${libdir}/libprotobuf-lite${SOLIBS}"
>>   # CMake requires protoc binary to exist in sysroot, even if it has wrong architecture.
>>   SYSROOT_DIRS += "${bindir}"
>>
>> +RDEPENDS:${PN} = "abseil-cpp"
>> +RDEPENDS:${PN}-lite = "abseil-cpp"
> This defeats the whole purpose of splitting up the abseil
> libraries. What triggered this change? Was it an actual
> runtime error, or were you only looking at the output
> from pkg-config --libs protobuf?
>
> Since the .pc files are in the protobuf-dev package, which
> depends on the abseil-cpp-dev package, all abseil libraries
> should be available if you are actually building on target
> or with an SDK.


Our customer reported this issue. Here is his description:
The abseil libraries will be included in the SDK, but not on the target. 
The application is building with SDK. The yocto build is adding protobuf 
to the image (no explicit abseil libraries are added). If an application 
then are built using the SDK it can not be executed on target as 
libraries are missing.


//Yi

>
>>   RDEPENDS:${PN}-compiler = "${PN}"
>>   RDEPENDS:${PN}-dev += "${PN}-compiler"
>>   RDEPENDS:${PN}-ptest = "bash ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3-protobuf', '', d)}"
>> --
>> 2.25.1
> //Peter
>
diff mbox series

Patch

diff --git a/meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb b/meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb
index cc5204de4..354b3213a 100644
--- a/meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb
+++ b/meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb
@@ -106,6 +106,8 @@  FILES:${PN}-lite = "${libdir}/libprotobuf-lite${SOLIBS}"
 # CMake requires protoc binary to exist in sysroot, even if it has wrong architecture.
 SYSROOT_DIRS += "${bindir}"
 
+RDEPENDS:${PN} = "abseil-cpp"
+RDEPENDS:${PN}-lite = "abseil-cpp"
 RDEPENDS:${PN}-compiler = "${PN}"
 RDEPENDS:${PN}-dev += "${PN}-compiler"
 RDEPENDS:${PN}-ptest = "bash ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3-protobuf', '', d)}"