[meta-oe] Introduce recipe for sdbus-c++ library and its tools#137
[meta-oe] Introduce recipe for sdbus-c++ library and its tools#137sangelovic wants to merge 1 commit intoopenembedded:masterfrom
Conversation
|
Hello, thanks for comments, and sorry for coming back to this after longer time. I was busy, but now is the time. I addressed your comments and at the same time bumped library version from v0.7.1 to v0.7.2 which contains an important fix. So the recipes are renamed. Please re-review... Thanks a lot! |
thanks for reworking on it. Can you squash all the commits into a single commit and upload again please |
9e9b5ba to
10b89cf
Compare
Done. |
| inherit cmake pkgconfig systemd ptest python3native | ||
|
|
||
| DEPENDS += "expat ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', 'meson-native ninja-native git-native gperf-native gettext-native util-linux glibc libcap', d)}" | ||
| RDEPENDS_${PN} = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'libsystemd', 'glibc libcap', d)}" |
There was a problem hiding this comment.
I think hardcoding dependency on 'glibc' is not right. Did you mean something else here ?
There was a problem hiding this comment.
In this case sdbus-c++ build-depends and runtime-depends on librt library, which is AFAIK part of glibc. Do you have different suggestion in this regard?
There was a problem hiding this comment.
Librt is provided by c library and is not Glibc specific secondly dependency on Glibc are automatically added and are not required to be explicitly added
There was a problem hiding this comment.
So can I just remove glibc from DEPENDS and RDEPENDS?
There was a problem hiding this comment.
librt is provided by c library, but isn't glibc an implementation of c library for Linuxes?
There was a problem hiding this comment.
glibc is one of many, there is musl, there uclibc and maybe more. in OE we actively support musl and glibc, so hardcoding a libc dependency is not preferred unless its absolutely required then also we use COMPATIBLE_HOST variable to control the recipes for targets
There was a problem hiding this comment.
OK, glibc was removed.
|
|
||
| inherit cmake pkgconfig systemd ptest python3native | ||
|
|
||
| DEPENDS += "expat ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', 'meson-native ninja-native git-native gperf-native gettext-native util-linux glibc libcap', d)}" |
There was a problem hiding this comment.
I think hardcoding dependency on 'glibc' is not right. Did you mean something else here ?
and I dont understand why these dependencies are conditional on systemd. They should be added
in general.
There was a problem hiding this comment.
Things are conditional because of flexibility. sdbus-c++ has two modes of building. One is when entire systemd ecosystem is available in the system. Then libsystemd shared library, the library with lower level D-Bus C implementation which sdbus-c++ depends on, is available, and will be used. But sdbus-c++ provides flexibility to be used as a self-contained lib on non-systemd systems (where there is no libsystemd shared library) as well. In that case, sdbus-c++ build builds just the small needed part of entire systemd and incorporates it as part of sdbus-c++ lib, making sdbus-c++ independent of systemd. Hence this conditional logic in the recipe which checks whether systemd feature is on or off. The user of yocto doesn't care, they build sdbus-c++ into their OS and it works perfectly whether or not systemd ecosystem is present.
There was a problem hiding this comment.
Regarding glibc, see previous comment.
There was a problem hiding this comment.
When sdbus-c++ needs to build that sd-bus part of systemd, which is in libsystemd, it needs all those additional deps, like meson-native ninja-native libpcap etc.
There was a problem hiding this comment.
Okay and to be clear these dependencies are not needed when building without systemd
There was a problem hiding this comment.
Okay and to be clear these dependencies are not needed when building without systemd
Yes, when building sdbus-c++ in a system where systemd feature is turned on (systemd is present), these dependencies are not selected, instead simply systemd dependency is selected.
| SECTION = "libs" | ||
|
|
||
| LICENSE = "LGPLv2.1" | ||
| LIC_FILES_CHKSUM = "file://${WORKDIR}/sdbus-cpp-${PV}/COPYING;md5=1803fa9c2c3ce8cb06b4861d75310742" |
There was a problem hiding this comment.
You dont need ${WORKDIR}/sdbus-cpp-${PV}/ here
| inherit cmake native | ||
|
|
||
| DEPENDS += "expat" | ||
| RDEPENDS_${PN} = "expat" |
There was a problem hiding this comment.
we only need this rdep it if tools are doing dlopen on libexpat, otherwise, shlib tool will automatically pick it up
| EXTRA_OECMAKE = "-DBUILD_CODE_GEN=ON \ | ||
| -DBUILD_DOC=ON \ | ||
| -DBUILD_DOXYGEN_DOC=OFF \ | ||
| ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '-DBUILD_LIBSYSTEMD=OFF', '-DBUILD_LIBSYSTEMD=ON', d)} \ |
There was a problem hiding this comment.
Use PACKAGECONFIG for this and move all extra build-time and runtime dependencies for libsystemd to PACKAGECONFIG.
There was a problem hiding this comment.
Done. Can you please review whether I've done that properly?
|
|
||
| # Allow CMake to use git on the host machine | ||
| OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "BOTH" | ||
| # Ninja is the default CMake generator in Yocto now, so let's set Unix Makefiles explicitly |
There was a problem hiding this comment.
Please say why, are the generated Makefiles incompatible with Ninja?
There was a problem hiding this comment.
When building the recipe with Ninja, I get: ninja: error: 'libsystemd-v242/src/LibsystemdBuildProject-build/libsystemd.a', needed by 'libsdbus-c++.so.0.7.2', missing and no known rule to make it.
sdbus-c++ uses ExternalProject feature of CMake and builds libsystemd using that. This is where it doesn't work with Ninja out of the box.
|
I addressed all your comments, please check... Is it OK now? |
|
please squash all into single commit and push again |
f70a3fd to
f9de9cb
Compare
Done. |
|
here is new error |
|
What do logs
at TOPDIR/build/tmp/work/aarch64-yoe-linux-musl/sdbus-c++/0.7.2-r0/build/libsystemd-v242/src/LibsystemdBuildProject-stamp/LibsystemdBuildProject-configure-*.log
say?
…On Tue, Jul 23, 2019, 16:28 Khem Raj ***@***.***> wrote:
here is new error
https://errors.yoctoproject.org/Errors/Details/253801/
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#137?email_source=notifications&email_token=ABM3OUWZJIDRMDIBGNH6EUDQA4IPJA5CNFSM4HXHJPSKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2TJPWY#issuecomment-514234331>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABM3OUTKTZOMQPOLOVC6NR3QA4IPJANCNFSM4HXHJPSA>
.
|
|
|
|
Thanks a lot. Would you please also paste the content
of /mnt/a/yoe/build/tmp/work/aarch64-yoe-linux-musl/sdbus-c++/0.7.2-r0/build/libsystemd-v242/src/LibsystemdBuildProject-build/meson-logs/meson-log.txt
here? That should be enough for me to start investigating the issue.
…On Tue, Jul 23, 2019, 17:55 Khem Raj ***@***.***> wrote:
`
The Meson build system
Version: 0.50.1
Source dir:
/mnt/a/yoe/build/tmp/work/aarch64-yoe-linux-musl/sdbus-c++/0.7.2-r0/build/libsystemd-v242/src/LibsystemdBuildProject
Build dir:
/mnt/a/yoe/build/tmp/work/aarch64-yoe-linux-musl/sdbus-c++/0.7.2-r0/build/libsystemd-v242/src/LibsystemdBuildProject-build
Build type: cross build
Project name: systemd
Project version: 242
Appending CFLAGS from environment: ' -O2 -pipe -g
-feliminate-unused-debug-types
-fmacro-prefix-map=/mnt/a/yoe/build/tmp/work/aarch64-yoe-linux-musl/sdbus-c++/0.7.2-r0=/usr/src/debug/sdbus-c++/0.7.2-r0
-fdebug-prefix-map=/mnt/a/yoe/build/tmp/work/aarch64-yoe-linux-musl/sdbus-c++/0.7.2-r0=/usr/src/debug/sdbus-c++/0.7.2-r0
-fdebug-prefix-map=/mnt/a/yoe/build/tmp/work/aarch64-yoe-linux-musl/sdbus-c++/0.7.2-r0/recipe-sysroot=
-fdebug-prefix-map=/mnt/a/yoe/build/tmp/work/aarch64-yoe-linux-musl/sdbus-c++/0.7.2-r0/recipe-sysroot-native=
-mcpu=cortex-a53+crc --rtlib=compiler-rt --stdlib=libc++ -mlittle-endian
-Wno-error=unused-command-line-argument -Qunused-arguments
-fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
-Werror=format-security
--sysroot=/mnt/a/yoe/build/tmp/work/aarch64-yoe-linux-musl/sdbus-c++/0.7.2-r0/recipe-sysroot'
Appending LDFLAGS from environment: '-Wl,-O1 -Wl,--hash-style=gnu
-Wl,--as-needed -fstack-protector-strong -Wl,-z,relro,-z,now'
Appending CFLAGS from environment: ' -O2 -pipe -g
-feliminate-unused-debug-types
-fmacro-prefix-map=/mnt/a/yoe/build/tmp/work/aarch64-yoe-linux-musl/sdbus-c++/0.7.2-r0=/usr/src/debug/sdbus-c++/0.7.2-r0
-fdebug-prefix-map=/mnt/a/yoe/build/tmp/work/aarch64-yoe-linux-musl/sdbus-c++/0.7.2-r0=/usr/src/debug/sdbus-c++/0.7.2-r0
-fdebug-prefix-map=/mnt/a/yoe/build/tmp/work/aarch64-yoe-linux-musl/sdbus-c++/0.7.2-r0/recipe-sysroot=
-fdebug-prefix-map=/mnt/a/yoe/build/tmp/work/aarch64-yoe-linux-musl/sdbus-c++/0.7.2-r0/recipe-sysroot-native=
-mcpu=cortex-a53+crc --rtlib=compiler-rt --stdlib=libc++ -mlittle-endian
-Wno-error=unused-command-line-argument -Qunused-arguments
-fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
-Werror=format-security
--sysroot=/mnt/a/yoe/build/tmp/work/aarch64-yoe-linux-musl/sdbus-c++/0.7.2-r0/recipe-sysroot'
Appending LDFLAGS from environment: '-Wl,-O1 -Wl,--hash-style=gnu
-Wl,--as-needed -fstack-protector-strong -Wl,-z,relro,-z,now'
meson.build:3:0: ERROR: Could not invoke sanity test executable: [Errno 8]
Exec format error:
'/mnt/a/yoe/build/tmp/work/aarch64-yoe-linux-musl/sdbus-c++/0.7.2-r0/build/libsystemd-v242/src/LibsystemdBuildProject-build/meson-private/sanitycheckc.exe'.
A full log can be found at
/mnt/a/yoe/build/tmp/work/aarch64-yoe-linux-musl/sdbus-c++/0.7.2-r0/build/libsystemd-v242/src/LibsystemdBuildProject-build/meson-logs/meson-log.txt
`
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#137?email_source=notifications&email_token=ABM3OUSI3FM7JIYHVMNC5GLQA4SWDA5CNFSM4HXHJPSKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2TSWEI#issuecomment-514272017>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABM3OURZYHXL2UPTPOT35NLQA4SWDANCNFSM4HXHJPSA>
.
|
|
|
do you plan to submit a new version with fixes |
|
Yes, I do. (Just didn't have much time for it at this recent summer time...)
…On Wed, Aug 14, 2019, 07:02 Khem Raj ***@***.***> wrote:
do you plan to submit a new version with fixes
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#137?email_source=notifications&email_token=ABM3OURYITOA2NSOEZAREDLQEOGVHA5CNFSM4HXHJPSKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4HWHKI#issuecomment-521102249>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABM3OUVN4JOGD7PE76QOLB3QEOGVHANCNFSM4HXHJPSA>
.
|
52eb608 to
d8d8252
Compare
|
Hi Khem, I finally got time to address sdbus-c++ recipe review comments and ARM build error. I have significantly refactored the recipe. Now systemd library is built by a specific auxiliary recipe of its own - Hopefully we are getting to final accepted state of sdbus-c++ recipes. Please could you re-review? |
|
Strange. I need to reproduce this locally, I have no experience with
raspberry target. How can I reproduce this? What settings shall I apply in
my local yocto build? Thank you...
…On Thu, Oct 17, 2019, 05:26 Khem Raj ***@***.***> wrote:
https://errors.yoctoproject.org/Errors/Details/273663/
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#137?email_source=notifications&email_token=ABM3OUX3YEBD3PGZZXDO2PTQO7LN3A5CNFSM4HXHJPSKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBOT5ZQ#issuecomment-542981862>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABM3OUQT64GYP7H46U2PHELQO7LN3ANCNFSM4HXHJPSA>
.
|
|
I tested ARM and x86 platforms, these work fine...
Missing printf.h is a strange problem. Given that an official release of
systemd is being built...
…On Thu, Oct 17, 2019, 05:26 Khem Raj ***@***.***> wrote:
https://errors.yoctoproject.org/Errors/Details/273663/
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#137?email_source=notifications&email_token=ABM3OUX3YEBD3PGZZXDO2PTQO7LN3A5CNFSM4HXHJPSKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBOT5ZQ#issuecomment-542981862>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABM3OUQT64GYP7H46U2PHELQO7LN3ANCNFSM4HXHJPSA>
.
|
|
this is mostly because its using |
kraj
left a comment
There was a problem hiding this comment.
Please test with TCLIBC = "musl"
d8d8252 to
17f235e
Compare
|
I've provided patches for MUSL. Please re-review... |
|
@sangelovic Please squash all the patches into a single patch and send the pull |
d06a3d1 to
c5644ee
Compare
|
@kraj Done. |
|
I have cherry-picked it for master-next, in future add your sign-offs to commits, and commit msg guidelines are here [1] [1] https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines |
|
fails to build with clang/libc++/musl |
kraj
left a comment
There was a problem hiding this comment.
I think this needs a bit more love, almost there :)
c5644ee to
84f705c
Compare
sdbus-c++ is a high-level, expressive, easy-to-use C++ D-Bus client library written on top of systemd D-Bus client C library. Signed-off-by: Stanislav Angelovic <angelovic.s@gmail.com>
84f705c to
64b9e69
Compare
|
Hi @kraj . Thanks for having patience with me :) I fixed the clang issues. I've also updated the commit message, I hope it's along the guidelines now. Please could you re-test? I hope this could finally make it... |
|
Regarding the fetch errors, I have no idea what the issue was. Perhaps just that github was down? Because the project path and the commit hash is valid... |
|
merged with b2baaae |
Fixes build with 32 bit machines. - Fix build on 32-bit with 64-bit time_t by @cgzones in #136 - Misc by @cgzones in #137 - Add terminating newline also for TLS connections by @Googulator in #139 - Add RFC5425 length field by @derobert in #140 - Correct examples for ExcludeSyslogFacility and ExcludeSyslogLevel by @ngraziano in #141 Signed-off-by: Anuj Mittal <anuj.mittal@oss.qualcomm.com>
sdbus-c++ is a high-level C++ D-Bus library written on top of systemd D-Bus implementation originally as a modern, robust replacement for dbus-c++.
There are two main recipes and one helper recipe:
sdbus-c++-libsystemdrecipe.) The recipe also supports ptest.The recipes have been tested on yocto master.