Skip to contentSkip to conversation

protobuf: add abseil-cpp to RDEPENDS

PATCH In review Yi Zhao 6 participants 15 messages Sep 22, 2024 – Feb 2, 2025 1 message not in the archive

lore
Share & tools
lore

Yi Zhao

author
#0 lore raw

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

---
 meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb | 2 ++
 1 file changed, 2 insertions(+)
meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb +2 -0
index cc5204de4..354b3213a 100644
@@ -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)}"
Signature · 1 line
2.25.1
author
#1 lore raw

PATCH 2/2 protobuf: upgrade 4.25.4 -> 4.25.5

ChangeLog:
https://github.com/protocolbuffers/protobuf/releases/tag/v25.5

---
 .../protobuf/{protobuf_4.25.4.bb => protobuf_4.25.5.bb}         | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 rename meta-oe/recipes-devtools/protobuf/{protobuf_4.25.4.bb => protobuf_4.25.5.bb} (98%)
meta-oe/recipes-devtools/protobuf/protobuf_4.25.5.bb renamed from meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb +1 -1
similarity index 98%
rename from meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb
rename to meta-oe/recipes-devtools/protobuf/protobuf_4.25.5.bb
index 354b3213a..d5fd90137 100644
@@ -10,7 +10,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=37b5762e07f0af8c74ce80a8bda4266b"
 DEPENDS = "zlib abseil-cpp"
 DEPENDS:append:class-target = " protobuf-native"
 
-SRCREV = "e915ce24b3d43c0fffcbf847354288c07dda1de0"
+SRCREV = "9d0ec0f92b5b5fdeeda11f9dcecc1872ff378014"
 
 SRC_URI = "gitsm://github.com/protocolbuffers/protobuf.git;branch=25.x;protocol=https \
            file://run-ptest \
Signature · 1 line
2.25.1
#2 lore raw
In reply to Yi Zhao
Quoted 25 lines

-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Yi Zhao
Sent: den 22 september 2024 09:36
To: [email protected]
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

---
 meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb | 2 ++
 1 file changed, 2 insertions(+)
meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb +0 -0
index cc5204de4..354b3213a 100644

meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb FILES:${PN}-lite = "${libdir}/libprotobuf-lite${SOLIBS}" · line 110

Quoted 5 lines
meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb +2 -0
@@ -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.

Quoted 5 lines
meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb +0 -1
 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

author
#3 lore raw
Quoted 35 lines · Peter Kjellerstedt
Quoted 25 lines

-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Yi Zhao
Sent: den 22 september 2024 09:36
To: [email protected]
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

---
  meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb | 2 ++
  1 file changed, 2 insertions(+)
meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb +0 -0
index cc5204de4..354b3213a 100644

meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb FILES:${PN}-lite = "${libdir}/libprotobuf-lite${SOLIBS}" · line 110

Quoted 5 lines
meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb +2 -0
@@ -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?

Quoted 4 lines

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

Quoted 8 lines
Quoted 6 lines
meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb +0 -1
  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

#4 lore raw
Quoted 50 lines

-----Original Message-----
From: Yi Zhao <[email protected]>
Sent: den 25 september 2024 04:17
To: Peter Kjellerstedt <[email protected]>; Yi Zhao <[email protected]>
Cc: [email protected]
Subject: Re: [oe] [meta-oe][PATCH 1/2] protobuf: add abseil-cpp to RDEPENDS

Quoted 36 lines · Peter Kjellerstedt
Quoted 25 lines

-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Yi Zhao
Sent: den 22 september 2024 09:36
To: [email protected]
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

---
  meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb | 2 ++
  1 file changed, 2 insertions(+)
meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb +0 -0
index cc5204de4..354b3213a 100644

meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb FILES:${PN}-lite = "${libdir}/libprotobuf-lite${SOLIBS}" · line 110

Quoted 5 lines
meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb +2 -0
@@ -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?

Quoted 4 lines

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.

Quoted 6 lines

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.

Can we at least change the dependency to a recommendation so that it can be avoided via BAD_RECOMMENDATIONS? Because as it is, it penalizes everyone that use protobuf for the case where one provides an SDK with protobuf.

My suggestion would be to change it to:

# Recommend abseil-cpp so that all its libraries are installed in case

# protobuf is provided as part of an SDK. Everyone else should add
# BAD_RECOMMENDATIONS += "abseil-cpp" to their configuration.
RRECOMMENDS:${PN} = "abseil-cpp"
RRECOMMENDS:${PN}-lite = "abseil-cpp"
Quoted 8 lines

//Yi

Quoted 6 lines
Quoted 5 lines
meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb +0 -1
  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

//Peter

#5 lore raw
Quoted 81 lines

-----Original Message-----
From: [email protected] <openembedded- [email protected]> On Behalf Of Peter Kjellerstedt via lists.openembedded.org
Sent: Tuesday, October 1, 2024 14:00
To: Yi Zhao <[email protected]>; Yi Zhao <[email protected]>
Cc: [email protected]
Subject: Re: [oe] [meta-oe][PATCH 1/2] protobuf: add abseil-cpp to RDEPENDS

Quoted 4 lines

-----Original Message-----
From: Yi Zhao <[email protected]>
Sent: den 25 september 2024 04:17
To: Peter Kjellerstedt <[email protected]>; Yi Zhao

<[email protected]>

Quoted 2 lines

Cc: [email protected]
Subject: Re: [oe] [meta-oe][PATCH 1/2] protobuf: add abseil-cpp to

RDEPENDS

Quoted 5 lines · Peter Kjellerstedt
Quoted 2 lines
Quoted 2 lines

-----Original Message-----
From: [email protected] <openembedded-

[email protected]> On Behalf Of Yi Zhao

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Sent: den 22 september 2024 09:36
To: [email protected]
Subject: [oe] [meta-oe][PATCH 1/2] protobuf: add abseil-cpp to

RDEPENDS

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

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=dd6421e65eb75c35a904f4b487ba022075035 ecc

Quoted 7 lines
Quoted 7 lines

Review

Quoted 7 lines
---
  meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb | 2 ++
  1 file changed, 2 insertions(+)
(quoted diff) +0 -0

b/meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb

Quoted 4 lines
Quoted 4 lines

meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb FILES:${PN}-lite = "${libdir}/libprotobuf-

Quoted 4 lines

index cc5204de4..354b3213a 100644

meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb +0 -0
@@ -106,6 +106,8 @@ FILES:${PN}-lite = "${libdir}/libprotobuf-

lite${SOLIBS}"

Quoted 1 line
Quoted 1 line

meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb FILES:${PN}-lite = "${libdir}/libprotobuf- · line 106

Quoted 1 line
meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb +0 -0
  # CMake requires protoc binary to exist in sysroot, even if it has wrong

architecture.

Quoted 15 lines
Quoted 10 lines

meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb FILES:${PN}-lite = "${libdir}/libprotobuf-lite${SOLIBS}" · line 110

Quoted 4 lines
meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb +2 -0
  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?

Quoted 4 lines

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.

Quoted 6 lines

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.

Can we at least change the dependency to a recommendation so that it can be avoided via BAD_RECOMMENDATIONS? Because as it is, it penalizes everyone that use protobuf for the case where one provides an SDK with protobuf.

Quoted 8 lines

My suggestion would be to change it to:

# Recommend abseil-cpp so that all its libraries are installed in case

# protobuf is provided as part of an SDK. Everyone else should add
# BAD_RECOMMENDATIONS += "abseil-cpp" to their configuration.
RRECOMMENDS:${PN} = "abseil-cpp"
RRECOMMENDS:${PN}-lite = "abseil-cpp"

I think that's also not the right way to do this.
Adding unnecessary stuff to release images to satisfy SDK needs is wrong.

I also wonder if the problem is not at the SDK level.
If you build an sdk, there is explicitly installed package base and additional required dependencies of those packages. The dependencies may not be complete and fully usable, only their parts sufficient for the explicitly installed stuff is present. Are the sdk users assuming that full abseil-cpp is installed and thus using also parts not needed for protobuf? The proper solution would be probably to include abseil-cpp explicitly in SDK used in that way.

Peter

Quoted 11 lines
Quoted 5 lines

//Yi

Quoted 3 lines
Quoted 3 lines
meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb +0 -0
  RDEPENDS:${PN}-compiler = "${PN}"
  RDEPENDS:${PN}-dev += "${PN}-compiler"
  RDEPENDS:${PN}-ptest = "bash

