rpm: remove depend on dbus for rpm native

Submitted by changqing.li@windriver.com on Aug. 15, 2018, 9:24 a.m. | Patch ID: 153758

Details

Message ID 1534325070-446684-1-git-send-email-changqing.li@windriver.com
State New
Headers show

Commit Message

changqing.li@windriver.com Aug. 15, 2018, 9:24 a.m.
From: Changqing Li <changqing.li@windriver.com>

This depend cause a big problem that for one package,
build enviroment for clean compile and second time compile
are different. And also rpm-native actually don't need to
depend on dbus, so remove it.

Take libfastjson as example:
(libfastjson don't have autoconf-archive-native in DEPEND)
if don't remove this dependency, it will have below dependency list:
libfastjson -> gcc-runtime -> libgcc -> glibc -> linux-libc-headers -> rpm-native
rpm-native -> dbus-native
dbus-native -> autoconf-archive-native

in this way:
do_package of libfastjson will depend on do_populate_sysroot
of autoconf-archive-native

for clean compile:
during do_configure, since do_package not executed,  so .m4 files
provide by autoconf-archive-native will not under recipe_sysroot_native,

for second time configure:
.m4 already copy under recipe_sysroot_native when run do_package last time

so if there is code related .m4 of autoconf-archive-native in the configure.ac
there will be differences and may cause problem.

Signed-off-by: Changqing Li <changqing.li@windriver.com>
---
 meta/recipes-devtools/rpm/rpm_4.14.1.bb | 1 +
 1 file changed, 1 insertion(+)

Patch hide | download patch | download mbox

diff --git a/meta/recipes-devtools/rpm/rpm_4.14.1.bb b/meta/recipes-devtools/rpm/rpm_4.14.1.bb
index e5e87d3..91617a4 100644
--- a/meta/recipes-devtools/rpm/rpm_4.14.1.bb
+++ b/meta/recipes-devtools/rpm/rpm_4.14.1.bb
@@ -52,6 +52,7 @@  S = "${WORKDIR}/git"
 
 DEPENDS = "nss libarchive db file popt xz bzip2 dbus elfutils python3"
 DEPENDS_append_class-native = " file-replacement-native bzip2-replacement-native"
+DEPENDS_remove_class-native = "dbus"
 
 inherit autotools gettext pkgconfig python3native
 export PYTHON_ABI

Comments

Peter Kjellerstedt Aug. 15, 2018, 9:36 a.m.
> -----Original Message-----
> From: openembedded-core-bounces@lists.openembedded.org <openembedded-
> core-bounces@lists.openembedded.org> On Behalf Of
> changqing.li@windriver.com
> Sent: den 15 augusti 2018 11:25
> To: openembedded-core@lists.openembedded.org
> Subject: [OE-core] [PATCH] rpm: remove depend on dbus for rpm native
> 
> From: Changqing Li <changqing.li@windriver.com>
> 
> This depend cause a big problem that for one package,
> build enviroment for clean compile and second time compile
> are different. And also rpm-native actually don't need to
> depend on dbus, so remove it.
> 
> Take libfastjson as example:
> (libfastjson don't have autoconf-archive-native in DEPEND)
> if don't remove this dependency, it will have below dependency list:
> libfastjson -> gcc-runtime -> libgcc -> glibc -> linux-libc-headers ->
> rpm-native
> rpm-native -> dbus-native
> dbus-native -> autoconf-archive-native
> 
> in this way:
> do_package of libfastjson will depend on do_populate_sysroot
> of autoconf-archive-native
> 
> for clean compile:
> during do_configure, since do_package not executed,  so .m4 files
> provide by autoconf-archive-native will not under
> recipe_sysroot_native,
> 
> for second time configure:
> .m4 already copy under recipe_sysroot_native when run do_package last
> time
> 
> so if there is code related .m4 of autoconf-archive-native in the
> configure.ac
> there will be differences and may cause problem.
> 
> Signed-off-by: Changqing Li <changqing.li@windriver.com>
> ---
>  meta/recipes-devtools/rpm/rpm_4.14.1.bb | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/meta/recipes-devtools/rpm/rpm_4.14.1.bb b/meta/recipes-
> devtools/rpm/rpm_4.14.1.bb
> index e5e87d3..91617a4 100644
> --- a/meta/recipes-devtools/rpm/rpm_4.14.1.bb
> +++ b/meta/recipes-devtools/rpm/rpm_4.14.1.bb
> @@ -52,6 +52,7 @@ S = "${WORKDIR}/git"
> 
> 
>  DEPENDS = "nss libarchive db file popt xz bzip2 dbus elfutils python3"
>  DEPENDS_append_class-native = " file-replacement-native bzip2-replacement-native"
> +DEPENDS_remove_class-native = "dbus"

Using _remove should be avoided in recipes since it is very 
hard to override it in a bbappend or .conf file. So I suggest 
this instead:

DEPENDS = "nss libarchive db file popt xz bzip2 elfutils python3"
DEPENDS_append_class-target = " dbus"
DEPENDS_append_class-native = " file-replacement-native bzip2-replacement-native"

> 
>  inherit autotools gettext pkgconfig python3native
>  export PYTHON_ABI
> --
> 2.7.4

//Peter
Alexander Kanavin Aug. 15, 2018, 9:38 a.m.
2018-08-15 11:24 GMT+02:00  <changqing.li@windriver.com>:
> for clean compile:
> during do_configure, since do_package not executed,  so .m4 files
> provide by autoconf-archive-native will not under recipe_sysroot_native,
>
> for second time configure:
> .m4 already copy under recipe_sysroot_native when run do_package last time
>
> so if there is code related .m4 of autoconf-archive-native in the configure.ac
> there will be differences and may cause problem.

I'm sorry, but this does not make sense. do_populate_sysroot is
executed only once, for all of the tasks. Can you provide steps to
reproduce the issue please?

Alex
Richard Purdie Aug. 15, 2018, 9:39 a.m.
On Wed, 2018-08-15 at 17:24 +0800, changqing.li@windriver.com wrote:
> From: Changqing Li <changqing.li@windriver.com>
> 
> This depend cause a big problem that for one package,
> build enviroment for clean compile and second time compile
> are different. And also rpm-native actually don't need to
> depend on dbus, so remove it.
> 
> Take libfastjson as example:
> (libfastjson don't have autoconf-archive-native in DEPEND)
> if don't remove this dependency, it will have below dependency list:
> libfastjson -> gcc-runtime -> libgcc -> glibc -> linux-libc-headers
> -> rpm-native
> rpm-native -> dbus-native
> dbus-native -> autoconf-archive-native
> 
> in this way:
> do_package of libfastjson will depend on do_populate_sysroot
> of autoconf-archive-native
> 
> for clean compile:
> during do_configure, since do_package not executed,  so .m4 files
> provide by autoconf-archive-native will not under
> recipe_sysroot_native,
> 
> for second time configure:
> .m4 already copy under recipe_sysroot_native when run do_package last
> time
> 
> so if there is code related .m4 of autoconf-archive-native in the
> configure.ac
> there will be differences and may cause problem.
> 
> Signed-off-by: Changqing Li <changqing.li@windriver.com>
> ---
>  meta/recipes-devtools/rpm/rpm_4.14.1.bb | 1 +
>  1 file changed, 1 insertion(+)

This is a little worrying. I think we need to blacklist that dependency
a little more strongly to ensure issues like this don't happen again,
particularly if its coming through a packaging dependency.

There is some code in sstate.bbclass, around the line "# Nothing need
depend on libc-initial/gcc-cross-initial" where we could do this. There
is a patch series from André Draszik, "sstate: allow specifying
indirect dependencies to exclude from sysroot" which would make this
easier to blacklist too.

> diff --git a/meta/recipes-devtools/rpm/rpm_4.14.1.bb b/meta/recipes-devtools/rpm/rpm_4.14.1.bb
> index e5e87d3..91617a4 100644
> --- a/meta/recipes-devtools/rpm/rpm_4.14.1.bb
> +++ b/meta/recipes-devtools/rpm/rpm_4.14.1.bb
> @@ -52,6 +52,7 @@ S = "${WORKDIR}/git"
>  
>  DEPENDS = "nss libarchive db file popt xz bzip2 dbus elfutils python3"
>  DEPENDS_append_class-native = " file-replacement-native bzip2-replacement-native"
> +DEPENDS_remove_class-native = "dbus"

I really don't like using _remove in OE-Core. Please restructure this
to do:

DEPENDS_append_class-target = "dbus"

or better, make the recipe use PACKAGECONFIG for this option. I'm
curious why we need dbus in the target case but not the native one
too...


Cheers,

Richard
Richard Purdie Aug. 15, 2018, 9:41 a.m.
On Wed, 2018-08-15 at 11:38 +0200, Alexander Kanavin wrote:
> 2018-08-15 11:24 GMT+02:00  <changqing.li@windriver.com>:
> > for clean compile:
> > during do_configure, since do_package not executed,  so .m4 files
> > provide by autoconf-archive-native will not under
> > recipe_sysroot_native,
> > 
> > for second time configure:
> > .m4 already copy under recipe_sysroot_native when run do_package
> > last time
> > 
> > so if there is code related .m4 of autoconf-archive-native in the
> > configure.ac
> > there will be differences and may cause problem.
> 
> I'm sorry, but this does not make sense. do_populate_sysroot is
> executed only once, for all of the tasks. Can you provide steps to
> reproduce the issue please?

It does actually make sense. do_package tasks have a dependency on rpm-
native. rpm-native would only be added to the sysroot at do_package
time. It won't be removed if configure reruns though. It seems rpm-
native will add the m4 files as bitbake can't tell real runtime
dependencies (libs) from data files in advance.

Cheers,

Richard