* [PATCH] package.bbclass: Fix broken dev package dependency.
@ 2024-06-24 9:56 Sreejith Ravi
2024-06-24 11:07 ` [OE-core] " Alexander Kanavin
0 siblings, 1 reply; 11+ messages in thread
From: Sreejith Ravi @ 2024-06-24 9:56 UTC (permalink / raw)
To: openembedded-core
[-- Attachment #1.1: Type: text/plain, Size: 1548 bytes --]
Currently, the process_pkgconfig() would process only the "Requires" key field and ignore "Requires.private" while generating the dev dependency chain.
Example: usr/lib/pkgconfig/libical.pc
----------
Libs: -L${libdir} -lical -licalss -licalvcal
Libs.private: -lpthread
Requires.private: icu-i18n
----------
Depends field generated for libical-dev
Depends: glib-2.0-dev, libical (= 3.0.7-r0)
------------
When trying to resolve the build time dependency with libical package using “-dev” ipk generated, it will throw the below error.
-----------
Package icu-i18n was not found in the pkg-config search path.
Perhaps you should add the directory containing `icu-i18n.pc'
to the PKG_CONFIG_PATH environment variable
Package 'icu-i18n', required by 'libical', not found
-----------
This patch will add the packages listed in "Requires.private" to the dependency chain.
-------
Depends field generated with this change for libical-dev
Depends: glib-2.0-dev, icu-dev, libical (= 3.0.7-r0)
-------
Other examples of packages generated with broken dev dependency.
libflac-dev : https://packages.debian.org/sid/libflac-dev
Without patch:
Depends: flac (= 1.3.3-r0), libflac, libflac++
with patch:
Depends: flac (= 1.3.3-r0), libflac, libflac++, libogg-dev
libglib2.0-dev : https://packages.debian.org/buster/libglib2.0-dev
without patch:
Depends: libffi-dev, libglib-2.0-0 (= 1:2.62.6-r0), libpcre-dev
with patch:
Depends: libffi-dev, libglib-2.0-0 (= 1:2.62.6-r0), libpcre-dev,
util-linux-dev, zlib-dev
[-- Attachment #1.2: Type: text/html, Size: 1750 bytes --]
[-- Attachment #2: 0001-package.bbclass-Fix-broken-dev-package-dependency.patch --]
[-- Type: application/octet-stream, Size: 2666 bytes --]
From b559be82ffc16a012d40d5f15722ef0bb840ee9e Mon Sep 17 00:00:00 2001
From: Sreejith Ravi <sreejit.ravi087@gmail.com>
Date: Mon, 24 Jun 2024 10:18:10 +0100
Subject: [PATCH] package.bbclass: Fix broken dev package dependency.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Currently, the process_pkgconfig() would process only the
"Requires" key field and ignore "Requires.private" while
generating the dev dependency chain.
Example: usr/lib/pkgconfig/libical.pc
----------
Libs: -L${libdir} -lical -licalss -licalvcal
Libs.private: -lpthread
Requires.private: icu-i18n
----------
Depends field generated for libical-dev
Depends: glib-2.0-dev, libical (= 3.0.7-r0)
------------
When trying to resolve the build time dependency with libical
package using “-dev” ipk generated, it will throw the below error.
-----------
Package icu-i18n was not found in the pkg-config search path.
Perhaps you should add the directory containing `icu-i18n.pc'
to the PKG_CONFIG_PATH environment variable
Package 'icu-i18n', required by 'libical', not found
-----------
This patch will add the packages listed in "Requires.private"
to the dependency chain.
-------
Depends field generated with this change for libical-dev
Depends: glib-2.0-dev, icu-dev, libical (= 3.0.7-r0)
-------
Other examples of packages generated with broken dev dependency.
libflac-dev : https://packages.debian.org/sid/libflac-dev
Without patch:
Depends: flac (= 1.3.3-r0), libflac, libflac++
with patch:
Depends: flac (= 1.3.3-r0), libflac, libflac++, libogg-dev
libglib2.0-dev : https://packages.debian.org/buster/libglib2.0-dev
without patch:
Depends: libffi-dev, libglib-2.0-0 (= 1:2.62.6-r0), libpcre-dev
with patch:
Depends: libffi-dev, libglib-2.0-0 (= 1:2.62.6-r0), libpcre-dev,
util-linux-dev, zlib-dev
Signed-off-by: Sreejith Ravi <sreejit.ravi087@gmail.com>
---
meta/classes/package.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 67351b2510..084fe428e5 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -2182,7 +2182,7 @@ python package_do_pkgconfig () {
if m:
hdr = m.group(1)
exp = pd.expand(m.group(2))
- if hdr == 'Requires':
+ if hdr == 'Requires' or hdr == 'Requires.private':
pkgconfig_needed[pkg] += exp.replace(',', ' ').split()
continue
m = var_re.match(l)
--
2.34.1
^ permalink raw reply related [flat|nested] 11+ messages in thread* Re: [OE-core] [PATCH] package.bbclass: Fix broken dev package dependency.
2024-06-24 9:56 [PATCH] package.bbclass: Fix broken dev package dependency Sreejith Ravi
@ 2024-06-24 11:07 ` Alexander Kanavin
2024-06-24 11:20 ` Sreejith Ravi
0 siblings, 1 reply; 11+ messages in thread
From: Alexander Kanavin @ 2024-06-24 11:07 UTC (permalink / raw)
To: sreejith.ravi087; +Cc: openembedded-core
On Mon, 24 Jun 2024 at 11:56, Sreejith Ravi via lists.openembedded.org
<sreejith.ravi087=gmail.com@lists.openembedded.org> wrote:
>
> Currently, the process_pkgconfig() would process only the "Requires" key field and ignore "Requires.private" while generating the dev dependency chain.
>
> Example: usr/lib/pkgconfig/libical.pc
> ----------
> Libs: -L${libdir} -lical -licalss -licalvcal
> Libs.private: -lpthread
> Requires.private: icu-i18n
> ----------
> Depends field generated for libical-dev
> Depends: glib-2.0-dev, libical (= 3.0.7-r0)
> ------------
>
> When trying to resolve the build time dependency with libical package using “-dev” ipk generated, it will throw the below error.
> -----------
> Package icu-i18n was not found in the pkg-config search path.
> Perhaps you should add the directory containing `icu-i18n.pc'
> to the PKG_CONFIG_PATH environment variable
> Package 'icu-i18n', required by 'libical', not found
> -----------
>
> This patch will add the packages listed in "Requires.private" to the dependency chain.
>
> -------
> Depends field generated with this change for libical-dev
> Depends: glib-2.0-dev, icu-dev, libical (= 3.0.7-r0)
> -------
The icu-dev package is already listed in the Recommends section that
is formed from shared libraries libical uses, so you need to install
the recommended packages:
%package -n libical-dev
Summary: iCal and scheduling (RFC 2445, 2446, 2447) library - Development files
License: LGPL-2.1-only | MPL-2.0
Group: devel
Requires: glib-2.0-dev
Requires: libical
Recommends: glib-2.0-dev
Recommends: glibc-dev
Recommends: gobject-introspection-dev
Recommends: icu-dev
Recommends: libgcc-dev
Recommends: libical = 3.0.18-r0
Recommends: libicui18n-dev
Recommends: libicuuc-dev
Recommends: libstdc++-dev
Recommends: libxml2-dev
Recommends: vala-dev
Seems like there's quite a bit more needed for a successful build than
just icu-dev and glib-2.0-dev.
Alex
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [OE-core] [PATCH] package.bbclass: Fix broken dev package dependency.
2024-06-24 11:07 ` [OE-core] " Alexander Kanavin
@ 2024-06-24 11:20 ` Sreejith Ravi
2024-06-24 11:27 ` Alexander Kanavin
0 siblings, 1 reply; 11+ messages in thread
From: Sreejith Ravi @ 2024-06-24 11:20 UTC (permalink / raw)
To: Alexander Kanavin; +Cc: openembedded-core
[-- Attachment #1: Type: text/plain, Size: 2758 bytes --]
The icu package is necessary for the compilation of libical; otherwise, the
build will fail. "Recommended" contains all the packages that are part of
the dependent build. If we try to install the recommended packages, it will
download and install many unnecessary packages, consuming hard disk space
and increasing download time. Referring to the Debian packages, icu-dev is
a dependent package, meaning it is required for the build. "Depends" is a
must-have, and "Recommends" is optional. In this case, the ICU package is a
must-have.
Sreejith
On Mon, Jun 24, 2024 at 12:08 PM Alexander Kanavin <alex.kanavin@gmail.com>
wrote:
> On Mon, 24 Jun 2024 at 11:56, Sreejith Ravi via lists.openembedded.org
> <sreejith.ravi087=gmail.com@lists.openembedded.org> wrote:
> >
> > Currently, the process_pkgconfig() would process only the "Requires" key
> field and ignore "Requires.private" while generating the dev dependency
> chain.
> >
> > Example: usr/lib/pkgconfig/libical.pc
> > ----------
> > Libs: -L${libdir} -lical -licalss -licalvcal
> > Libs.private: -lpthread
> > Requires.private: icu-i18n
> > ----------
> > Depends field generated for libical-dev
> > Depends: glib-2.0-dev, libical (= 3.0.7-r0)
> > ------------
> >
> > When trying to resolve the build time dependency with libical package
> using “-dev” ipk generated, it will throw the below error.
> > -----------
> > Package icu-i18n was not found in the pkg-config search path.
> > Perhaps you should add the directory containing `icu-i18n.pc'
> > to the PKG_CONFIG_PATH environment variable
> > Package 'icu-i18n', required by 'libical', not found
> > -----------
> >
> > This patch will add the packages listed in "Requires.private" to the
> dependency chain.
> >
> > -------
> > Depends field generated with this change for libical-dev
> > Depends: glib-2.0-dev, icu-dev, libical (= 3.0.7-r0)
> > -------
>
> The icu-dev package is already listed in the Recommends section that
> is formed from shared libraries libical uses, so you need to install
> the recommended packages:
>
> %package -n libical-dev
> Summary: iCal and scheduling (RFC 2445, 2446, 2447) library - Development
> files
> License: LGPL-2.1-only | MPL-2.0
> Group: devel
> Requires: glib-2.0-dev
> Requires: libical
> Recommends: glib-2.0-dev
> Recommends: glibc-dev
> Recommends: gobject-introspection-dev
> Recommends: icu-dev
> Recommends: libgcc-dev
> Recommends: libical = 3.0.18-r0
> Recommends: libicui18n-dev
> Recommends: libicuuc-dev
> Recommends: libstdc++-dev
> Recommends: libxml2-dev
> Recommends: vala-dev
>
> Seems like there's quite a bit more needed for a successful build than
> just icu-dev and glib-2.0-dev.
>
> Alex
>
[-- Attachment #2: Type: text/html, Size: 3481 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [OE-core] [PATCH] package.bbclass: Fix broken dev package dependency.
2024-06-24 11:20 ` Sreejith Ravi
@ 2024-06-24 11:27 ` Alexander Kanavin
2024-06-24 12:23 ` Sreejith Ravi
0 siblings, 1 reply; 11+ messages in thread
From: Alexander Kanavin @ 2024-06-24 11:27 UTC (permalink / raw)
To: Sreejith Ravi; +Cc: openembedded-core
On Mon, 24 Jun 2024 at 13:20, Sreejith Ravi <sreejith.ravi087@gmail.com> wrote:
> The icu package is necessary for the compilation of libical; otherwise, the build will fail. "Recommended" contains all the packages that are part of the dependent build. If we try to install the recommended packages, it will download and install many unnecessary packages, consuming hard disk space and increasing download time. Referring to the Debian packages, icu-dev is a dependent package, meaning it is required for the build. "Depends" is a must-have, and "Recommends" is optional. In this case, the ICU package is a must-have.
Wait a moment. What are you building and in which context? If you are
building libical, then I don't understand why libical-dev (which is
produced by building libical) needs to be fixed.
In other words, can you show steps to reproduce the problem?
Alex
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] package.bbclass: Fix broken dev package dependency.
2024-06-24 11:27 ` Alexander Kanavin
@ 2024-06-24 12:23 ` Sreejith Ravi
2024-06-24 12:36 ` [OE-core] " Alexander Kanavin
0 siblings, 1 reply; 11+ messages in thread
From: Sreejith Ravi @ 2024-06-24 12:23 UTC (permalink / raw)
To: openembedded-core
[-- Attachment #1: Type: text/plain, Size: 1840 bytes --]
We are building the components through Yocto and using dev IPKs for the dependent packages (generated from Yocto) to resolve the build dependencies.
Steps:
1) Generate the libical IPKs from Yocto.
2) Copy the IPKs to a folder and create the local opkg feed.
3) Remove libical from the BlueZ dependencies list.
4) Install the libical-dev IPK from the local feed to the BlueZ recipe sysroot.
4) Build the BlueZ package.
When we tried to build BlueZ from source, by using the libical dev IPK, we are getting the error.
"
configure:14460: checking for libical
configure:14467: $PKG_CONFIG --exists --print-errors "libical"
Package icu-i18n was not found in the pkg-config search path.
Perhaps you should add the directory containing `icu-i18n.pc'
to the PKG_CONFIG_PATH environment variable
Package 'icu-i18n', required by 'libical', not found
configure:14470: $? = 1
configure:14484: $PKG_CONFIG --exists --print-errors "libical"
Package icu-i18n was not found in the pkg-config search path.
Perhaps you should add the directory containing `icu-i18n.pc'
to the PKG_CONFIG_PATH environment variable
Package 'icu-i18n', required by 'libical', not found
configure:14487: $? = 1
configure:14501: result: no
Package 'icu-i18n', required by 'libical', not found
configure:14517: error: libical is required
"
Similarly, when we are trying to build the 'gstreamer1.0_1.18' package, which has a dependency on 'glib2-0,' and using the glib2-0 dev IPK, it is failing with the error below due to the missing zlib dependency chain.
"
pkg-config error with 'gio-2.0': Could not generate cargs for gio-2.0:
Package zlib was not found in the pkg-config search path.
Perhaps you should add the directory containing `zlib.pc'
to the PKG_CONFIG_PATH environment variable
Package 'zlib', required by 'gio-2.0', not found
"
[-- Attachment #2: Type: text/html, Size: 1984 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [OE-core] [PATCH] package.bbclass: Fix broken dev package dependency.
2024-06-24 12:23 ` Sreejith Ravi
@ 2024-06-24 12:36 ` Alexander Kanavin
2024-06-24 12:47 ` Sreejith Ravi
0 siblings, 1 reply; 11+ messages in thread
From: Alexander Kanavin @ 2024-06-24 12:36 UTC (permalink / raw)
To: sreejith.ravi087; +Cc: openembedded-core
On Mon, 24 Jun 2024 at 14:23, Sreejith Ravi via lists.openembedded.org
<sreejith.ravi087=gmail.com@lists.openembedded.org> wrote:
>
> We are building the components through Yocto and using dev IPKs for the dependent packages (generated from Yocto) to resolve the build dependencies.
>
> Steps:
> 1) Generate the libical IPKs from Yocto.
> 2) Copy the IPKs to a folder and create the local opkg feed.
> 3) Remove libical from the BlueZ dependencies list.
> 4) Install the libical-dev IPK from the local feed to the BlueZ recipe sysroot.
> 4) Build the BlueZ package.
The supported way to do this is with 'devtool modify bluez'.
Another option is to use a Yocto SDK, if you only want to build
binaries with a cross-toolchain and not run any of the recipe tasks.
Installing things into sysroots with anything else except bitbake
isn't supported.
Alex
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] package.bbclass: Fix broken dev package dependency.
2024-06-24 12:36 ` [OE-core] " Alexander Kanavin
@ 2024-06-24 12:47 ` Sreejith Ravi
2024-06-24 12:53 ` [OE-core] " Alexander Kanavin
0 siblings, 1 reply; 11+ messages in thread
From: Sreejith Ravi @ 2024-06-24 12:47 UTC (permalink / raw)
To: openembedded-core
[-- Attachment #1: Type: text/plain, Size: 121 bytes --]
What is the purpose of the dev IPKs generated by Yocto? As I understand, we can use them to resolve build dependencies.
[-- Attachment #2: Type: text/html, Size: 121 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [OE-core] [PATCH] package.bbclass: Fix broken dev package dependency.
2024-06-24 12:47 ` Sreejith Ravi
@ 2024-06-24 12:53 ` Alexander Kanavin
2024-06-24 13:02 ` Sreejith Ravi
0 siblings, 1 reply; 11+ messages in thread
From: Alexander Kanavin @ 2024-06-24 12:53 UTC (permalink / raw)
To: sreejith.ravi087; +Cc: openembedded-core
On Mon, 24 Jun 2024 at 14:47, Sreejith Ravi via lists.openembedded.org
<sreejith.ravi087=gmail.com@lists.openembedded.org> wrote:
>
> What is the purpose of the dev IPKs generated by Yocto? As I understand, we can use them to resolve build dependencies.
The purpose is to generate a SDK for cross-builds with a toolchain, or
a target image for native development on the target, but in both cases
recommended packages are enabled and installed.
Resolving build dependencies in a yocto build is done with DEPENDS
lists specified in recipes, which bitbake will handle in
prepare_recipe_sysroot.
Alex
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] package.bbclass: Fix broken dev package dependency.
2024-06-24 12:53 ` [OE-core] " Alexander Kanavin
@ 2024-06-24 13:02 ` Sreejith Ravi
2024-06-24 13:26 ` [OE-core] " Alexander Kanavin
0 siblings, 1 reply; 11+ messages in thread
From: Sreejith Ravi @ 2024-06-24 13:02 UTC (permalink / raw)
To: openembedded-core
[-- Attachment #1: Type: text/plain, Size: 658 bytes --]
We should be able to install the dev IPK and resolve its corresponding dependency chain. As I mentioned earlier, enabling recommended packages and installing them increases hard disk usage and installation time when installing a lot of unnecessary recommended packages.
Yocto handles the dev dependency chain by parsing the 'Requires' field from the .pc file in the package_do_pkgconfig function. However, there is one more field, 'Requires.private', which also needs to be considered when creating the dependency chain for the dev IPKs. With this, the dev IPK has the proper dependencies listed and there is no need to install the recommended packages.
[-- Attachment #2: Type: text/html, Size: 666 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [OE-core] [PATCH] package.bbclass: Fix broken dev package dependency.
2024-06-24 13:02 ` Sreejith Ravi
@ 2024-06-24 13:26 ` Alexander Kanavin
2024-06-24 13:34 ` Sreejith Ravi
0 siblings, 1 reply; 11+ messages in thread
From: Alexander Kanavin @ 2024-06-24 13:26 UTC (permalink / raw)
To: sreejith.ravi087; +Cc: openembedded-core
On Mon, 24 Jun 2024 at 15:02, Sreejith Ravi via lists.openembedded.org
<sreejith.ravi087=gmail.com@lists.openembedded.org> wrote:
>
> We should be able to install the dev IPK and resolve its corresponding dependency chain. As I mentioned earlier, enabling recommended packages and installing them increases hard disk usage and installation time when installing a lot of unnecessary recommended packages.
>
> Yocto handles the dev dependency chain by parsing the 'Requires' field from the .pc file in the package_do_pkgconfig function. However, there is one more field, 'Requires.private', which also needs to be considered when creating the dependency chain for the dev IPKs. With this, the dev IPK has the proper dependencies listed and there is no need to install the recommended packages.
Very well. But you need to resend the patch as an email with 'git
send-email', not as an attachment. Also, make a better commit header:
package.bbclass: consider Requires.private in package_do_pkgconfig()
Alex
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2024-06-24 13:35 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-24 9:56 [PATCH] package.bbclass: Fix broken dev package dependency Sreejith Ravi
2024-06-24 11:07 ` [OE-core] " Alexander Kanavin
2024-06-24 11:20 ` Sreejith Ravi
2024-06-24 11:27 ` Alexander Kanavin
2024-06-24 12:23 ` Sreejith Ravi
2024-06-24 12:36 ` [OE-core] " Alexander Kanavin
2024-06-24 12:47 ` Sreejith Ravi
2024-06-24 12:53 ` [OE-core] " Alexander Kanavin
2024-06-24 13:02 ` Sreejith Ravi
2024-06-24 13:26 ` [OE-core] " Alexander Kanavin
2024-06-24 13:34 ` Sreejith Ravi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox