Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Martin Jansa <martin.jansa@gmail.com>
To: kai.kang@windriver.com
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH 1/7] allarch: only enable allarch when multilib is not used
Date: Thu, 13 Sep 2018 22:10:46 +0200	[thread overview]
Message-ID: <20180913201046.GB1437@jama> (raw)
In-Reply-To: <20180913182007.GA1437@jama>

[-- Attachment #1: Type: text/plain, Size: 8568 bytes --]

On Thu, Sep 13, 2018 at 08:20:07PM +0200, Martin Jansa wrote:
> On Thu, Sep 06, 2018 at 11:52:24PM +0800, kai.kang@windriver.com wrote:
> > From: Kai Kang <kai.kang@windriver.com>
> > 
> > Some allarch packages rdepends non-allarch packages. when multilib is
> > used, it doesn't expand the dependency chain correctly, e.g.
> > 
> > core-image-sato -> ca-certificates(allarch) -> openssl
> > 
> > we expect dependency chain for lib32-core-image-sato:
> > 
> > lib32-core-image-sato -> ca-certificates(allarch) -> lib32-openssl
> > 
> > it should install lib32-openssl for ca-certificates but openssl is still
> > wrongly required.
> > 
> > Only enable allarch when multilib is not used to fix the issue.
> > 
> > signed-off-by: kai kang <kai.kang@windriver.com>
> > ---
> >  meta/classes/allarch.bbclass         | 12 +++++++++++-
> >  meta/classes/icecc.bbclass           |  2 +-
> >  meta/classes/multilib.bbclass        |  3 ++-
> >  meta/classes/multilib_global.bbclass |  4 +---
> >  meta/classes/package.bbclass         |  9 ++++++---
> >  5 files changed, 21 insertions(+), 9 deletions(-)
> > 
> > diff --git a/meta/classes/allarch.bbclass b/meta/classes/allarch.bbclass
> > index 1eebe0bf2e..45f62a5939 100644
> > --- a/meta/classes/allarch.bbclass
> > +++ b/meta/classes/allarch.bbclass
> > @@ -2,7 +2,17 @@
> >  # This class is used for architecture independent recipes/data files (usually scripts)
> >  #
> >  
> > -PACKAGE_ARCH = "all"
> > +python allarch_package_arch_handler () {
> > +    if bb.data.inherits_class("nativesdk", d) or bb.data.inherits_class("crosssdk", d):
> > +        return
> > +
> > +    variants = d.getVar("MULTILIB_VARIANTS")
> > +    if not variants:
> > +        d.setVar("PACKAGE_ARCH", "all" )
> > +}
> > +
> > +addhandler allarch_package_arch_handler
> > +allarch_package_arch_handler[eventmask] = "bb.event.RecipePreFinalise"
> 
> Maybe I'm overlooking something, but doesn't this overwrite whatever
> PACKAGE_ARCH as set before this?
> 
> I have some recipes where the PACKAGE_ARCH is set to MACHINE_ARCH through
> another bbclass, but then overwritten with "all" by allarch_package_arch_handler:
> 
> # $PACKAGE_ARCH [5 operations]
> #   set oe-core/meta/conf/bitbake.conf:150
> #     [_defaultval] "${TUNE_PKGARCH}"
> #   set meta-lg-webos/meta-webos/conf/distro/include/webos.inc:241
> #     "${MACHINE_ARCH}"
> #   set oe-core/meta/conf/documentation.conf:304
> #     [doc] "The architecture of the resulting package or packages."
> #   set meta-lg-webos/meta-webos/classes/webos_machine_impl_dep.bbclass:11
> #     "${MACHINE_ARCH}"
> #   set allarch.bbclass:12 [allarch_package_arch_handler]
> #     "all"
> # pre-expansion value:
> #   "all"
> PACKAGE_ARCH="all"
> 
> But surprisingly if I do the same with e.g. packagegroup-core-boot in oe-core I get:
> 
> # $PACKAGE_ARCH [4 operations]
> #   set /OE/build/oe-core/openembedded-core/meta/conf/bitbake.conf:150
> #     [_defaultval] "${TUNE_PKGARCH}"
> #   set /OE/build/oe-core/openembedded-core/meta/conf/documentation.conf:304
> #     [doc] "The architecture of the resulting package or packages."
> #   set /OE/build/oe-core/openembedded-core/meta/recipes-core/packagegroups/packagegroup-core-boot.bb:9
> #     "${MACHINE_ARCH}"
> #   set? /OE/build/oe-core/openembedded-core/meta/classes/packagegroup.bbclass:12
> #     "all"
> # pre-expansion value:
> #   "${MACHINE_ARCH}"
> PACKAGE_ARCH="qemux86_64"
> 
> Why isn't allarch_package_arch_handler executed in the 2nd case?

Now I see the difference, I was still living in the days when
"disabling" allarch was possible just by setting PACKAGE_ARCH before
inheritting allarch, but now I see that packagegroups do conditional
inherit as well since:
http://git.openembedded.org/openembedded-core/commit/?id=9c826962ec8fa45c2b035427442b90a41517144e
http://git.openembedded.org/openembedded-core/commit/?id=2c9b1d304daade7b0907320aeb9c522e7ab9dcab
so I'll modify currently failing recipes to do the same and stop
inheritting allarch when PACKAGE_ARCH is set to something else.

Cheers,

> >  python () {
> >      # Allow this class to be included but overridden - only set
> > diff --git a/meta/classes/icecc.bbclass b/meta/classes/icecc.bbclass
> > index 0ca8de86c2..b5a8457747 100644
> > --- a/meta/classes/icecc.bbclass
> > +++ b/meta/classes/icecc.bbclass
> > @@ -171,7 +171,7 @@ def use_icecc(bb,d):
> >      return "yes"
> >  
> >  def icecc_is_allarch(bb, d):
> > -    return d.getVar("PACKAGE_ARCH") == "all" or bb.data.inherits_class('allarch', d)
> > +    return d.getVar("PACKAGE_ARCH") == "all"
> >  
> >  def icecc_is_kernel(bb, d):
> >      return \
> > diff --git a/meta/classes/multilib.bbclass b/meta/classes/multilib.bbclass
> > index f2ac8bdfef..7b4d6472b0 100644
> > --- a/meta/classes/multilib.bbclass
> > +++ b/meta/classes/multilib.bbclass
> > @@ -50,7 +50,8 @@ python multilib_virtclass_handler () {
> >      if bb.data.inherits_class('nativesdk', e.data) or bb.data.inherits_class('crosssdk', e.data):
> >          raise bb.parse.SkipRecipe("We can't extend nativesdk recipes")
> >  
> > -    if bb.data.inherits_class('allarch', e.data) and not bb.data.inherits_class('packagegroup', e.data):
> > +    if bb.data.inherits_class('allarch', e.data) and not d.getVar('MULTILIB_VARIANTS') \
> > +        and not bb.data.inherits_class('packagegroup', e.data):
> >          raise bb.parse.SkipRecipe("Don't extend allarch recipes which are not packagegroups")
> >  
> >      # Expand this since this won't work correctly once we set a multilib into place
> > diff --git a/meta/classes/multilib_global.bbclass b/meta/classes/multilib_global.bbclass
> > index d2ec1adfea..1bb62427b0 100644
> > --- a/meta/classes/multilib_global.bbclass
> > +++ b/meta/classes/multilib_global.bbclass
> > @@ -165,9 +165,7 @@ python multilib_virtclass_handler_global () {
> >          return
> >  
> >      if bb.data.inherits_class('kernel', e.data) or \
> > -            bb.data.inherits_class('module-base', e.data) or \
> > -            (bb.data.inherits_class('allarch', e.data) and\
> > -             not bb.data.inherits_class('packagegroup', e.data)):
> > +            bb.data.inherits_class('module-base', e.data):
> >              variants = (e.data.getVar("MULTILIB_VARIANTS") or "").split()
> >  
> >              import oe.classextend
> > diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
> > index 0b6f65a855..d1e9138c66 100644
> > --- a/meta/classes/package.bbclass
> > +++ b/meta/classes/package.bbclass
> > @@ -494,7 +494,8 @@ def get_package_mapping (pkg, basepkg, d):
> >  
> >      if key in data:
> >          # Have to avoid undoing the write_extra_pkgs(global_variants...)
> > -        if bb.data.inherits_class('allarch', d) and data[key] == basepkg:
> > +        if bb.data.inherits_class('allarch', d) and not d.getVar('MULTILIB_VARIANTS') \
> > +            and data[key] == basepkg:
> >              return pkg
> >          return data[key]
> >  
> > @@ -1413,7 +1414,8 @@ fi
> >      if bb.data.inherits_class('kernel', d) or bb.data.inherits_class('module-base', d):
> >          write_extra_pkgs(variants, pn, packages, pkgdatadir)
> >  
> > -    if (bb.data.inherits_class('allarch', d) and not bb.data.inherits_class('packagegroup', d)):
> > +    if bb.data.inherits_class('allarch', d) and not variants \
> > +        and not bb.data.inherits_class('packagegroup', d):
> >          write_extra_pkgs(global_variants, pn, packages, pkgdatadir)
> >  
> >      workdir = d.getVar('WORKDIR')
> > @@ -1502,7 +1504,8 @@ fi
> >      if bb.data.inherits_class('kernel', d) or bb.data.inherits_class('module-base', d):
> >          write_extra_runtime_pkgs(variants, packages, pkgdatadir)
> >  
> > -    if bb.data.inherits_class('allarch', d) and not bb.data.inherits_class('packagegroup', d):
> > +    if bb.data.inherits_class('allarch', d) and not variants \
> > +        and not bb.data.inherits_class('packagegroup', d):
> >          write_extra_runtime_pkgs(global_variants, packages, pkgdatadir)
> >  
> >  }
> > -- 
> > 2.18.0
> > 
> > -- 
> > _______________________________________________
> > Openembedded-core mailing list
> > Openembedded-core@lists.openembedded.org
> > http://lists.openembedded.org/mailman/listinfo/openembedded-core
> 
> -- 
> Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com



-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 201 bytes --]

  reply	other threads:[~2018-09-13 20:10 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-06 15:52 [PATCH v5 0/7] disable allarch when multilib is used kai.kang
2018-09-06 15:52 ` [PATCH 1/7] allarch: only enable allarch when multilib is not used kai.kang
2018-09-13 18:20   ` Martin Jansa
2018-09-13 20:10     ` Martin Jansa [this message]
2018-09-14 11:25       ` Martin Jansa
2018-09-14 14:12         ` Martin Jansa
2018-09-17  2:25           ` Kang Kai
2018-09-17  5:50             ` Martin Jansa
2019-01-17 16:10             ` Dan Dedrick
2019-01-17 22:19               ` Richard Purdie
2018-09-06 15:52 ` [PATCH 2/7] sstate.bbclass: update SSTATE_DUPWHITELIST kai.kang
2018-09-06 15:52 ` [PATCH 3/7] update_font_cache: update script for multilib kai.kang
2018-09-06 15:52 ` [PATCH 4/7] update_gtk_immodules_cache: update " kai.kang
2018-09-06 15:52 ` [PATCH 5/7] statetests.py: drop test_sstate_allarch_samesigs_multilib kai.kang
2018-09-06 15:52 ` [PATCH 6/7] multilib: fix install file conflicts kai.kang
2018-09-06 22:31   ` richard.purdie
2018-09-07  1:22     ` Kang Kai
2018-09-06 15:52 ` [PATCH 7/7] target-sdk-provides-dummy: skip package_qa_multilib check kai.kang
2018-09-06 17:04 ` ✗ patchtest: failure for disable allarch when multilib is used Patchwork
2018-09-07  8:32 ` [PATCH v5 0/7] " richard.purdie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180913201046.GB1437@jama \
    --to=martin.jansa@gmail.com \
    --cc=kai.kang@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox