[OE-core][PATCH 2/2] systemd: add option to use stub-resolv.conf
From: Eero Aaltonen Add option to use the stub-resolv.conf file, which is the systemd upstream's recommended default mode https://www.freedesktop.org/software/systemd/man/systemd-resolved.service.html#/etc/resolv.conf This enables the resolution of Multicast DNS and Link-Local Multicast Name Resolution names for programs that do not use Name Service Switch. Signed-off-by: Eero Aaltonen --- meta/recipes-core/systemd/systemd_254.bb | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/meta/recipes-core/systemd/systemd_254.bb b/meta/recipes-core/systemd/systemd_254.bb index e0ee2da412..83cd854b87 100644 --- a/meta/recipes-core/systemd/systemd_254.bb +++ b/meta/recipes-core/systemd/systemd_254.bb @@ -228,6 +228,8 @@ PACKAGECONFIG[xz] = "-Dxz=true,-Dxz=false,xz" PACKAGECONFIG[zlib] = "-Dzlib=true,-Dzlib=false,zlib" PACKAGECONFIG[zstd] = "-Dzstd=true,-Dzstd=false,zstd" +RESOLV_CONF ??= "" + # Helper variables to clarify locations. This mirrors the logic in systemd's # build system. rootprefix ?= "${root_prefix}" @@ -339,8 +341,9 @@ do_install() { echo 'f /run/systemd/resolve/resolv.conf 0644 root root' >>${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf ln -s ../run/systemd/resolve/resolv.conf ${D}${sysconfdir}/resolv-conf.systemd else - sed -i -e "s%^L! /etc/resolv.conf.*$%L! /etc/resolv.conf - - - - ../run/systemd/resolve/resolv.conf%g" ${D}${exec_prefix}/lib/tmpfiles.d/etc.conf - ln -s ../run/systemd/resolve/resolv.conf ${D}${sysconfdir}/resolv-conf.systemd + resolv_conf="${@bb.utils.contains('RESOLV_CONF', 'stub-resolv', 'run/systemd/resolve/stub-resolv.conf', 'run/systemd/resolve/resolv.conf', d)}" + sed -i -e "s%^L! /etc/resolv.conf.*$%L! /etc/resolv.conf - - - - ../${resolv_conf}%g" ${D}${exec_prefix}/lib/tmpfiles.d/etc.conf + ln -s ../${resolv_conf} ${D}${sysconfdir}/resolv-conf.systemd fi if ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'false', 'true', d)}; then rm ${D}${exec_prefix}/lib/tmpfiles.d/x11.conf -- 2.25.1 -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#189446): https://lists.openembedded.org/g/openembedded-core/message/189446 Mute This Topic: https://lists.openembedded.org/mt/102057806/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[OE-core][PATCH 1/2] base-files, systemd: add nss-resolve plugin
From: Eero Aaltonen Add nss-resolve plugin to the glibc Name Service Switch (NSS) with systemd-resolved DISTRO_FEATURE so that systemd-resolved is used in DNS name resolution. This enables the resolution of Multicast DNS and Link-Local Multicast Name Resolution names, depending on the selected options. Signed-off-by: Eero Aaltonen --- .../0001-add-nss-resolve-to-nsswitch.patch| 31 +++ .../base-files/base-files_3.0.14.bb | 2 ++ meta/recipes-core/systemd/systemd_254.bb | 3 ++ 3 files changed, 36 insertions(+) create mode 100644 meta/recipes-core/base-files/base-files/0001-add-nss-resolve-to-nsswitch.patch diff --git a/meta/recipes-core/base-files/base-files/0001-add-nss-resolve-to-nsswitch.patch b/meta/recipes-core/base-files/base-files/0001-add-nss-resolve-to-nsswitch.patch new file mode 100644 index 00..a6e39e0956 --- /dev/null +++ b/meta/recipes-core/base-files/base-files/0001-add-nss-resolve-to-nsswitch.patch @@ -0,0 +1,31 @@ +From 830abe652428d9d31780c3ace121635ad7b64274 Mon Sep 17 00:00:00 2001 +From: Eero Aaltonen +Date: Wed Sep 27 15:50:48 2023 +0300 +Subject: [PATCH] Add nss-resolve to the Name Service Switch (NSS) + +Add `nss-resolve` so that `systemd-resolved` is used for name +resolution with glibc `gethostbyname` calls. + +Upstream-Status: Inappropriate [no upstream, configuration]. + +Signed-off-by: Eero Aaltonen +--- + nsswitch.conf | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/nsswitch.conf b/nsswitch.conf +index 06f03d2..34b165c 100644 +--- a/nsswitch.conf b/nsswitch.conf +@@ -8,7 +8,7 @@ passwd: compat + group: compat + shadow: compat + +-hosts: files dns ++hosts: resolve [!UNAVAIL=return] files dns + networks: files + + protocols: db files +-- +2.25.1 + diff --git a/meta/recipes-core/base-files/base-files_3.0.14.bb b/meta/recipes-core/base-files/base-files_3.0.14.bb index 6ba3971e32..6890fe114d 100644 --- a/meta/recipes-core/base-files/base-files_3.0.14.bb +++ b/meta/recipes-core/base-files/base-files_3.0.14.bb @@ -23,6 +23,8 @@ SRC_URI = "file://rotation \ file://share/dot.profile \ file://licenses/GPL-2 \ " +SRC_URI:append:libc-glibc = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd systemd-resolved', ' file://0001-add-nss-resolve-to-nsswitch.patch', '', d)}" + S = "${WORKDIR}" INHIBIT_DEFAULT_DEPS = "1" diff --git a/meta/recipes-core/systemd/systemd_254.bb b/meta/recipes-core/systemd/systemd_254.bb index 8d5cf13095..e0ee2da412 100644 --- a/meta/recipes-core/systemd/systemd_254.bb +++ b/meta/recipes-core/systemd/systemd_254.bb @@ -789,6 +789,9 @@ python __anonymous() { if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d): d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1") +if bb.utils.contains('DISTRO_FEATURES', 'systemd-resolved', True, False, d) and not bb.utils.contains('PACKAGECONFIG', 'nss-resolve resolved', True, False, d): +bb.error("DISTRO_FEATURES[systemd-resolved] requires PACKAGECONFIG[nss-resolve, resolved]") + if bb.utils.contains('PACKAGECONFIG', 'repart', True, False, d) and not bb.utils.contains('PACKAGECONFIG', 'openssl', True, False, d): bb.error("PACKAGECONFIG[repart] requires PACKAGECONFIG[openssl]") -- 2.25.1 -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#189445): https://lists.openembedded.org/g/openembedded-core/message/189445 Mute This Topic: https://lists.openembedded.org/mt/102057805/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[OE-core][PATCH 0/2] DNS resolution using systemd-resolved
From: Eero Aaltonen Enable DNS resolution features from systemd-resolved, such as Multicast DNS for distros using systemd. The first commit enables systemd-resolved via glibc nsswitch.conf, which is one of the interfaces recommended by systemd upstream. The second commit enables mDNS resolution for executables that do not use nsswitch, notably including busybox. Eero Aaltonen (2): base-files, systemd: add nss-resolve plugin systemd: add option to use stub-resolv.conf .../0001-add-nss-resolve-to-nsswitch.patch| 31 +++ .../base-files/base-files_3.0.14.bb | 2 ++ meta/recipes-core/systemd/systemd_254.bb | 10 -- 3 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 meta/recipes-core/base-files/base-files/0001-add-nss-resolve-to-nsswitch.patch -- 2.25.1 -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#189444): https://lists.openembedded.org/g/openembedded-core/message/189444 Mute This Topic: https://lists.openembedded.org/mt/102057804/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[OE-core][kirkstone][PATCH] avahi: fix D-Bus introspection
From: Eero Aaltonen Install and package the D-Bus introspection files. Signed-off-by: Eero Aaltonen Signed-off-by: Alexandre Belloni (cherry picked from commit b8183ad25af3bcf23f04dd649b6ef665569fac8c) Signed-off-by: Eero Aaltonen --- meta/recipes-connectivity/avahi/avahi_0.8.bb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/meta/recipes-connectivity/avahi/avahi_0.8.bb b/meta/recipes-connectivity/avahi/avahi_0.8.bb index 9bb5e5861e..b5c966c102 100644 --- a/meta/recipes-connectivity/avahi/avahi_0.8.bb +++ b/meta/recipes-connectivity/avahi/avahi_0.8.bb @@ -83,7 +83,6 @@ RRECOMMENDS:${PN}:append:libc-glibc = " libnss-mdns" do_install() { autotools_do_install rm -rf ${D}/run - rm -rf ${D}${datadir}/dbus-1/interfaces test -d ${D}${datadir}/dbus-1 && rmdir --ignore-fail-on-non-empty ${D}${datadir}/dbus-1 rm -rf ${D}${libdir}/avahi @@ -135,7 +134,7 @@ FILES:avahi-daemon = "${sbindir}/avahi-daemon \ ${sysconfdir}/avahi/services \ ${sysconfdir}/dbus-1 \ ${sysconfdir}/init.d/avahi-daemon \ - ${datadir}/avahi/introspection/*.introspect \ + ${datadir}/dbus-1/interfaces \ ${datadir}/avahi/avahi-service.dtd \ ${datadir}/avahi/service-types \ ${datadir}/dbus-1/system-services" -- 2.25.1 -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#181593): https://lists.openembedded.org/g/openembedded-core/message/181593 Mute This Topic: https://lists.openembedded.org/mt/99063030/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[OE-core][PATCH V2] avahi: fix D-Bus introspection
From: Eero Aaltonen Install and package the D-Bus introspection files. Signed-off-by: Eero Aaltonen --- meta/recipes-connectivity/avahi/avahi_0.8.bb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/meta/recipes-connectivity/avahi/avahi_0.8.bb b/meta/recipes-connectivity/avahi/avahi_0.8.bb index bf6835e0d6..8649140a45 100644 --- a/meta/recipes-connectivity/avahi/avahi_0.8.bb +++ b/meta/recipes-connectivity/avahi/avahi_0.8.bb @@ -83,7 +83,6 @@ RRECOMMENDS:${PN}:append:libc-glibc = " libnss-mdns" do_install() { autotools_do_install rm -rf ${D}/run - rm -rf ${D}${datadir}/dbus-1/interfaces test -d ${D}${datadir}/dbus-1 && rmdir --ignore-fail-on-non-empty ${D}${datadir}/dbus-1 rm -rf ${D}${libdir}/avahi @@ -135,7 +134,7 @@ FILES:avahi-daemon = "${sbindir}/avahi-daemon \ ${sysconfdir}/avahi/services \ ${sysconfdir}/dbus-1 \ ${sysconfdir}/init.d/avahi-daemon \ - ${datadir}/avahi/introspection/*.introspect \ + ${datadir}/dbus-1/interfaces \ ${datadir}/avahi/avahi-service.dtd \ ${datadir}/avahi/service-types \ ${datadir}/dbus-1/system-services" -- 2.25.1 -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#181236): https://lists.openembedded.org/g/openembedded-core/message/181236 Mute This Topic: https://lists.openembedded.org/mt/98899647/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [OE-core][PATCH] avahi: fix D-Bus introspection
On Mon, 2023-05-15 at 10:36 +0200, Alexander Kanavin wrote: > On Fri, 12 May 2023 at 16:11, Eero Aaltonen via > lists.openembedded.org > wrote: > > --- a/meta/recipes-connectivity/avahi/avahi_0.8.bb > > +++ b/meta/recipes-connectivity/avahi/avahi_0.8.bb > > Why are these conditional? That packageconfig is defined as > PACKAGECONFIG[dbus] = "--enable-dbus,--disable-dbus,dbus" > so upstream should simply handle installing (or not) the needed files > by itself? Overabundance of caution. I didn't find why the directories were removed in the recipe - so I tried to minimize the changes. The upstream build seems to install the D-Bus org.freedesktop.Avahi.service also with --disable-dbus. I'll follow with a minified patch V2. It server the same purpose AFAICT. Eero -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#181235): https://lists.openembedded.org/g/openembedded-core/message/181235 Mute This Topic: https://lists.openembedded.org/mt/98849856/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[OE-core][PATCH] avahi: fix D-Bus introspection
From: Eero Aaltonen When dbus option is selected, install and package the D-Bus introspection files. Signed-off-by: Eero Aaltonen --- meta/recipes-connectivity/avahi/avahi_0.8.bb | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/meta/recipes-connectivity/avahi/avahi_0.8.bb b/meta/recipes-connectivity/avahi/avahi_0.8.bb index bf6835e0d6..9385404838 100644 --- a/meta/recipes-connectivity/avahi/avahi_0.8.bb +++ b/meta/recipes-connectivity/avahi/avahi_0.8.bb @@ -83,10 +83,13 @@ RRECOMMENDS:${PN}:append:libc-glibc = " libnss-mdns" do_install() { autotools_do_install rm -rf ${D}/run - rm -rf ${D}${datadir}/dbus-1/interfaces - test -d ${D}${datadir}/dbus-1 && rmdir --ignore-fail-on-non-empty ${D}${datadir}/dbus-1 rm -rf ${D}${libdir}/avahi + if ${@bb.utils.contains('PACKAGECONFIG', 'dbus', 'false', 'true', d)}; then + rm -rf ${D}${datadir}/dbus-1/interfaces + test -d ${D}${datadir}/dbus-1 && rmdir --ignore-fail-on-non-empty ${D}${datadir}/dbus-1 + fi + # Move example service files out of /etc/avahi/services so we don't # advertise ssh & sftp-ssh by default install -d ${D}${docdir}/avahi @@ -135,7 +138,7 @@ FILES:avahi-daemon = "${sbindir}/avahi-daemon \ ${sysconfdir}/avahi/services \ ${sysconfdir}/dbus-1 \ ${sysconfdir}/init.d/avahi-daemon \ - ${datadir}/avahi/introspection/*.introspect \ + ${@bb.utils.contains('PACKAGECONFIG', 'dbus', '${datadir}/dbus-1/interfaces', '', d)} \ ${datadir}/avahi/avahi-service.dtd \ ${datadir}/avahi/service-types \ ${datadir}/dbus-1/system-services" -- 2.25.1 -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#181184): https://lists.openembedded.org/g/openembedded-core/message/181184 Mute This Topic: https://lists.openembedded.org/mt/98849856/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [OE-core] [PATCH] cmake: stop FetchContent from fetching content
On Wed, 2022-02-09 at 09:45 -0800, Khem Raj via lists.openembedded.org wrote: > On 2/9/22 4:53 AM, Ross Burton wrote: > > CMake includes a FetchContent module, which will download further > > source code at configure time. With the network isolation this > > will now fail, but as not all environments support network > > isolation we can tell cmake to not download either for extra > > safety. > > what is cmake's default ? I think it could become a constant source > of pain if it is not default. Since many cmake based packages might > start to depend on it indirectly in future. CMake's default is to allow downloads. It's possible to write CMake projects so that they try find_package first and then fall back to downloading. I think FETCHCONTENT_FULLY_DISCONNECTED might be a helpful flag so that the build can then simply report if a required dependency has the wrong version or so. CMake projects that use _only_ FetchContent will likely need heavier patching. Eero -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#161603): https://lists.openembedded.org/g/openembedded-core/message/161603 Mute This Topic: https://lists.openembedded.org/mt/89020454/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [OE-core] [PATCH] base/patch: Disable network for unpack/patch/configure/compile/install
On Mon, 2021-12-27 at 14:38 +0100, Stefan Herbrechtsmeier via lists.openembedded.org wrote: > Hi Alex, > > Am 25.12.21 um 20:41 schrieb Alexander Kanavin: > > On Sat, 25 Dec 2021 at 20:32, Stefan Herbrechtsmeier > > mailto:ste...@herbrechtsmeier.net>> > > wrote: > > > > > I'm not sure how to deal with that, so there aren't that > > many options here. > > > > This is a common problem for all language specific package > > managers > > (python / pip, Node.js / npm, Rust / Carge, go) and we need a > > common solution. > > > > > > I tend to think that the best (and the hardest) option is to > > improve these tools so that they're usable inside do_fetch (e.g. > > fulfil the caching/reproducibility criteria for a bitbake fetcher), > > and the needed changes are acceptable to upstreams. > > The real problem is the different philosophy between OE and the > package manager. The package manager doesn't care about duplicate > versions, maintenance versions, version updates of indirect > dependencies, license compliance, CVE checks or dead code (examples, > documentations, test, > ...) and if they care every package manager have its own solution. The Java OSS ecosystem has had fairly well defined build time and runtime dependency metadata commonly available for many years now. The more widely used build tools are capable of using this metadata to calculate a solution Set(lib, version) that satisfies the version requirements of the dependency graph - or report that no solution is available. Cryptographic hashes are however by default provided by the artifact server(s). For Python distribution packages, the 2020 pip resolver is advertised to be better at calculating solutions to required package dependencies. Cryptographic hashes are specified for pip, use is optional. The PyPA Core metadata includes some potentially useful fields, such as the license and what the project requires. The language specific package managers could potentially be used to export dependency metadata, and also potentially to check "with (foo i.j.k) and (bar x.y.z), is there a set of compatible package versions available for baz and it's dependencies?" Regards, Eero Aaltonen -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#160031): https://lists.openembedded.org/g/openembedded-core/message/160031 Mute This Topic: https://lists.openembedded.org/mt/87909311/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [OE-core][dunfell 16/18] cmake: FindGTest: Add target for gmock library
On Fri, 2021-12-10 at 18:49 +, Jasper Orschulko wrote: > Hello everyone, > > after some digging we identified the issue to be on our part. > We have been using "GTEST_LIBRARY" and "GTEST_MAIN_LIBRARY" in our > CMake scripts instead of "GTEST_LIBRARIES" and > "GTEST_MAIN_LIBRARIES", > as described in the cmake docs: > https://cmake.org/cmake/help/v3.16/module/FindGTest.html#result-variables Thank you for providing more details. The gmock target can be backported to dunfell in an alternative way, by leaving out the find_package(GTest QUIET NO_MODULE) call and subsequent lines and letting the FindModule create all the definitions. This would leave also the undocumented variables intact, if that is desired. This should be as simple as dropping the lines -- # first specifically look for the CMake version of GTest find_package(GTest QUIET NO_MODULE) # if we found the GTest cmake package then we are done, and # can print what we found and return. if(GTest_FOUND) set(GTEST_FOUND ${GTest_FOUND}) FIND_PACKAGE_HANDLE_STANDARD_ARGS(GTest HANDLE_COMPONENTS CONFIG_MODE) set(GTEST_LIBRARIES GTest::gtest) set(GTEST_MAIN_LIBRARIES GTest::gtest_main) __gtest_define_backwards_compatible_library_targets() return() endif() -- -- Eero Aaltonen -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#159625): https://lists.openembedded.org/g/openembedded-core/message/159625 Mute This Topic: https://lists.openembedded.org/mt/87483225/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [OE-core] [PATCH 4/4] core: udev: udev-extraconf: rename mount.blacklist* to mount.blocklist.*
On Mon, 2021-12-06 at 23:31 +, Richard Purdie via lists.openembedded.org wrote: > On Mon, 2021-12-06 at 16:35 +0100, Quentin Schulz wrote: > > blocklist has a more obvious meaning than blacklist and is also not > > an > > issue wrt inclusivity, so let's use that naming instead. > > A "blocklist" with a filesystem is unfortunately confusing (a list of > block > numbers on the filesystem?). "ignorelist" or even "ignore-devices" > may be > better? (or skip) I offer "denylist". Cheers, Eero -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#159353): https://lists.openembedded.org/g/openembedded-core/message/159353 Mute This Topic: https://lists.openembedded.org/mt/87542276/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [OE-core] [dunfell][PATCH] cmake: FindGTest: Add target for gmock library
On Tue, 2021-11-30 at 15:23 +0200, Eero Aaltonen via lists.openembedded.org wrote: > > Update `Modules/FindGTest.cmake` to provide the same targets as the > CMake Config-file Package and backwards compatible targets and result > variables. Bump. The googletest recipe at meta-oe dunfell branch is for version 1.10. The fact that CMake Find Module masked the targets of the GTest package resulted in a number of very confusing build failures. This patch is mostly about backporting the fixed forwarding behaviour from the Find Module to the Config-file Package that was released in CMake v3.20.0. -- Eero Aaltonen -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#159115): https://lists.openembedded.org/g/openembedded-core/message/159115 Mute This Topic: https://lists.openembedded.org/mt/87401815/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [OE-core] [RFC] meson needs a pkg-config wrapper script
You can use `${pcfiledir}/../..` within a pkg-config file to reference the install path. Unfortunately the last time I tried it when cross-compiling, the PKG_CONFIG_SYSROOT_DIR was ended up in the path as a duplicate. -Eero On Wed, 2021-12-01 at 09:36 +0100, Alexander Kanavin via lists.openembedded.org wrote: > No, it's not that. Even if you pass PKG_CONFIG_SYSROOT_DIR to pkg- > config directly, it will apply that only to --cflags and similar, but > not to generic --variable. Try this: > > alex@alex-lx-laptop:~$ PKG_CONFIG_SYSROOT_DIR=/ pkg-config libdrm > --cflags > -I//usr/include/libdrm > alex@alex-lx-laptop:~$ PKG_CONFIG_SYSROOT_DIR=/ pkg-config libdrm > --variable=includedir > /usr/include > > So a wrapper will not solve the 'includedir prefix' problem, and > neither the wrapper, nor pkg-config or meson can possibly know which > variable is a path, and which isn't - the only place where that is > known is the component that obtains the variable. And so that's where > it has to be prefixed. > > Alex > > > On Tue, 30 Nov 2021 at 23:38, Joel Winarske > wrote: > > Based on my testing, if PKG_CONFIG_SYSROOT_DIR is set or not makes > > zero difference on the outcome. I suspect this is related to how > > pkg-config is launched by meson. > > > > Looking at the meson source tree, in all ci/test cross compile > > scenarios they reference a pkg-config wrapper. No cross compile > > scenario I see referencing the 'pkgconfig' key uses a bare pkg- > > config. > > > > cross/armclang-linux.txt:#pkgconfig = '/usr/bin/arm-linux- > > gnueabihf-pkg-config' > > cross/linux-mingw-w64-32bit.txt:pkgconfig = '/usr/bin/i686-w64- > > mingw32-pkg-config' > > cross/linux-mingw-w64-64bit.txt:pkgconfig = '/usr/bin/x86_64- > > w64-mingw32-pkg-config' > > cross/ubuntu-armhf.txt:pkgconfig = '/usr/bin/arm-linux- > > gnueabihf-pkg-config' > > > > test cases/unit/33 cross file overrides always > > args/ubuntu-armhf-overrides.txt:pkgconfig = > > '/usr/bin/arm-linux-gnueabihf-pkg-config' > > test cases/unit/36 exe_wrapper behaviour/broken- > > cross.txt:pkgconfig = '/usr/bin/x86_64-w64-mingw32-pkg-config' > > > > > > I think adding a wrapper makes sense. > > > > 5.2 Tool Calling Conventions - > > https://autotools.io/pkgconfig/cross-compiling.html > > On Tue, Nov 30, 2021 at 12:13 PM Alexander Kanavin < > > alex.kana...@gmail.com> wrote: > > > On Tue, 30 Nov 2021 at 21:00, Joel Winarske < > > > joel.winar...@gmail.com> wrote: > > > > Yes, if the sys_root key value in meson.cross is present > > > > PKG_CONFIG_SYSROOT_DIR gets set. Honister patch I confirmed > > > > with: > > > > https://github.com/jwinarske/manifests/blob/honister/rpi64/0001-Add-sys_root-to-properties-section.patch > > > > > > > > The issue is that meson doesn't pass PKG_CONFIG_SYSROOT_DIR to > > > > the shell environment that runs pkg-config, as with the pkg- > > > > config sandbox test it does work. > > > > > > > > > > Both meson source code and its documentation indicate otherwise - > > > if you set sys_root property, it will get passed to pkg-config > > > via environment as PKG_CONFIG_SYSROOT_DIR: > > > https://github.com/mesonbuild/meson/blob/master/mesonbuild/dependencies/pkgconfig.py#L121 > > > Alex > > > > > > > > > > -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#159020): https://lists.openembedded.org/g/openembedded-core/message/159020 Mute This Topic: https://lists.openembedded.org/mt/87407703/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[OE-core] [dunfell][PATCH] cmake: FindGTest: Add target for gmock library
`googlemock` has been absorbed into the [googletest](https://github.com/google/googletest) project and is built and installed from the same source tree. `googletest` has provided a CMake Config-file Package starting with GTest 1.8.1. `find_package(GTest ...)` by default dispatches first to CMake Find Module. Starting with CMake commit 2327b4330cce157d616ff8b611b3e77568d00351 in CMake v3.20.0 the module dispatches onward to the Config-file Package so that the same targets are available. In pre v3.20.0 versions of CMake however the Find Module masks the targets provided by the upstream `GTest` package. Update `Modules/FindGTest.cmake` to provide the same targets as the CMake Config-file Package and backwards compatible targets and result variables. Signed-off-by: Eero Aaltonen --- .../cmake/cmake-native_3.16.5.bb | 1 + ...ndGTest-Add-target-for-gmock-library.patch | 255 ++ 2 files changed, 256 insertions(+) create mode 100644 meta/recipes-devtools/cmake/cmake/0006-cmake-FindGTest-Add-target-for-gmock-library.patch diff --git a/meta/recipes-devtools/cmake/cmake-native_3.16.5.bb b/meta/recipes-devtools/cmake/cmake-native_3.16.5.bb index b2952ee5f5..96a7be6770 100644 --- a/meta/recipes-devtools/cmake/cmake-native_3.16.5.bb +++ b/meta/recipes-devtools/cmake/cmake-native_3.16.5.bb @@ -7,6 +7,7 @@ SRC_URI += "file://OEToolchainConfig.cmake \ file://environment.d-cmake.sh \ file://0001-CMakeDetermineSystem-use-oe-environment-vars-to-load.patch \ file://0005-Disable-use-of-ext2fs-ext2_fs.h-by-cmake-s-internal-.patch \ +file://0006-cmake-FindGTest-Add-target-for-gmock-library.patch \ " diff --git a/meta/recipes-devtools/cmake/cmake/0006-cmake-FindGTest-Add-target-for-gmock-library.patch b/meta/recipes-devtools/cmake/cmake/0006-cmake-FindGTest-Add-target-for-gmock-library.patch new file mode 100644 index 00..267f586a71 --- /dev/null +++ b/meta/recipes-devtools/cmake/cmake/0006-cmake-FindGTest-Add-target-for-gmock-library.patch @@ -0,0 +1,255 @@ +From 39eae0d6c1b398f18761abac7f55944f0290f8a1 Mon Sep 17 00:00:00 2001 +From: Eero Aaltonen +Date: Sun, 17 Oct 2021 17:13:07 +0300 +Subject: [PATCH] FindGTest: Add target for gmock library + +`googlemock` has been absorbed into the +[googletest](https://github.com/google/googletest) project and is built +and installed from the same source tree. + +As GTest may be built with or without GMock, skip GMock if it is not +present. + +Do not provide result variables for GMock. They are not provided by +upstream GTest's CMake Package Configuration File. + +Also update the test case to cover linking to `GTest::gmock`. + +The patch was imported from the Kitware git server +(g...@gitlab.kitware.com:cmake/cmake.git) as of commit id +50bf457a0dd857cf976b22c5be7d333493233d1e + +Patch was modified to support upper case variable `GTEST_FOUND`. + +Upstream-Status: Accepted [https://gitlab.kitware.com/cmake/cmake/-/merge_requests/6632] +Milestone: 3.23.0 + +Signed-off-by: Eero Aaltonen +--- + .../dev/FindGTest-target-for-gmock.rst| 4 + + Modules/FindGTest.cmake | 133 +++--- + Tests/FindGTest/Test/CMakeLists.txt | 4 + + 3 files changed, 121 insertions(+), 20 deletions(-) + create mode 100644 Help/release/dev/FindGTest-target-for-gmock.rst + +diff --git a/Help/release/dev/FindGTest-target-for-gmock.rst b/Help/release/dev/FindGTest-target-for-gmock.rst +new file mode 100644 +index 00..f78242c80e +--- /dev/null b/Help/release/dev/FindGTest-target-for-gmock.rst +@@ -0,0 +1,4 @@ ++FindGTest-target-for-gmock ++-- ++ ++* The :module:`FindGTest` module now provides a target for GMock, if found. +diff --git a/Modules/FindGTest.cmake b/Modules/FindGTest.cmake +index e015a9840f..0331049594 100644 +--- a/Modules/FindGTest.cmake b/Modules/FindGTest.cmake +@@ -7,10 +7,23 @@ FindGTest + + Locate the Google C++ Testing Framework. + ++.. versionadded:: 3.20 ++ Upstream ``GTestConfig.cmake`` is used if possible. ++ + Imported targets + + +-This module defines the following :prop_tgt:`IMPORTED` targets: ++ This module defines the following :prop_tgt:`IMPORTED` targets: ++ ++``GTest::gtest`` ++ The Google Test ``gtest`` library, if found; adds Thread::Thread ++ automatically ++``GTest::gtest_main`` ++ The Google Test ``gtest_main`` library, if found ++ ++.. deprecated:: 3.20 ++ For backwards compatibility, this module defines additionally the ++ following deprecated :prop_tgt:`IMPORTED` targets (available since 3.5): + + ``GTest::GTest`` + The Google Test ``gtest`` library, if found; adds Thread::Thread +@@ -18,7 +31,6 @@ This module defines the following :prop_tgt:`IMPORTED` targets: + ``GTest::Main`` + The Google Test ``gtest_main`` library, if found + +- + Result variables + + +@@ -146,8 +158,42 @@ function(__gtest_import_libra