openembedded / meta-openembedded

MIT License
415 stars 719 forks source link

opentelemetry-cpp: unable to add library to image rootfs #889

Closed graceagrace closed 1 month ago

graceagrace commented 1 month ago

Hi there,

I am working off the latest opentelemetry-cpp recipe on the master branch. I would like to incorporate the opentelemetry libraries into an image, but encounter the following error when adding this package to my image using IMAGE_INSTALL:append:

User-Agent: falling back to 'libdnf': could not detect OS or basearch
repo: using cache for: oe-repo
oe-repo: using metadata from Sat 19 Oct 2024 12:10:53 AM UTC.
Last metadata expiration check: 0:00:01 ago on Mon 21 Oct 2024 03:13:10 PM UTC.
No match for argument: opentelemetry-cpp
Error: Unable to find a match: opentelemetry-cpp

I have tried adding opentelemetry-cpp, opentelemetry-cpp-dev, and opentelemetry-cpp-staticdev, all without success. Can anyone point me in the right direction? I suspect I need to append something to do_install(), but I'm not familiar enough with the inner workings of opentelemetry to know what the right paths are.

kraj commented 1 month ago

Check what ipks are being generated I think the reason is perhaps that this ipk is empty and hence not generated

what you add to image is usually not the recipe name but the output package name and a recipe can build more than one packages

graceagrace commented 1 month ago

I was able to resolve the issue by adding the following line to the recipe: ALLOW_EMPTY:${PN} = "1" Now, I can include the header and static libraries (opentelemetry-cpp-dev and opentelemetry-cpp-staticdev) in my rootfs, which is what I was hoping for. Thank you!

kraj commented 1 month ago

@graceagrace I think thats perhaps less than ideal solution, perhaps add RDEPENDS:${PN}-dev = "" in the recipe and add the needed -dev package to image might be something thats done in other recipes as well e.g. see meta-oe/recipes-devtools/valijson/valijson_1.0.3.bb