${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3-protobuf', '', d)}"

Quoted 3 lines
Quoted 3 lines
Quoted 2 lines

--
2.25.1

//Peter

//Peter

#6 lore raw

I'll explain in more details what the problem is and why this patch is correct, given the current status of abseil-cpp recipe.

In protobuf's abseil-cpp.cmake file, there's a hardcoded list of absl targets used by protobuf:
https://github.com/protocolbuffers/protobuf/blob/main/cmake/abseil-cpp.cmake#L56

This value in turn is parsed and used to replace the @_protobuf_PC_REQUIRES@ in protobuf.pc.cmake.

Here's the generated probobuf.pc file's contents:
"""

$ cat  ../build/protobuf.pc
prefix=/usr
exec_prefix=/usr
libdir=/usr/lib64
includedir=/usr/include

Name: Protocol Buffers
Description: Google's Data Interchange Format
Version: 25.3.0
Requires: absl_absl_check absl_absl_log absl_algorithm absl_base absl_bind_front absl_bits absl_btree absl_cleanup absl_cord absl_core_headers absl_debugging absl_die_if_null absl_dynamic_annotations absl_flags absl_flat_hash_map absl_flat_hash_set absl_function_ref absl_hash absl_layout absl_log_initialize absl_log_severity absl_memory absl_node_hash_map absl_node_hash_set absl_optional absl_span absl_status absl_statusor absl_strings absl_synchronization absl_time absl_type_traits absl_utility absl_variant utf8_range
Libs: -L${libdir} -lprotobuf
Cflags: -I${includedir} -DPROTOBUF_USE_DLLS
Conflicts: protobuf-lite
"""

Let me use "absl_hash" and "absl_absl_log" in the above list as examples.

"""

$ find ../../../abseil-cpp/20240116.2/packa
ges-split/ -name "libabsl_hash.so.*"
../../../abseil-cpp/20240116.2/packages-split/libabsl-hash/usr/lib64/libabsl_hash.so.2401.0.0
../../../abseil-cpp/20240116.2/packages-split/abseil-cpp-dbg/usr/lib64/.debug/libabsl_hash.so.2401.0.0
$ find ../../../abseil-cpp/20240116.2/packa
ges-split/ -name "libabsl_absl_log.so.*"
$
"""

See? The current package splitting of abseil-cpp does not match what protobuf assumes. And I thinks protobuf's assumption is correct, because there's really a absl_absl_log.pc file generated by abseil-cpp.

And there's the contents and location of absl_absl_log.pc:
"""

$ cat ../../../abseil-cpp/20240116.2/packages-split/abseil-cpp-dev/usr/lib64/pkgconfig/absl_absl_log.pc
prefix=/usr
exec_prefix=${prefix}
libdir=/usr/lib64
includedir=/usr/include

Name: absl_absl_log
Description: Abseil absl_log library
URL: https://abseil.io/
Version: 20240116
Requires: absl_log_internal_log_impl = 20240116
Libs: -L${libdir}
Cflags: -I${includedir} -DNOMINMAX
"""

And there's the contents for the absl_log_internal_log_impl:
"""

$ cat ../../../abseil-cpp/20240116.2/packag
es-split/abseil-cpp-dev/usr/lib64/pkgconfig/absl_log_internal_log_impl.pc
prefix=/usr
exec_prefix=${prefix}
libdir=/usr/lib64
includedir=/usr/include

Name: absl_log_internal_log_impl
Description: Abseil log_internal_log_impl library
URL: https://abseil.io/
Version: 20240116
Requires: absl_log_internal_conditions = 20240116, absl_log_internal_message = 20240116, absl_log_internal_strip = 20240116, absl_absl_vlog_is_on = 20240116
Libs: -L${libdir}
Cflags: -I${includedir} -DNOMINMAX
"""

We can then find the absl_log_internal_conditions library:
"""

$ find ../../../abseil-cpp/20240116.2/packages-split/ -name "*absl_log_internal_message*"
../../../abseil-cpp/20240116.2/packages-split/libabsl-log-internal-message/usr/lib64/libabsl_log_internal_message.so.2401.0.0
../../../abseil-cpp/20240116.2/packages-split/abseil-cpp-dev/usr/lib64/libabsl_log_internal_message.so
../../../abseil-cpp/20240116.2/packages-split/abseil-cpp-dev/usr/lib64/pkgconfig/absl_log_internal_message.pc
../../../abseil-cpp/20240116.2/packages-split/abseil-cpp-dbg/usr/lib64/.debug/libabsl_log_internal_message.so.2401.0.0
"""

What does all above mean? It means that abseil-cpp is not splitted reasonably. This could be proven by the absl_absl_log.pc file as described above.

So, given the current situation of abseil-cpp, Yi's solution is correct. Before abseil-cpp is re-splitted according to its pc files, which then could possibly lead to automatic parsing of the protobuf.pc file to add extra RDEPENDS automatically in protobuf recipe, we need to have Yi's solution. And we need to use RDEEPNDS instead of RRECOMMENDS (see the 'Requires' directive in corresponding .pc files).

Regards,
Qi

Quoted 113 lines · Peter Marko via lists.openembedded.org
Quoted 75 lines

-----Original Message-----
From: [email protected] <openembedded- [email protected]> On Behalf Of Peter Kjellerstedt via lists.openembedded.org
Sent: Tuesday, October 1, 2024 14:00
To: Yi Zhao <[email protected]>; Yi Zhao <[email protected]>
Cc: [email protected]
Subject: Re: [oe] [meta-oe][PATCH 1/2] protobuf: add abseil-cpp to RDEPENDS

Quoted 4 lines

-----Original Message-----
From: Yi Zhao <[email protected]>
Sent: den 25 september 2024 04:17
To: Peter Kjellerstedt <[email protected]>; Yi Zhao

<[email protected]>

Quoted 2 lines

Cc: [email protected]
Subject: Re: [oe] [meta-oe][PATCH 1/2] protobuf: add abseil-cpp to

RDEPENDS

Quoted 4 lines · Peter Kjellerstedt
Quoted 2 lines
Quoted 2 lines

-----Original Message-----
From: [email protected] <openembedded-

[email protected]> On Behalf Of Yi Zhao

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Sent: den 22 september 2024 09:36
To: [email protected]
Subject: [oe] [meta-oe][PATCH 1/2] protobuf: add abseil-cpp to

RDEPENDS

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

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=dd6421e65eb75c35a904f4b487ba022075035 ecc

Quoted 6 lines
Quoted 6 lines

Review

Quoted 6 lines
---
   meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb | 2 ++
   1 file changed, 2 insertions(+)
(quoted diff) +0 -0

b/meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb

Quoted 4 lines
Quoted 4 lines

meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb FILES:${PN}-lite = "${libdir}/libprotobuf-

Quoted 4 lines

index cc5204de4..354b3213a 100644

meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb +0 -0
@@ -106,6 +106,8 @@ FILES:${PN}-lite = "${libdir}/libprotobuf-

lite${SOLIBS}"

Quoted 1 line
Quoted 1 line

meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb FILES:${PN}-lite = "${libdir}/libprotobuf- · line 106

Quoted 1 line
meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb +0 -0
   # CMake requires protoc binary to exist in sysroot, even if it has wrong

architecture.

Quoted 13 lines
Quoted 9 lines

meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb FILES:${PN}-lite = "${libdir}/libprotobuf-lite${SOLIBS}" · line 110

Quoted 4 lines
meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb +2 -0
   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?

Quoted 4 lines

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.

Quoted 6 lines

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.

Can we at least change the dependency to a recommendation so that it can be avoided via BAD_RECOMMENDATIONS? Because as it is, it penalizes everyone that use protobuf for the case where one provides an SDK with protobuf.

Quoted 8 lines

My suggestion would be to change it to:

# Recommend abseil-cpp so that all its libraries are installed in case

# protobuf is provided as part of an SDK. Everyone else should add
# BAD_RECOMMENDATIONS += "abseil-cpp" to their configuration.
RRECOMMENDS:${PN} = "abseil-cpp"
RRECOMMENDS:${PN}-lite = "abseil-cpp"

I think that's also not the right way to do this.
Adding unnecessary stuff to release images to satisfy SDK needs is wrong.

I also wonder if the problem is not at the SDK level.
If you build an sdk, there is explicitly installed package base and additional required dependencies of those packages. The dependencies may not be complete and fully usable, only their parts sufficient for the explicitly installed stuff is present. Are the sdk users assuming that full abseil-cpp is installed and thus using also parts not needed for protobuf? The proper solution would be probably to include abseil-cpp explicitly in SDK used in that way.

Peter

Quoted 10 lines
Quoted 5 lines

//Yi

Quoted 3 lines
Quoted 3 lines
meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb +0 -0
   RDEPENDS:${PN}-compiler = "${PN}"
   RDEPENDS:${PN}-dev += "${PN}-compiler"
   RDEPENDS:${PN}-ptest = "bash

${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3-protobuf', '', d)}"

Quoted 3 lines
Quoted 3 lines
Quoted 2 lines

--
2.25.1

//Peter

//Peter

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#112631): https://lists.openembedded.org/g/openembedded-devel/message/112631
Mute This Topic: https://lists.openembedded.org/mt/108587631/7304865
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

A message that is not in the archive (sent off-list or not yet received): [email protected]

#8 lore raw

Before we rework the abseil-cpp and protobuf recipes, a possible improvement for this patch is that we list the needed libraries in RDEPENDS manually.

Regards,
Qi

Quoted 215 lines · Chen Qi via lists.openembedded.org

I'll explain in more details what the problem is and why this patch is correct, given the current status of abseil-cpp recipe.

In protobuf's abseil-cpp.cmake file, there's a hardcoded list of absl targets used by protobuf:
https://github.com/protocolbuffers/protobuf/blob/main/cmake/abseil-cpp.cmake#L56

This value in turn is parsed and used to replace the @_protobuf_PC_REQUIRES@ in protobuf.pc.cmake.

Here's the generated probobuf.pc file's contents:
"""

$ cat  ../build/protobuf.pc
prefix=/usr
exec_prefix=/usr
libdir=/usr/lib64
includedir=/usr/include

Name: Protocol Buffers
Description: Google's Data Interchange Format
Version: 25.3.0
Requires: absl_absl_check absl_absl_log absl_algorithm absl_base absl_bind_front absl_bits absl_btree absl_cleanup absl_cord absl_core_headers absl_debugging absl_die_if_null absl_dynamic_annotations absl_flags absl_flat_hash_map absl_flat_hash_set absl_function_ref absl_hash absl_layout absl_log_initialize absl_log_severity absl_memory absl_node_hash_map absl_node_hash_set absl_optional absl_span absl_status absl_statusor absl_strings absl_synchronization absl_time absl_type_traits absl_utility absl_variant utf8_range
Libs: -L${libdir} -lprotobuf
Cflags: -I${includedir} -DPROTOBUF_USE_DLLS
Conflicts: protobuf-lite
"""

Let me use "absl_hash" and "absl_absl_log" in the above list as examples.

"""

$ find ../../../abseil-cpp/20240116.2/packa
ges-split/ -name "libabsl_hash.so.*"
../../../abseil-cpp/20240116.2/packages-split/libabsl-hash/usr/lib64/libabsl_hash.so.2401.0.0 

../../../abseil-cpp/20240116.2/packages-split/abseil-cpp-dbg/usr/lib64/.debug/libabsl_hash.so.2401.0.0

$ find ../../../abseil-cpp/20240116.2/packa
ges-split/ -name "libabsl_absl_log.so.*"
$
"""

See? The current package splitting of abseil-cpp does not match what protobuf assumes. And I thinks protobuf's assumption is correct, because there's really a absl_absl_log.pc file generated by abseil-cpp.

And there's the contents and location of absl_absl_log.pc:
"""

$ cat ../../../abseil-cpp/20240116.2/packages-split/abseil-cpp-dev/usr/lib64/pkgconfig/absl_absl_log.pc
prefix=/usr
exec_prefix=${prefix}
libdir=/usr/lib64
includedir=/usr/include

Name: absl_absl_log
Description: Abseil absl_log library
URL: https://abseil.io/
Version: 20240116
Requires: absl_log_internal_log_impl = 20240116
Libs: -L${libdir}
Cflags: -I${includedir} -DNOMINMAX
"""

And there's the contents for the absl_log_internal_log_impl:
"""

$ cat ../../../abseil-cpp/20240116.2/packag
es-split/abseil-cpp-dev/usr/lib64/pkgconfig/absl_log_internal_log_impl.pc
prefix=/usr
exec_prefix=${prefix}
libdir=/usr/lib64
includedir=/usr/include

Name: absl_log_internal_log_impl
Description: Abseil log_internal_log_impl library
URL: https://abseil.io/
Version: 20240116
Requires: absl_log_internal_conditions = 20240116, absl_log_internal_message = 20240116, absl_log_internal_strip = 20240116, absl_absl_vlog_is_on = 20240116
Libs: -L${libdir}
Cflags: -I${includedir} -DNOMINMAX
"""

We can then find the absl_log_internal_conditions library:
"""

$ find ../../../abseil-cpp/20240116.2/packages-split/ -name "*absl_log_internal_message*"
../../../abseil-cpp/20240116.2/packages-split/libabsl-log-internal-message/usr/lib64/libabsl_log_internal_message.so.2401.0.0 

../../../abseil-cpp/20240116.2/packages-split/abseil-cpp-dev/usr/lib64/libabsl_log_internal_message.so

../../../abseil-cpp/20240116.2/packages-split/abseil-cpp-dev/usr/lib64/pkgconfig/absl_log_internal_message.pc

../../../abseil-cpp/20240116.2/packages-split/abseil-cpp-dbg/usr/lib64/.debug/libabsl_log_internal_message.so.2401.0.0

"""

What does all above mean? It means that abseil-cpp is not splitted reasonably. This could be proven by the absl_absl_log.pc file as described above.

So, given the current situation of abseil-cpp, Yi's solution is correct. Before abseil-cpp is re-splitted according to its pc files, which then could possibly lead to automatic parsing of the protobuf.pc file to add extra RDEPENDS automatically in protobuf recipe, we need to have Yi's solution. And we need to use RDEEPNDS instead of RRECOMMENDS (see the 'Requires' directive in corresponding .pc files).

Regards,
Qi

Quoted 86 lines · Peter Marko via lists.openembedded.org
Quoted 75 lines

-----Original Message-----
From: [email protected] <openembedded- [email protected]> On Behalf Of Peter Kjellerstedt via lists.openembedded.org
Sent: Tuesday, October 1, 2024 14:00
To: Yi Zhao <[email protected]>; Yi Zhao <[email protected]>
Cc: [email protected]
Subject: Re: [oe] [meta-oe][PATCH 1/2] protobuf: add abseil-cpp to RDEPENDS

Quoted 4 lines

-----Original Message-----
From: Yi Zhao <[email protected]>
Sent: den 25 september 2024 04:17
To: Peter Kjellerstedt <[email protected]>; Yi Zhao

<[email protected]>

Quoted 2 lines

Cc: [email protected]
Subject: Re: [oe] [meta-oe][PATCH 1/2] protobuf: add abseil-cpp to

RDEPENDS

Quoted 4 lines · Peter Kjellerstedt
Quoted 2 lines
Quoted 2 lines

-----Original Message-----
From: [email protected] <openembedded-

[email protected]> On Behalf Of Yi Zhao

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Sent: den 22 september 2024 09:36
To: [email protected]
Subject: [oe] [meta-oe][PATCH 1/2] protobuf: add abseil-cpp to

RDEPENDS

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

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=dd6421e65eb75c35a904f4b487ba022075035 ecc

Quoted 6 lines
Quoted 6 lines

Review

Quoted 6 lines

---
   meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb | 2 ++

   1 file changed, 2 insertions(+)
(quoted diff) +0 -0

b/meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb

Quoted 4 lines
Quoted 4 lines

meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb FILES:${PN}-lite = "${libdir}/libprotobuf-

Quoted 4 lines

index cc5204de4..354b3213a 100644

meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb +0 -0
@@ -106,6 +106,8 @@ FILES:${PN}-lite = "${libdir}/libprotobuf-

lite${SOLIBS}"

Quoted 1 line
Quoted 1 line

meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb FILES:${PN}-lite = "${libdir}/libprotobuf- · line 106

Quoted 1 line
meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb +0 -0
    # CMake requires protoc binary to exist in sysroot, even if it has wrong

architecture.

Quoted 13 lines
Quoted 9 lines

meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb FILES:${PN}-lite = "${libdir}/libprotobuf-lite${SOLIBS}" · line 110

Quoted 4 lines

   SYSROOT_DIRS += "${bindir}"

meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb +2 -0
+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?

Quoted 4 lines

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.

Quoted 6 lines

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.

Can we at least change the dependency to a recommendation so that it can be avoided via BAD_RECOMMENDATIONS? Because as it is, it penalizes everyone that use protobuf for the case where one provides an SDK with protobuf.

Quoted 8 lines

My suggestion would be to change it to:

# Recommend abseil-cpp so that all its libraries are installed in case

# protobuf is provided as part of an SDK. Everyone else should add
# BAD_RECOMMENDATIONS += "abseil-cpp" to their configuration.
RRECOMMENDS:${PN} = "abseil-cpp"
RRECOMMENDS:${PN}-lite = "abseil-cpp"

I think that's also not the right way to do this.
Adding unnecessary stuff to release images to satisfy SDK needs is wrong.

Quoted 21 lines

I also wonder if the problem is not at the SDK level.
If you build an sdk, there is explicitly installed package base and additional required dependencies of those packages. The dependencies may not be complete and fully usable, only their parts sufficient for the explicitly installed stuff is present. Are the sdk users assuming that full abseil-cpp is installed and thus using also parts not needed for protobuf? The proper solution would be probably to include abseil-cpp explicitly in SDK used in that way.

Peter

Quoted 10 lines
Quoted 5 lines

//Yi

Quoted 3 lines
Quoted 3 lines

   RDEPENDS:${PN}-compiler = "${PN}"
   RDEPENDS:${PN}-dev += "${PN}-compiler"
   RDEPENDS:${PN}-ptest = "bash

${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3-protobuf', '', d)}"

Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
Signature · 1 line
2.25.1

//Peter

//Peter

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#114133): https://lists.openembedded.org/g/openembedded-devel/message/114133
Mute This Topic: https://lists.openembedded.org/mt/108587631/3618072
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#9 lore raw

Hi Qi,

Quoted 3 lines · Chen Qi via lists.openembedded.org

Before we rework the abseil-cpp and protobuf recipes, a possible improvement for this patch is that we list the needed libraries in RDEPENDS manually.

my main concern was (as you already may have guessed) not having the full set of absl libraries in my rootfs, as only some of them are required. But I cannot tell which is the best option to achieve this.

regards,
Christian

Quoted 250 lines

Regards,
Qi

Quoted 243 lines · Chen Qi via lists.openembedded.org

I'll explain in more details what the problem is and why this patch is correct, given the current status of abseil-cpp recipe.

In protobuf's abseil-cpp.cmake file, there's a hardcoded list of absl targets used by protobuf:
https://github.com/protocolbuffers/protobuf/blob/main/cmake/abseil-cpp.cmake#L56

This value in turn is parsed and used to replace the @_protobuf_PC_REQUIRES@ in protobuf.pc.cmake.

Here's the generated probobuf.pc file's contents:
"""

$ cat  ../build/protobuf.pc
prefix=/usr
exec_prefix=/usr
libdir=/usr/lib64
includedir=/usr/include

Name: Protocol Buffers
Description: Google's Data Interchange Format
Version: 25.3.0
Requires: absl_absl_check absl_absl_log absl_algorithm absl_base absl_bind_front absl_bits absl_btree absl_cleanup absl_cord absl_core_headers absl_debugging absl_die_if_null absl_dynamic_annotations absl_flags absl_flat_hash_map absl_flat_hash_set absl_function_ref absl_hash absl_layout absl_log_initialize absl_log_severity absl_memory absl_node_hash_map absl_node_hash_set absl_optional absl_span absl_status absl_statusor absl_strings absl_synchronization absl_time absl_type_traits absl_utility absl_variant utf8_range
Libs: -L${libdir} -lprotobuf
Cflags: -I${includedir} -DPROTOBUF_USE_DLLS
Conflicts: protobuf-lite
"""

Let me use "absl_hash" and "absl_absl_log" in the above list as examples.

"""

$ find ../../../abseil-cpp/20240116.2/packa
ges-split/ -name "libabsl_hash.so.*"
../../../abseil-cpp/20240116.2/packages-split/libabsl-hash/usr/lib64/libabsl_hash.so.2401.0.0 

../../../abseil-cpp/20240116.2/packages-split/abseil-cpp-dbg/usr/lib64/.debug/libabsl_hash.so.2401.0.0

$ find ../../../abseil-cpp/20240116.2/packa
ges-split/ -name "libabsl_absl_log.so.*"
$
"""

See? The current package splitting of abseil-cpp does not match what protobuf assumes. And I thinks protobuf's assumption is correct, because there's really a absl_absl_log.pc file generated by abseil-cpp.

And there's the contents and location of absl_absl_log.pc:
"""

$ cat 
../../../abseil-cpp/20240116.2/packages-split/abseil-cpp-dev/usr/lib64/pkgconfig/absl_absl_log.pc
prefix=/usr
exec_prefix=${prefix}
libdir=/usr/lib64
includedir=/usr/include

Name: absl_absl_log
Description: Abseil absl_log library
URL: https://abseil.io/
Version: 20240116
Requires: absl_log_internal_log_impl = 20240116
Libs: -L${libdir}
Cflags: -I${includedir} -DNOMINMAX
"""

And there's the contents for the absl_log_internal_log_impl:
"""

$ cat ../../../abseil-cpp/20240116.2/packag
es-split/abseil-cpp-dev/usr/lib64/pkgconfig/absl_log_internal_log_impl.pc
prefix=/usr
exec_prefix=${prefix}
libdir=/usr/lib64
includedir=/usr/include

Name: absl_log_internal_log_impl
Description: Abseil log_internal_log_impl library
URL: https://abseil.io/
Version: 20240116
Requires: absl_log_internal_conditions = 20240116, absl_log_internal_message = 20240116, absl_log_internal_strip = 20240116, absl_absl_vlog_is_on = 20240116
Libs: -L${libdir}
Cflags: -I${includedir} -DNOMINMAX
"""

We can then find the absl_log_internal_conditions library:
"""

$ find ../../../abseil-cpp/20240116.2/packages-split/ -name 
"*absl_log_internal_message*"
../../../abseil-cpp/20240116.2/packages-split/libabsl-log-internal-message/usr/lib64/libabsl_log_internal_message.so.2401.0.0 

../../../abseil-cpp/20240116.2/packages-split/abseil-cpp-dev/usr/lib64/libabsl_log_internal_message.so

../../../abseil-cpp/20240116.2/packages-split/abseil-cpp-dev/usr/lib64/pkgconfig/absl_log_internal_message.pc

../../../abseil-cpp/20240116.2/packages-split/abseil-cpp-dbg/usr/lib64/.debug/libabsl_log_internal_message.so.2401.0.0

"""

What does all above mean? It means that abseil-cpp is not splitted reasonably. This could be proven by the absl_absl_log.pc file as described above.

So, given the current situation of abseil-cpp, Yi's solution is correct. Before abseil-cpp is re-splitted according to its pc files, which then could possibly lead to automatic parsing of the protobuf.pc file to add extra RDEPENDS automatically in protobuf recipe, we need to have Yi's solution. And we need to use RDEEPNDS instead of RRECOMMENDS (see the 'Requires' directive in corresponding .pc files).

Regards,
Qi

Quoted 118 lines · Peter Marko via lists.openembedded.org
Quoted 82 lines

-----Original Message-----
From: [email protected] <openembedded- [email protected]> On Behalf Of Peter Kjellerstedt via lists.openembedded.org
Sent: Tuesday, October 1, 2024 14:00
To: Yi Zhao <[email protected]>; Yi Zhao <[email protected]>
Cc: [email protected]
Subject: Re: [oe] [meta-oe][PATCH 1/2] protobuf: add abseil-cpp to RDEPENDS

Quoted 4 lines

-----Original Message-----
From: Yi Zhao <[email protected]>
Sent: den 25 september 2024 04:17
To: Peter Kjellerstedt <[email protected]>; Yi Zhao

<[email protected]>

Quoted 2 lines

Cc: [email protected]
Subject: Re: [oe] [meta-oe][PATCH 1/2] protobuf: add abseil-cpp to

RDEPENDS

Quoted 4 lines · Peter Kjellerstedt
Quoted 2 lines
Quoted 2 lines

-----Original Message-----
From: [email protected] <openembedded-

[email protected]> On Behalf Of Yi Zhao

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Sent: den 22 september 2024 09:36
To: [email protected]
Subject: [oe] [meta-oe][PATCH 1/2] protobuf: add abseil-cpp to

RDEPENDS

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

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=dd6421e65eb75c35a904f4b487ba022075035 ecc

Quoted 6 lines
Quoted 6 lines

Review

Quoted 6 lines
---
   meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb | 2 ++
   1 file changed, 2 insertions(+)
(quoted diff) +0 -0

b/meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb

Quoted 4 lines
Quoted 4 lines

meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb FILES:${PN}-lite = "${libdir}/libprotobuf-

Quoted 4 lines

index cc5204de4..354b3213a 100644

meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb +0 -0
@@ -106,6 +106,8 @@ FILES:${PN}-lite = "${libdir}/libprotobuf-

lite${SOLIBS}"

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb +0 -0
   # CMake requires protoc binary to exist in sysroot, even if it 

has wrong

architecture.

Quoted 13 lines
Quoted 9 lines

meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb

Quoted 4 lines
   SYSROOT_DIRS += "${bindir}"
meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb +2 -0
+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?

Quoted 4 lines

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.

Quoted 9 lines

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.

Can we at least change the dependency to a recommendation so that it can be avoided via BAD_RECOMMENDATIONS? Because as it is, it penalizes everyone that use protobuf for the case where one provides an SDK with protobuf.

Quoted 8 lines

My suggestion would be to change it to:

# Recommend abseil-cpp so that all its libraries are installed in case

# protobuf is provided as part of an SDK. Everyone else should add
# BAD_RECOMMENDATIONS += "abseil-cpp" to their configuration.
RRECOMMENDS:${PN} = "abseil-cpp"
RRECOMMENDS:${PN}-lite = "abseil-cpp"

I think that's also not the right way to do this. Adding unnecessary stuff to release images to satisfy SDK needs is wrong.

I also wonder if the problem is not at the SDK level.
If you build an sdk, there is explicitly installed package base and additional required dependencies of those packages.
The dependencies may not be complete and fully usable, only their parts sufficient for the explicitly installed stuff is present. Are the sdk users assuming that full abseil-cpp is installed and thus using also parts not needed for protobuf?
The proper solution would be probably to include abseil-cpp explicitly in SDK used in that way.

Peter

Quoted 9 lines
Quoted 5 lines

//Yi

Quoted 3 lines
Quoted 3 lines
   RDEPENDS:${PN}-compiler = "${PN}"
   RDEPENDS:${PN}-dev += "${PN}-compiler"
   RDEPENDS:${PN}-ptest = "bash

${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3-protobuf', '', d)}"

Quoted 1 line
Quoted 1 line

//Peter

//Peter

#10 lore raw

Hello,

Quoted 15 lines

-----Original Message-----
From: Christian Eggers <[email protected]>
Sent: Monday, December 2, 2024 14:39
To: Marko, Peter (FT D EU SK BFS1) <[email protected]>; [email protected]; Yi Zhao <[email protected]>; Yi Zhao <[email protected]>; openembedded- [email protected]
Cc: [email protected]; [email protected]
Subject: Re: [oe] [meta-oe][PATCH 1/2] protobuf: add abseil-cpp to RDEPENDS

Hi Qi,

On Monday, 2 December 2024, 06:35:22 CET, Chen Qi via lists.openembedded.org wrote:

Quoted 8 lines
Quoted 3 lines

Before we rework the abseil-cpp and protobuf recipes, a possible improvement for this patch is that we list the needed libraries in RDEPENDS manually.

my main concern was (as you already may have guessed) not having the full set of
absl libraries in my rootfs, as only some of them are required. But I cannot tell which is the best option to achieve this.

If you want full abseil-cpp in your rootfs, please use IMAGE_INSTALL for that.
Packages should pull only their real dependencies, not something you need for other reasons. You use-case seems to be to develop application with abseil-cpp library but not installing it explicitly. SDK images need to install (or depend on) additional packages compared to release images.

Peter

Quoted 268 lines

regards,
Christian

Quoted 11 lines

Regards,
Qi

Quoted 6 lines · Chen Qi via lists.openembedded.org

I'll explain in more details what the problem is and why this patch is correct, given the current status of abseil-cpp recipe.

In protobuf's abseil-cpp.cmake file, there's a hardcoded list of absl targets used by protobuf:
https://github.com/protocolbuffers/protobuf/blob/main/cmake/abseil-

cpp.cmake#L56

Quoted 30 lines
Quoted 30 lines

This value in turn is parsed and used to replace the @_protobuf_PC_REQUIRES@ in protobuf.pc.cmake.

Here's the generated probobuf.pc file's contents:
"""

$ cat  ../build/protobuf.pc
prefix=/usr
exec_prefix=/usr
libdir=/usr/lib64
includedir=/usr/include

Name: Protocol Buffers
Description: Google's Data Interchange Format
Version: 25.3.0
Requires: absl_absl_check absl_absl_log absl_algorithm absl_base absl_bind_front absl_bits absl_btree absl_cleanup absl_cord absl_core_headers absl_debugging absl_die_if_null absl_dynamic_annotations absl_flags absl_flat_hash_map absl_flat_hash_set absl_function_ref absl_hash absl_layout absl_log_initialize absl_log_severity absl_memory absl_node_hash_map absl_node_hash_set absl_optional absl_span absl_status absl_statusor absl_strings absl_synchronization absl_time absl_type_traits absl_utility absl_variant utf8_range
Libs: -L${libdir} -lprotobuf
Cflags: -I${includedir} -DPROTOBUF_USE_DLLS
Conflicts: protobuf-lite
"""

Quoted 6 lines
Quoted 6 lines

Let me use "absl_hash" and "absl_absl_log" in the above list as examples.

"""

$ find ../../../abseil-cpp/20240116.2/packa
ges-split/ -name "libabsl_hash.so.*"
../../../abseil-cpp/20240116.2/packages-split/libabsl-

hash/usr/lib64/libabsl_hash.so.2401.0.0

Quoted 2 lines
Quoted 2 lines

../../../abseil-cpp/20240116.2/packages-split/abseil-cpp-

dbg/usr/lib64/.debug/libabsl_hash.so.2401.0.0

Quoted 6 lines
Quoted 6 lines
$ find ../../../abseil-cpp/20240116.2/packa
ges-split/ -name "libabsl_absl_log.so.*"
$
"""
Quoted 8 lines
Quoted 8 lines

See? The current package splitting of abseil-cpp does not match what protobuf assumes. And I thinks protobuf's assumption is correct, because there's really a absl_absl_log.pc file generated by abseil-cpp.

And there's the contents and location of absl_absl_log.pc:
"""

$ cat
../../../abseil-cpp/20240116.2/packages-split/abseil-cpp-

dev/usr/lib64/pkgconfig/absl_absl_log.pc

Quoted 34 lines
Quoted 34 lines

prefix=/usr
exec_prefix=${prefix}
libdir=/usr/lib64
includedir=/usr/include

Name: absl_absl_log
Description: Abseil absl_log library
URL: https://abseil.io/
Version: 20240116
Requires: absl_log_internal_log_impl = 20240116
Libs: -L${libdir}
Cflags: -I${includedir} -DNOMINMAX
"""

And there's the contents for the absl_log_internal_log_impl:
"""

$ cat ../../../abseil-cpp/20240116.2/packag
es-split/abseil-cpp-dev/usr/lib64/pkgconfig/absl_log_internal_log_impl.pc
prefix=/usr
exec_prefix=${prefix}
libdir=/usr/lib64
includedir=/usr/include

Name: absl_log_internal_log_impl
Description: Abseil log_internal_log_impl library
URL: https://abseil.io/
Version: 20240116
Requires: absl_log_internal_conditions = 20240116, absl_log_internal_message = 20240116, absl_log_internal_strip = 20240116, absl_absl_vlog_is_on = 20240116
Libs: -L${libdir}
Cflags: -I${includedir} -DNOMINMAX
"""

Quoted 5 lines
Quoted 5 lines

We can then find the absl_log_internal_conditions library:
"""

$ find ../../../abseil-cpp/20240116.2/packages-split/ -name
"*absl_log_internal_message*"
../../../abseil-cpp/20240116.2/packages-split/libabsl-log-internal-

message/usr/lib64/libabsl_log_internal_message.so.2401.0.0

Quoted 2 lines
Quoted 2 lines

../../../abseil-cpp/20240116.2/packages-split/abseil-cpp-

dev/usr/lib64/libabsl_log_internal_message.so

Quoted 2 lines
Quoted 2 lines

../../../abseil-cpp/20240116.2/packages-split/abseil-cpp-

dev/usr/lib64/pkgconfig/absl_log_internal_message.pc

Quoted 2 lines
Quoted 2 lines

../../../abseil-cpp/20240116.2/packages-split/abseil-cpp-

dbg/usr/lib64/.debug/libabsl_log_internal_message.so.2401.0.0

Quoted 14 lines
Quoted 14 lines

"""

What does all above mean? It means that abseil-cpp is not splitted reasonably. This could be proven by the absl_absl_log.pc file as described above.

So, given the current situation of abseil-cpp, Yi's solution is correct. Before abseil-cpp is re-splitted according to its pc files, which then could possibly lead to automatic parsing of the protobuf.pc file to add extra RDEPENDS automatically in protobuf recipe, we need to have Yi's solution. And we need to use RDEEPNDS instead of RRECOMMENDS (see the 'Requires' directive in corresponding .pc files).

Quoted 6 lines
Quoted 6 lines

Regards,
Qi

Quoted 2 lines · Peter Marko via lists.openembedded.org
Quoted 2 lines

-----Original Message-----
From: [email protected]

<openembedded-

Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines

[email protected]> On Behalf Of Peter Kjellerstedt via lists.openembedded.org
Sent: Tuesday, October 1, 2024 14:00
To: Yi Zhao <[email protected]>; Yi Zhao <[email protected]>
Cc: [email protected]
Subject: Re: [oe] [meta-oe][PATCH 1/2] protobuf: add abseil-cpp to RDEPENDS

Quoted 4 lines

-----Original Message-----
From: Yi Zhao <[email protected]>
Sent: den 25 september 2024 04:17
To: Peter Kjellerstedt <[email protected]>; Yi Zhao

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

<[email protected]>

Quoted 2 lines

Cc: [email protected]
Subject: Re: [oe] [meta-oe][PATCH 1/2] protobuf: add abseil-cpp to

RDEPENDS

Quoted 4 lines · Peter Kjellerstedt
Quoted 2 lines
Quoted 2 lines

-----Original Message-----
From: [email protected]

<openembedded-

Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines

[email protected]> On Behalf Of Yi Zhao

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Sent: den 22 september 2024 09:36
To: [email protected]
Subject: [oe] [meta-oe][PATCH 1/2] protobuf: add abseil-cpp to

RDEPENDS

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

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.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

[1] https://git.openembedded.org/meta-

openembedded/commit/?id=dd6421e65eb75c35a904f4b487ba022075035

Quoted 85 lines
Quoted 83 lines
Quoted 79 lines
Quoted 43 lines

ecc

Quoted 6 lines
Quoted 6 lines

Review

Quoted 6 lines
---
   meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb | 2 ++
   1 file changed, 2 insertions(+)
(quoted diff) +0 -0

b/meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb

Quoted 4 lines
Quoted 4 lines

meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb FILES:${PN}-lite = "${libdir}/libprotobuf-

Quoted 4 lines

index cc5204de4..354b3213a 100644

meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb +0 -0
@@ -106,6 +106,8 @@ FILES:${PN}-lite = "${libdir}/libprotobuf-

lite${SOLIBS}"

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb +0 -0
   # CMake requires protoc binary to exist in sysroot, even if it

has wrong

architecture.

Quoted 13 lines
Quoted 9 lines

meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb

Quoted 4 lines
   SYSROOT_DIRS += "${bindir}"
meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb +2 -0
+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?

Quoted 4 lines

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.

Quoted 9 lines

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.

Can we at least change the dependency to a recommendation so that it can be avoided via BAD_RECOMMENDATIONS? Because as it is, it penalizes everyone that use protobuf for the case where one provides an SDK with protobuf.

Quoted 8 lines

My suggestion would be to change it to:

# Recommend abseil-cpp so that all its libraries are installed in case

# protobuf is provided as part of an SDK. Everyone else should add
# BAD_RECOMMENDATIONS += "abseil-cpp" to their configuration.
RRECOMMENDS:${PN} = "abseil-cpp"
RRECOMMENDS:${PN}-lite = "abseil-cpp"

I think that's also not the right way to do this. Adding unnecessary stuff to release images to satisfy SDK needs is wrong.

I also wonder if the problem is not at the SDK level.
If you build an sdk, there is explicitly installed package base and additional required dependencies of those packages.
The dependencies may not be complete and fully usable, only their parts sufficient for the explicitly installed stuff is present. Are the sdk users assuming that full abseil-cpp is installed and thus using also parts not needed for protobuf?
The proper solution would be probably to include abseil-cpp explicitly in SDK used in that way.

Peter

Quoted 9 lines
Quoted 5 lines

//Yi

Quoted 3 lines
Quoted 3 lines
   RDEPENDS:${PN}-compiler = "${PN}"
   RDEPENDS:${PN}-dev += "${PN}-compiler"
   RDEPENDS:${PN}-ptest = "bash

${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3-protobuf', '', d)}"

Quoted 1 line
Quoted 1 line

//Peter

//Peter

#11 lore raw

Hi Peter,

Quoted 26 lines · Peter

Hello,

Quoted 15 lines

-----Original Message-----
From: Christian Eggers <[email protected]>
Sent: Monday, December 2, 2024 14:39
To: Marko, Peter (FT D EU SK BFS1) <[email protected]>; [email protected]; Yi Zhao <[email protected]>; Yi Zhao <[email protected]>; openembedded- [email protected]
Cc: [email protected]; [email protected]
Subject: Re: [oe] [meta-oe][PATCH 1/2] protobuf: add abseil-cpp to RDEPENDS

Hi Qi,

On Monday, 2 December 2024, 06:35:22 CET, Chen Qi via lists.openembedded.org wrote:

Quoted 8 lines
Quoted 3 lines

Before we rework the abseil-cpp and protobuf recipes, a possible improvement for this patch is that we list the needed libraries in RDEPENDS manually.

my main concern was (as you already may have guessed) not having the full set of
absl libraries in my rootfs, as only some of them are required. But I cannot tell which is the best option to achieve this.

Quoted 4 lines

If you want full abseil-cpp in your rootfs, please use IMAGE_INSTALL for that.
Packages should pull only their real dependencies, not something you need for other reasons. You use-case seems to be to develop application with abseil-cpp library but not installing it explicitly. SDK images need to install (or depend on) additional packages compared to release images.

sorry, but I meant it the other way around:

"I do not like having the full set of abseil-cpp libraries in my rootfs only because I use protobuf in my application".

Sorry for the confusion.

regards,
Christian

Quoted 273 lines

Peter

Quoted 268 lines

regards,
Christian

Quoted 11 lines

Regards,
Qi

Quoted 6 lines · Chen Qi via lists.openembedded.org

I'll explain in more details what the problem is and why this patch is correct, given the current status of abseil-cpp recipe.

In protobuf's abseil-cpp.cmake file, there's a hardcoded list of absl targets used by protobuf:
https://github.com/protocolbuffers/protobuf/blob/main/cmake/abseil-

cpp.cmake#L56

Quoted 30 lines
Quoted 30 lines

This value in turn is parsed and used to replace the @_protobuf_PC_REQUIRES@ in protobuf.pc.cmake.

Here's the generated probobuf.pc file's contents:
"""

$ cat  ../build/protobuf.pc
prefix=/usr
exec_prefix=/usr
libdir=/usr/lib64
includedir=/usr/include

Name: Protocol Buffers
Description: Google's Data Interchange Format
Version: 25.3.0
Requires: absl_absl_check absl_absl_log absl_algorithm absl_base absl_bind_front absl_bits absl_btree absl_cleanup absl_cord absl_core_headers absl_debugging absl_die_if_null absl_dynamic_annotations absl_flags absl_flat_hash_map absl_flat_hash_set absl_function_ref absl_hash absl_layout absl_log_initialize absl_log_severity absl_memory absl_node_hash_map absl_node_hash_set absl_optional absl_span absl_status absl_statusor absl_strings absl_synchronization absl_time absl_type_traits absl_utility absl_variant utf8_range
Libs: -L${libdir} -lprotobuf
Cflags: -I${includedir} -DPROTOBUF_USE_DLLS
Conflicts: protobuf-lite
"""

Quoted 6 lines
Quoted 6 lines

Let me use "absl_hash" and "absl_absl_log" in the above list as examples.

"""

$ find ../../../abseil-cpp/20240116.2/packa
ges-split/ -name "libabsl_hash.so.*"
../../../abseil-cpp/20240116.2/packages-split/libabsl-

hash/usr/lib64/libabsl_hash.so.2401.0.0

Quoted 2 lines
Quoted 2 lines

../../../abseil-cpp/20240116.2/packages-split/abseil-cpp-

dbg/usr/lib64/.debug/libabsl_hash.so.2401.0.0

Quoted 6 lines
Quoted 6 lines
$ find ../../../abseil-cpp/20240116.2/packa
ges-split/ -name "libabsl_absl_log.so.*"
$
"""
Quoted 8 lines
Quoted 8 lines

See? The current package splitting of abseil-cpp does not match what protobuf assumes. And I thinks protobuf's assumption is correct, because there's really a absl_absl_log.pc file generated by abseil-cpp.

And there's the contents and location of absl_absl_log.pc:
"""

$ cat
../../../abseil-cpp/20240116.2/packages-split/abseil-cpp-

dev/usr/lib64/pkgconfig/absl_absl_log.pc

Quoted 34 lines
Quoted 34 lines

prefix=/usr
exec_prefix=${prefix}
libdir=/usr/lib64
includedir=/usr/include

Name: absl_absl_log
Description: Abseil absl_log library
URL: https://abseil.io/
Version: 20240116
Requires: absl_log_internal_log_impl = 20240116
Libs: -L${libdir}
Cflags: -I${includedir} -DNOMINMAX
"""

And there's the contents for the absl_log_internal_log_impl:
"""

$ cat ../../../abseil-cpp/20240116.2/packag
es-split/abseil-cpp-dev/usr/lib64/pkgconfig/absl_log_internal_log_impl.pc
prefix=/usr
exec_prefix=${prefix}
libdir=/usr/lib64
includedir=/usr/include

Name: absl_log_internal_log_impl
Description: Abseil log_internal_log_impl library
URL: https://abseil.io/
Version: 20240116
Requires: absl_log_internal_conditions = 20240116, absl_log_internal_message = 20240116, absl_log_internal_strip = 20240116, absl_absl_vlog_is_on = 20240116
Libs: -L${libdir}
Cflags: -I${includedir} -DNOMINMAX
"""

Quoted 5 lines
Quoted 5 lines

We can then find the absl_log_internal_conditions library:
"""

$ find ../../../abseil-cpp/20240116.2/packages-split/ -name
"*absl_log_internal_message*"
../../../abseil-cpp/20240116.2/packages-split/libabsl-log-internal-

message/usr/lib64/libabsl_log_internal_message.so.2401.0.0

Quoted 2 lines
Quoted 2 lines

../../../abseil-cpp/20240116.2/packages-split/abseil-cpp-

dev/usr/lib64/libabsl_log_internal_message.so

Quoted 2 lines
Quoted 2 lines

../../../abseil-cpp/20240116.2/packages-split/abseil-cpp-

dev/usr/lib64/pkgconfig/absl_log_internal_message.pc

Quoted 2 lines
Quoted 2 lines

../../../abseil-cpp/20240116.2/packages-split/abseil-cpp-

dbg/usr/lib64/.debug/libabsl_log_internal_message.so.2401.0.0

Quoted 14 lines
Quoted 14 lines

"""

What does all above mean? It means that abseil-cpp is not splitted reasonably. This could be proven by the absl_absl_log.pc file as described above.

So, given the current situation of abseil-cpp, Yi's solution is correct. Before abseil-cpp is re-splitted according to its pc files, which then could possibly lead to automatic parsing of the protobuf.pc file to add extra RDEPENDS automatically in protobuf recipe, we need to have Yi's solution. And we need to use RDEEPNDS instead of RRECOMMENDS (see the 'Requires' directive in corresponding .pc files).

Quoted 6 lines
Quoted 6 lines

Regards,
Qi

Quoted 2 lines · Peter Marko via lists.openembedded.org
Quoted 2 lines

-----Original Message-----
From: [email protected]

<openembedded-

Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines

[email protected]> On Behalf Of Peter Kjellerstedt via lists.openembedded.org
Sent: Tuesday, October 1, 2024 14:00
To: Yi Zhao <[email protected]>; Yi Zhao <[email protected]>
Cc: [email protected]
Subject: Re: [oe] [meta-oe][PATCH 1/2] protobuf: add abseil-cpp to RDEPENDS

Quoted 4 lines

-----Original Message-----
From: Yi Zhao <[email protected]>
Sent: den 25 september 2024 04:17
To: Peter Kjellerstedt <[email protected]>; Yi Zhao

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

<[email protected]>

Quoted 2 lines

Cc: [email protected]
Subject: Re: [oe] [meta-oe][PATCH 1/2] protobuf: add abseil-cpp to

RDEPENDS

Quoted 4 lines · Peter Kjellerstedt
Quoted 2 lines
Quoted 2 lines

-----Original Message-----
From: [email protected]

<openembedded-

Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines

[email protected]> On Behalf Of Yi Zhao

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Sent: den 22 september 2024 09:36
To: [email protected]
Subject: [oe] [meta-oe][PATCH 1/2] protobuf: add abseil-cpp to

RDEPENDS

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

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.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

[1] https://git.openembedded.org/meta-

openembedded/commit/?id=dd6421e65eb75c35a904f4b487ba022075035

Quoted 85 lines
Quoted 83 lines
Quoted 79 lines
Quoted 43 lines

ecc

Quoted 6 lines
Quoted 6 lines

Review

Quoted 6 lines
---
   meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb | 2 ++
   1 file changed, 2 insertions(+)
(quoted diff) +0 -0

b/meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb

Quoted 4 lines
Quoted 4 lines

meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb FILES:${PN}-lite = "${libdir}/libprotobuf-

Quoted 4 lines

index cc5204de4..354b3213a 100644

meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb +0 -0
@@ -106,6 +106,8 @@ FILES:${PN}-lite = "${libdir}/libprotobuf-

lite${SOLIBS}"

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb +0 -0
   # CMake requires protoc binary to exist in sysroot, even if it

has wrong

architecture.

Quoted 13 lines
Quoted 9 lines

meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb

Quoted 4 lines
   SYSROOT_DIRS += "${bindir}"
meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb +2 -0
+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?

Quoted 4 lines

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.

Quoted 9 lines

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.

Can we at least change the dependency to a recommendation so that it can be avoided via BAD_RECOMMENDATIONS? Because as it is, it penalizes everyone that use protobuf for the case where one provides an SDK with protobuf.

Quoted 8 lines

My suggestion would be to change it to:

# Recommend abseil-cpp so that all its libraries are installed in case

# protobuf is provided as part of an SDK. Everyone else should add
# BAD_RECOMMENDATIONS += "abseil-cpp" to their configuration.
RRECOMMENDS:${PN} = "abseil-cpp"
RRECOMMENDS:${PN}-lite = "abseil-cpp"

I think that's also not the right way to do this. Adding unnecessary stuff to release images to satisfy SDK needs is wrong.

I also wonder if the problem is not at the SDK level.
If you build an sdk, there is explicitly installed package base and additional required dependencies of those packages.
The dependencies may not be complete and fully usable, only their parts sufficient for the explicitly installed stuff is present. Are the sdk users assuming that full abseil-cpp is installed and thus using also parts not needed for protobuf?
The proper solution would be probably to include abseil-cpp explicitly in SDK used in that way.

Peter

Quoted 9 lines
Quoted 5 lines

//Yi

Quoted 3 lines
Quoted 3 lines
   RDEPENDS:${PN}-compiler = "${PN}"
   RDEPENDS:${PN}-dev += "${PN}-compiler"
   RDEPENDS:${PN}-ptest = "bash

${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3-protobuf', '', d)}"

Quoted 1 line
Quoted 1 line

//Peter

//Peter

#12 lore raw

The key problem is that the 'ldd' output does not match what the protobuf's pc says. The automatic library dependency adding thus does not give us a correct result in protobuf's case. As the list is written by protobuf's maintainers, I think we'd better trust them more than the ldd output.

Let's look at a regular package's behavior. Say packageB (libB) rdepends on packageA (libA).
And we want to develop an application linking to libB inside SDK. The generated application will just run fine on target. Because all actual runtime dependencies of libB are on target.

Unfortunately, this is not the case for protobuf and aseil-cpp. Protobuf does NOT have all the runtime dependency it needs. Why they are special? Part of the reason is that they are both kind of development packages, I guess.

Regarding aseil-cpp, as I explained in previous email, its auto splitting is not reasonable.

So I think what we really should do is:
1) split aseil-cpp based on .pc files (parsing its Requires field)
2) parse the protobuf.pc file to get the actual runtime dependencies and add them to RDEPEDNS automatically.

If anyone has concern for the above solution, please let me know. Thanks.

Before the above is done, we need to use RDEPENDS manually.

Regards,
Qi

-----Original Message-----
From: Christian Eggers <[email protected]>
Sent: Monday, December 2, 2024 9:52 PM
To: [email protected]; Zhao, Yi <[email protected]>; Zhao, Yi <[email protected]>; [email protected]; Marko, Peter <[email protected]>
Cc: [email protected]; Chen, Qi <[email protected]>
Subject: Re: [oe] [meta-oe][PATCH 1/2] protobuf: add abseil-cpp to RDEPENDS

Hi Peter,

Quoted 26 lines · Peter

Hello,

Quoted 15 lines

-----Original Message-----
From: Christian Eggers <[email protected]>
Sent: Monday, December 2, 2024 14:39
To: Marko, Peter (FT D EU SK BFS1) <[email protected]>; [email protected]; Yi Zhao <[email protected]>; Yi Zhao <[email protected]>; openembedded- [email protected]
Cc: [email protected]; [email protected]
Subject: Re: [oe] [meta-oe][PATCH 1/2] protobuf: add abseil-cpp to RDEPENDS

Hi Qi,

On Monday, 2 December 2024, 06:35:22 CET, Chen Qi via lists.openembedded.org wrote:

Quoted 8 lines
Quoted 3 lines

Before we rework the abseil-cpp and protobuf recipes, a possible improvement for this patch is that we list the needed libraries in RDEPENDS manually.

my main concern was (as you already may have guessed) not having the full set of absl libraries in my rootfs, as only some of them are required. But I cannot tell which is the best option to achieve this.

Quoted 4 lines

If you want full abseil-cpp in your rootfs, please use IMAGE_INSTALL for that.
Packages should pull only their real dependencies, not something you need for other reasons. You use-case seems to be to develop application with abseil-cpp library but not installing it explicitly. SDK images need to install (or depend on) additional packages compared to release images.

sorry, but I meant it the other way around:

"I do not like having the full set of abseil-cpp libraries in my rootfs only because I use protobuf in my application".

Sorry for the confusion.

regards,
Christian

Quoted 275 lines

Peter

Quoted 270 lines

regards,
Christian

Quoted 12 lines

Regards,
Qi

Quoted 7 lines · Chen Qi via lists.openembedded.org

I'll explain in more details what the problem is and why this patch is correct, given the current status of abseil-cpp recipe.

In protobuf's abseil-cpp.cmake file, there's a hardcoded list of absl targets used by protobuf:
https://github.com/protocolbuffers/protobuf/blob/main/cmake/abse
il-

cpp.cmake#L56

Quoted 30 lines
Quoted 30 lines

This value in turn is parsed and used to replace the @_protobuf_PC_REQUIRES@ in protobuf.pc.cmake.

Here's the generated probobuf.pc file's contents:
"""

$ cat  ../build/protobuf.pc
prefix=/usr
exec_prefix=/usr
libdir=/usr/lib64
includedir=/usr/include

Name: Protocol Buffers
Description: Google's Data Interchange Format
Version: 25.3.0
Requires: absl_absl_check absl_absl_log absl_algorithm absl_base absl_bind_front absl_bits absl_btree absl_cleanup absl_cord absl_core_headers absl_debugging absl_die_if_null absl_dynamic_annotations absl_flags absl_flat_hash_map absl_flat_hash_set absl_function_ref absl_hash absl_layout absl_log_initialize absl_log_severity absl_memory absl_node_hash_map absl_node_hash_set absl_optional absl_span absl_status absl_statusor absl_strings absl_synchronization absl_time absl_type_traits absl_utility absl_variant utf8_range
Libs: -L${libdir} -lprotobuf
Cflags: -I${includedir} -DPROTOBUF_USE_DLLS
Conflicts: protobuf-lite
"""

Quoted 6 lines
Quoted 6 lines

Let me use "absl_hash" and "absl_absl_log" in the above list as examples.

"""

$ find ../../../abseil-cpp/20240116.2/packa
ges-split/ -name "libabsl_hash.so.*"
../../../abseil-cpp/20240116.2/packages-split/libabsl-

hash/usr/lib64/libabsl_hash.so.2401.0.0

Quoted 2 lines
Quoted 2 lines

../../../abseil-cpp/20240116.2/packages-split/abseil-cpp-

dbg/usr/lib64/.debug/libabsl_hash.so.2401.0.0

Quoted 6 lines
Quoted 6 lines
$ find ../../../abseil-cpp/20240116.2/packa
ges-split/ -name "libabsl_absl_log.so.*"
$
"""
Quoted 8 lines
Quoted 8 lines

See? The current package splitting of abseil-cpp does not match what protobuf assumes. And I thinks protobuf's assumption is correct, because there's really a absl_absl_log.pc file generated by abseil-cpp.

And there's the contents and location of absl_absl_log.pc:
"""

$ cat
../../../abseil-cpp/20240116.2/packages-split/abseil-cpp-

dev/usr/lib64/pkgconfig/absl_absl_log.pc

Quoted 33 lines
Quoted 33 lines

prefix=/usr
exec_prefix=${prefix}
libdir=/usr/lib64
includedir=/usr/include

Name: absl_absl_log
Description: Abseil absl_log library
URL: https://abseil.io/
Version: 20240116
Requires: absl_log_internal_log_impl = 20240116
Libs: -L${libdir}
Cflags: -I${includedir} -DNOMINMAX """

And there's the contents for the absl_log_internal_log_impl:
"""

$ cat ../../../abseil-cpp/20240116.2/packag
es-split/abseil-cpp-dev/usr/lib64/pkgconfig/absl_log_internal_lo
g_impl.pc
prefix=/usr
exec_prefix=${prefix}
libdir=/usr/lib64
includedir=/usr/include

Name: absl_log_internal_log_impl
Description: Abseil log_internal_log_impl library
URL: https://abseil.io/
Version: 20240116
Requires: absl_log_internal_conditions = 20240116, absl_log_internal_message = 20240116, absl_log_internal_strip = 20240116, absl_absl_vlog_is_on = 20240116
Libs: -L${libdir}
Cflags: -I${includedir} -DNOMINMAX """

Quoted 6 lines
Quoted 6 lines

We can then find the absl_log_internal_conditions library:
"""

$ find ../../../abseil-cpp/20240116.2/packages-split/ -name 
"*absl_log_internal_message*"
../../../abseil-cpp/20240116.2/packages-split/libabsl-log-intern
al-

message/usr/lib64/libabsl_log_internal_message.so.2401.0.0

Quoted 2 lines
Quoted 2 lines

../../../abseil-cpp/20240116.2/packages-split/abseil-cpp-

dev/usr/lib64/libabsl_log_internal_message.so

Quoted 2 lines
Quoted 2 lines

../../../abseil-cpp/20240116.2/packages-split/abseil-cpp-

dev/usr/lib64/pkgconfig/absl_log_internal_message.pc

Quoted 2 lines
Quoted 2 lines

../../../abseil-cpp/20240116.2/packages-split/abseil-cpp-

dbg/usr/lib64/.debug/libabsl_log_internal_message.so.2401.0.0

Quoted 14 lines
Quoted 14 lines

"""

What does all above mean? It means that abseil-cpp is not splitted reasonably. This could be proven by the absl_absl_log.pc file as described above.

So, given the current situation of abseil-cpp, Yi's solution is
correct. Before abseil-cpp is re-splitted according to its pc
files, which then could possibly lead to automatic parsing of
the protobuf.pc file to add extra RDEPENDS automatically in
protobuf recipe, we need to have Yi's solution. And we need to
use RDEEPNDS instead of RRECOMMENDS (see the 'Requires' directive in corresponding .pc files).

Quoted 6 lines
Quoted 6 lines

Regards,
Qi

Quoted 2 lines · Peter Marko via lists.openembedded.org
Quoted 2 lines

-----Original Message-----
From: [email protected]

<openembedded-

Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines

[email protected]> On Behalf Of Peter Kjellerstedt via lists.openembedded.org
Sent: Tuesday, October 1, 2024 14:00
To: Yi Zhao <[email protected]>; Yi Zhao <[email protected]>
Cc: [email protected]
Subject: Re: [oe] [meta-oe][PATCH 1/2] protobuf: add abseil-cpp to RDEPENDS

Quoted 4 lines

-----Original Message-----
From: Yi Zhao <[email protected]>
Sent: den 25 september 2024 04:17
To: Peter Kjellerstedt <[email protected]>; Yi Zhao

<[email protected]>

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines

Cc: [email protected]
Subject: Re: [oe] [meta-oe][PATCH 1/2] protobuf: add abseil-cpp to

RDEPENDS

Quoted 4 lines · Peter Kjellerstedt
Quoted 2 lines
Quoted 2 lines

-----Original Message-----
From: [email protected]

<openembedded-

Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines

[email protected]> On Behalf Of Yi Zhao

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

Sent: den 22 september 2024 09:36
To: [email protected]
Subject: [oe] [meta-oe][PATCH 1/2] protobuf: add abseil-cpp to

RDEPENDS

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

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.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

[1] https://git.openembedded.org/meta-

openembedded/commit/?id=dd6421e65eb75c35a904f4b487ba022075035

Quoted 85 lines
Quoted 83 lines
Quoted 79 lines
Quoted 43 lines

ecc

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
---
   meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb | 2 ++
   1 file changed, 2 insertions(+)
(quoted diff) +0 -0

a/meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb

b/meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

index cc5204de4..354b3213a 100644

meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb +0 -0
@@ -106,6 +106,8 @@ FILES:${PN}-lite = 

"${libdir}/libprotobuf-

lite${SOLIBS}"

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

# CMake requires protoc binary to exist in sysroot, even
if it has wrong

architecture.

Quoted 13 lines
Quoted 9 lines

meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb

Quoted 4 lines
   SYSROOT_DIRS += "${bindir}"
meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb +2 -0
+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?

Quoted 4 lines

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.

Quoted 7 lines

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.

Can we at least change the dependency to a recommendation so that it can be avoided via BAD_RECOMMENDATIONS? Because as it is, it penalizes everyone that use protobuf for the case where one provides an SDK with protobuf.

Quoted 8 lines

My suggestion would be to change it to:

# Recommend abseil-cpp so that all its libraries are installed
in case # protobuf is provided as part of an SDK. Everyone
else should add # BAD_RECOMMENDATIONS += "abseil-cpp" to their configuration. RRECOMMENDS:${PN} = "abseil-cpp"
RRECOMMENDS:${PN}-lite = "abseil-cpp"

I think that's also not the right way to do this. Adding unnecessary stuff to release images to satisfy SDK needs is wrong.

I also wonder if the problem is not at the SDK level.
If you build an sdk, there is explicitly installed package base and additional required dependencies of those packages. The dependencies may not be complete and fully usable, only their parts sufficient for the explicitly installed stuff is present. Are the sdk users assuming that full abseil-cpp is installed and thus using also parts not needed for protobuf?
The proper solution would be probably to include abseil-cpp explicitly in SDK used in that way.

Peter

Quoted 9 lines
Quoted 5 lines

//Yi

Quoted 3 lines
Quoted 3 lines
   RDEPENDS:${PN}-compiler = "${PN}"
   RDEPENDS:${PN}-dev += "${PN}-compiler"
   RDEPENDS:${PN}-ptest = "bash

${@bb.utils.contains('PACKAGECONFIG', 'python',
'python3-protobuf', '', d)}"

Quoted 1 line
Quoted 1 line

//Peter

//Peter

#13 lore raw
In reply to Christian Eggers

I have now sent revert as part of a larger refactoring of protobuf recipes.
https://lists.openembedded.org/g/openembedded-devel/message/115221

Peter

Quoted 332 lines

-----Original Message-----
From: Christian Eggers <[email protected]>
Sent: Monday, December 2, 2024 14:52
To: [email protected]; Yi Zhao <[email protected]>; Yi Zhao <[email protected]>; [email protected]; Marko, Peter (FT D EU SK BFS1) <[email protected]>
Cc: [email protected]; [email protected]
Subject: Re: [oe] [meta-oe][PATCH 1/2] protobuf: add abseil-cpp to RDEPENDS

Hi Peter,

Quoted 21 lines · Peter

Hello,

Quoted 19 lines

-----Original Message-----
From: Christian Eggers <[email protected]>
Sent: Monday, December 2, 2024 14:39
To: Marko, Peter (FT D EU SK BFS1) <[email protected]>; [email protected]; Yi Zhao <[email protected]>; Yi Zhao <[email protected]>; openembedded- [email protected]
Cc: [email protected]; [email protected]
Subject: Re: [oe] [meta-oe][PATCH 1/2] protobuf: add abseil-cpp to RDEPENDS

Hi Qi,

Quoted 3 lines · Chen Qi via lists.openembedded.org

Before we rework the abseil-cpp and protobuf recipes, a possible improvement for this patch is that we list the needed libraries in RDEPENDS manually.

Quoted 7 lines
Quoted 4 lines

my main concern was (as you already may have guessed) not having the full set of
absl libraries in my rootfs, as only some of them are required. But I cannot tell which is the best option to achieve this.

If you want full abseil-cpp in your rootfs, please use IMAGE_INSTALL for that. Packages should pull only their real dependencies, not something you need for

other reasons.

Quoted 1 line

You use-case seems to be to develop application with abseil-cpp library but not

installing it explicitly.

Quoted 1 line

SDK images need to install (or depend on) additional packages compared to

release images.
sorry, but I meant it the other way around:

"I do not like having the full set of abseil-cpp libraries in my rootfs only because I use protobuf in my application".

Sorry for the confusion.

regards,
Christian

Quoted 273 lines

Peter

Quoted 268 lines

regards,
Christian

Quoted 11 lines

Regards,
Qi

Quoted 6 lines · Chen Qi via lists.openembedded.org

I'll explain in more details what the problem is and why this patch is correct, given the current status of abseil-cpp recipe.

In protobuf's abseil-cpp.cmake file, there's a hardcoded list of absl targets used by protobuf:
https://github.com/protocolbuffers/protobuf/blob/main/cmake/abseil-

cpp.cmake#L56

Quoted 30 lines
Quoted 30 lines

This value in turn is parsed and used to replace the @_protobuf_PC_REQUIRES@ in protobuf.pc.cmake.

Here's the generated probobuf.pc file's contents:
"""

$ cat  ../build/protobuf.pc
prefix=/usr
exec_prefix=/usr
libdir=/usr/lib64
includedir=/usr/include

Name: Protocol Buffers
Description: Google's Data Interchange Format
Version: 25.3.0
Requires: absl_absl_check absl_absl_log absl_algorithm absl_base absl_bind_front absl_bits absl_btree absl_cleanup absl_cord absl_core_headers absl_debugging absl_die_if_null absl_dynamic_annotations absl_flags absl_flat_hash_map absl_flat_hash_set absl_function_ref absl_hash absl_layout absl_log_initialize absl_log_severity absl_memory absl_node_hash_map absl_node_hash_set absl_optional absl_span absl_status absl_statusor absl_strings absl_synchronization absl_time absl_type_traits absl_utility absl_variant utf8_range
Libs: -L${libdir} -lprotobuf
Cflags: -I${includedir} -DPROTOBUF_USE_DLLS
Conflicts: protobuf-lite
"""

Quoted 6 lines
Quoted 6 lines

Let me use "absl_hash" and "absl_absl_log" in the above list as examples.

"""

$ find ../../../abseil-cpp/20240116.2/packa
ges-split/ -name "libabsl_hash.so.*"
../../../abseil-cpp/20240116.2/packages-split/libabsl-

hash/usr/lib64/libabsl_hash.so.2401.0.0

Quoted 2 lines
Quoted 2 lines

../../../abseil-cpp/20240116.2/packages-split/abseil-cpp-

dbg/usr/lib64/.debug/libabsl_hash.so.2401.0.0

Quoted 6 lines
Quoted 6 lines
$ find ../../../abseil-cpp/20240116.2/packa
ges-split/ -name "libabsl_absl_log.so.*"
$
"""
Quoted 8 lines
Quoted 8 lines

See? The current package splitting of abseil-cpp does not match what protobuf assumes. And I thinks protobuf's assumption is correct, because there's really a absl_absl_log.pc file generated by abseil-cpp.

And there's the contents and location of absl_absl_log.pc:
"""

$ cat
../../../abseil-cpp/20240116.2/packages-split/abseil-cpp-

dev/usr/lib64/pkgconfig/absl_absl_log.pc

Quoted 34 lines
Quoted 34 lines

prefix=/usr
exec_prefix=${prefix}
libdir=/usr/lib64
includedir=/usr/include

Name: absl_absl_log
Description: Abseil absl_log library
URL: https://abseil.io/
Version: 20240116
Requires: absl_log_internal_log_impl = 20240116
Libs: -L${libdir}
Cflags: -I${includedir} -DNOMINMAX
"""

And there's the contents for the absl_log_internal_log_impl:
"""

$ cat ../../../abseil-cpp/20240116.2/packag
es-split/abseil-cpp-dev/usr/lib64/pkgconfig/absl_log_internal_log_impl.pc
prefix=/usr
exec_prefix=${prefix}
libdir=/usr/lib64
includedir=/usr/include

Name: absl_log_internal_log_impl
Description: Abseil log_internal_log_impl library
URL: https://abseil.io/
Version: 20240116
Requires: absl_log_internal_conditions = 20240116, absl_log_internal_message = 20240116, absl_log_internal_strip = 20240116, absl_absl_vlog_is_on = 20240116
Libs: -L${libdir}
Cflags: -I${includedir} -DNOMINMAX
"""

Quoted 5 lines
Quoted 5 lines

We can then find the absl_log_internal_conditions library:
"""

$ find ../../../abseil-cpp/20240116.2/packages-split/ -name
"*absl_log_internal_message*"
../../../abseil-cpp/20240116.2/packages-split/libabsl-log-internal-

message/usr/lib64/libabsl_log_internal_message.so.2401.0.0

Quoted 2 lines
Quoted 2 lines

../../../abseil-cpp/20240116.2/packages-split/abseil-cpp-

dev/usr/lib64/libabsl_log_internal_message.so

Quoted 2 lines
Quoted 2 lines

../../../abseil-cpp/20240116.2/packages-split/abseil-cpp-

dev/usr/lib64/pkgconfig/absl_log_internal_message.pc

Quoted 2 lines
Quoted 2 lines

../../../abseil-cpp/20240116.2/packages-split/abseil-cpp-

dbg/usr/lib64/.debug/libabsl_log_internal_message.so.2401.0.0

Quoted 14 lines
Quoted 14 lines

"""

What does all above mean? It means that abseil-cpp is not splitted reasonably. This could be proven by the absl_absl_log.pc file as described above.

So, given the current situation of abseil-cpp, Yi's solution is correct. Before abseil-cpp is re-splitted according to its pc files, which then could possibly lead to automatic parsing of the protobuf.pc file to add extra RDEPENDS automatically in protobuf recipe, we need to have Yi's solution. And we need to use RDEEPNDS instead of RRECOMMENDS (see the 'Requires' directive in corresponding .pc files).

Quoted 6 lines
Quoted 6 lines

Regards,
Qi

Quoted 2 lines · Peter Marko via lists.openembedded.org
Quoted 2 lines

-----Original Message-----
From: [email protected]

<openembedded-

Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines

[email protected]> On Behalf Of Peter Kjellerstedt via lists.openembedded.org
Sent: Tuesday, October 1, 2024 14:00
To: Yi Zhao <[email protected]>; Yi Zhao <[email protected]>
Cc: [email protected]
Subject: Re: [oe] [meta-oe][PATCH 1/2] protobuf: add abseil-cpp to RDEPENDS

Quoted 4 lines

-----Original Message-----
From: Yi Zhao <[email protected]>
Sent: den 25 september 2024 04:17
To: Peter Kjellerstedt <[email protected]>; Yi Zhao

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

<[email protected]>

Quoted 2 lines

Cc: [email protected]
Subject: Re: [oe] [meta-oe][PATCH 1/2] protobuf: add abseil-cpp to

RDEPENDS

Quoted 4 lines · Peter Kjellerstedt
Quoted 2 lines
Quoted 2 lines

-----Original Message-----
From: [email protected]

<openembedded-

Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines

[email protected]> On Behalf Of Yi Zhao

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Sent: den 22 september 2024 09:36
To: [email protected]
Subject: [oe] [meta-oe][PATCH 1/2] protobuf: add abseil-cpp to

RDEPENDS

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

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.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

[1] https://git.openembedded.org/meta-

openembedded/commit/?id=dd6421e65eb75c35a904f4b487ba022075035

Quoted 85 lines
Quoted 83 lines
Quoted 79 lines
Quoted 43 lines

ecc

Quoted 6 lines
Quoted 6 lines

Review

Quoted 6 lines
---
   meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb | 2 ++
   1 file changed, 2 insertions(+)
(quoted diff) +0 -0

b/meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb

Quoted 4 lines
Quoted 4 lines

meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb FILES:${PN}-lite = "${libdir}/libprotobuf-

Quoted 4 lines

index cc5204de4..354b3213a 100644

meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb +0 -0
@@ -106,6 +106,8 @@ FILES:${PN}-lite = "${libdir}/libprotobuf-

lite${SOLIBS}"

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb +0 -0
   # CMake requires protoc binary to exist in sysroot, even if it

has wrong

architecture.

Quoted 13 lines
Quoted 9 lines

meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb

Quoted 4 lines
   SYSROOT_DIRS += "${bindir}"
meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb +2 -0
+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?

Quoted 4 lines

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.

Quoted 9 lines

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.

Can we at least change the dependency to a recommendation so that it can be avoided via BAD_RECOMMENDATIONS? Because as it is, it penalizes everyone that use protobuf for the case where one provides an SDK with protobuf.

Quoted 8 lines

My suggestion would be to change it to:

# Recommend abseil-cpp so that all its libraries are installed in case

# protobuf is provided as part of an SDK. Everyone else should add
# BAD_RECOMMENDATIONS += "abseil-cpp" to their configuration.
RRECOMMENDS:${PN} = "abseil-cpp"
RRECOMMENDS:${PN}-lite = "abseil-cpp"

I think that's also not the right way to do this. Adding unnecessary stuff to release images to satisfy SDK needs is wrong.

I also wonder if the problem is not at the SDK level.
If you build an sdk, there is explicitly installed package base and additional required dependencies of those packages.
The dependencies may not be complete and fully usable, only their parts sufficient for the explicitly installed stuff is present. Are the sdk users assuming that full abseil-cpp is installed and thus using also parts not needed for protobuf?
The proper solution would be probably to include abseil-cpp explicitly in SDK used in that way.

Peter

Quoted 9 lines
Quoted 5 lines

//Yi

Quoted 3 lines
Quoted 3 lines
   RDEPENDS:${PN}-compiler = "${PN}"
   RDEPENDS:${PN}-dev += "${PN}-compiler"
   RDEPENDS:${PN}-ptest = "bash

${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3-protobuf', '', d)}"

Quoted 1 line
Quoted 1 line

//Peter

//Peter

#14 lore raw
In reply to Yi Zhao

Hi Khem,

I wonder why this patch has been applied although there were concerns about it:

regards,
Christian

Quoted 28 lines · Yi Zhao

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

---
 meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb | 2 ++
 1 file changed, 2 insertions(+)
meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb +2 -0
index cc5204de4..354b3213a 100644
@@ -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)}"
Quoted 4 lines · Peter Kjellerstedt

Can we at least change the dependency to a recommendation so that it can be avoided via BAD_RECOMMENDATIONS? Because as it is, it penalizes everyone that use protobuf for the case where one provides an SDK with protobuf.

Quoted 2 lines · Peter Marko via lists.openembedded.org

I think that's also not the right way to do this.
Adding unnecessary stuff to release images to satisfy SDK needs is wrong.

#15 lore raw

Hmm I thought I gave some feedback to author but there is no follow up can you send a revert or perhaps the recommends suggestion

Quoted 59 lines · Christian Eggers

Hi Khem,

I wonder why this patch has been applied although there were concerns about it:

regards,
Christian

Quoted 8 lines · Yi Zhao

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

Review

Quoted 7 lines
---
 meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb | 2 ++
 1 file changed, 2 insertions(+)
(quoted diff) +0 -0

b/meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb

meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb FILES:${PN}-lite =

Quoted 4 lines

index cc5204de4..354b3213a 100644

meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb +0 -0
@@ -106,6 +106,8 @@ FILES:${PN}-lite =

"${libdir}/libprotobuf-lite${SOLIBS}"

meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb FILES:${PN}-lite = · line 106

Quoted 1 line
meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb +0 -0
 # CMake requires protoc binary to exist in sysroot, even if it has

wrong architecture.

meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb FILES:${PN}-lite = "${libdir}/libprotobuf-lite${SOLIBS}"

Quoted 7 lines
meta-oe/recipes-devtools/protobuf/protobuf_4.25.4.bb +2 -0
 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)}"

Quoted 1 line
Quoted 4 lines · Peter Kjellerstedt

Can we at least change the dependency to a recommendation so that it can be avoided via BAD_RECOMMENDATIONS? Because as it is, it penalizes everyone that use protobuf for the case where one provides an SDK with protobuf.

2On Tuesday, 1 October 2024, 14:42:04 CET, Peter Marko via

Quoted 2 lines · lists.openembedded.org

I think that's also not the right way to do this.
Adding unnecessary stuff to release images to satisfy SDK needs is wrong.