Hi,

On Thu, 28 Sept 2023 at 17:03, Vyacheslav Yurkov <[email protected]> wrote:
>
> I think I was the one who originally removed protoc, because it's not useful 
> in the sysroot. Even if you satisfy cmake so it can find protoc target, the 
> next step is that it will try to use it, which will obviously fail.
>
> The only reason to put it on the target sysroot would be if you really going 
> to use it _on the target_. But I guess this can be done via bbappend in the 
> user layer.

The files is properly installed when you set PACKAGECONFIG to compiler.
FILES:${PN}-compiler = "${bindir} ${libdir}/libprotoc${SOLIBS}"

Which is done when by default for native
PACKAGECONFIG:class-native ?= "compiler"

If you really need it in the target then set the package config
"compiler" for the target recipe.

But mixing architecture in the sysroot is a Hack and this would lead
to undefined behavior regarding the arch / tune you select.

Regards
Clement


>
> Vyacheslav
>
> On 27.09.2023 07:19, Samuli Piippo wrote:
>
> Re-applying this patch as it got removed in 
> https://patchwork.yoctoproject.org/project/oe/patch/[email protected]/
>
> On Wed, 27 Sept 2023 at 08:11, Samuli Piippo via lists.openembedded.org 
> <[email protected]> wrote:
>>
>> From: Samuli Piippo <[email protected]>
>>
>> If protoc is enabled for the build, recipes using protobuf will
>> fail when protoc is not available in the recipe sysroot:
>>
>> |   The imported target "protobuf::protoc" references the file
>> |
>> |      
>> ".../recipe-sysroot/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr/bin/protoc-3.21.5.0"
>> |
>> |   but this file does not exist.  Possible reasons include:
>> |
>> |   * The file was deleted, renamed, or moved to another location.
>> |
>> |   * An install or uninstall procedure did not complete successfully.
>> |
>> |   * The installation package was faulty and contained
>> |
>> |      
>> ".../recipe-sysroot/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/usr/lib/cmake/protobuf/protobuf-targets.cmake"
>> |
>> |   but not all the files it references.
>>
>> Use SYSROOT_DIRS to stage the binary to sysroot so it's always
>> available for other recipes.
>>
>> Signed-off-by: Samuli Piippo <[email protected]>
>> Signed-off-by: Khem Raj <[email protected]>
>> ---
>>  meta-oe/recipes-devtools/protobuf/protobuf_3.21.12.bb | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/meta-oe/recipes-devtools/protobuf/protobuf_3.21.12.bb 
>> b/meta-oe/recipes-devtools/protobuf/protobuf_3.21.12.bb
>> index d95e1c20f..06b21a0d6 100644
>> --- a/meta-oe/recipes-devtools/protobuf/protobuf_3.21.12.bb
>> +++ b/meta-oe/recipes-devtools/protobuf/protobuf_3.21.12.bb
>> @@ -92,6 +92,9 @@ PACKAGE_BEFORE_PN = "${PN}-compiler ${PN}-lite"
>>  FILES:${PN}-compiler = "${bindir} ${libdir}/libprotoc${SOLIBS}"
>>  FILES:${PN}-lite = "${libdir}/libprotobuf-lite${SOLIBS}"
>>
>> +# CMake requires binaries to exist in sysroot, even if they have wrong 
>> architecture.
>> +SYSROOT_DIRS += "${bindir}"
>> +
>>  RDEPENDS:${PN}-compiler = "${PN}"
>>  RDEPENDS:${PN}-dev += "${PN}-compiler"
>>  RDEPENDS:${PN}-ptest = "bash ${@bb.utils.contains('PACKAGECONFIG', 
>> 'python', 'python3-protobuf', '', d)}"
>> --
>> 2.25.1
>>
>>
>>
>>
>
>
> 
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#105226): 
https://lists.openembedded.org/g/openembedded-devel/message/105226
Mute This Topic: https://lists.openembedded.org/mt/101612304/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to