diff mbox series

[kirkstone,10/13] native: Drop special variable handling

Message ID 47a2634831f907d83ec40ad010351c923ef67f0d.1675289652.git.steve@sakoman.com
State New, archived
Headers show
Series [kirkstone,01/13] ppp: backport fix for CVE-2022-4603 | expand

Commit Message

Steve Sakoman Feb. 1, 2023, 10:16 p.m. UTC
From: Richard Purdie <richard.purdie@linuxfoundation.org>

Back when it was merged in https://git.yoctoproject.org/poky/commit/?id=c4257ed8b1040a5a0e9a95846d81961741239116
it appeared special handling in setVar was necessary. Likely due to
other fixes and improvements it no longer appears to be. The results of
"bitbake world -g" before and after this change are identical for oe-core
and meta-openembedded. Therefore drop the "parsing=True" special parameter to
setVar() meaning overrides can now be cleared.

This means that something like:

DEPENDS:append = " bash"

now functions as expected, adding bash to the target recipe and bash-native to
the native BBCLASSEXTENDED version.

Without this change, it would add bash to the native version as well as
bash-native which is clearly incorrect.

[YOCTO #15010]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 99a5105f7b5303cd36077b5910c662a865c1782c)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
---
 meta/classes/native.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Richard Purdie Feb. 2, 2023, 11:42 a.m. UTC | #1
On Wed, 2023-02-01 at 12:16 -1000, Steve Sakoman wrote:
> From: Richard Purdie <richard.purdie@linuxfoundation.org>
> 
> Back when it was merged in https://git.yoctoproject.org/poky/commit/?id=c4257ed8b1040a5a0e9a95846d81961741239116
> it appeared special handling in setVar was necessary. Likely due to
> other fixes and improvements it no longer appears to be. The results of
> "bitbake world -g" before and after this change are identical for oe-core
> and meta-openembedded. Therefore drop the "parsing=True" special parameter to
> setVar() meaning overrides can now be cleared.
> 
> This means that something like:
> 
> DEPENDS:append = " bash"
> 
> now functions as expected, adding bash to the target recipe and bash-native to
> the native BBCLASSEXTENDED version.
> 
> Without this change, it would add bash to the native version as well as
> bash-native which is clearly incorrect.
> 
> [YOCTO #15010]
> 
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> (cherry picked from commit 99a5105f7b5303cd36077b5910c662a865c1782c)
> Signed-off-by: Steve Sakoman <steve@sakoman.com>
> ---
>  meta/classes/native.bbclass | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meta/classes/native.bbclass b/meta/classes/native.bbclass
> index fc7422c5d7..4de96cd59b 100644
> --- a/meta/classes/native.bbclass
> +++ b/meta/classes/native.bbclass
> @@ -153,7 +153,7 @@ python native_virtclass_handler () {
>                  newdeps.append(dep.replace(pn, bpn) + "-native")
>              else:
>                  newdeps.append(dep)
> -        d.setVar(varname, " ".join(newdeps), parsing=True)
> +        d.setVar(varname, " ".join(newdeps))
>  
>      map_dependencies("DEPENDS", e.data, selfref=False)
>      for pkg in e.data.getVar("PACKAGES", False).split():

Steve: Did you check "bitbake world -g" is the same before and after
this change for kirkstone?

Cheers,

Richard
Steve Sakoman Feb. 2, 2023, 2:01 p.m. UTC | #2
On Thu, Feb 2, 2023 at 1:42 AM Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
>
> On Wed, 2023-02-01 at 12:16 -1000, Steve Sakoman wrote:
> > From: Richard Purdie <richard.purdie@linuxfoundation.org>
> >
> > Back when it was merged in https://git.yoctoproject.org/poky/commit/?id=c4257ed8b1040a5a0e9a95846d81961741239116
> > it appeared special handling in setVar was necessary. Likely due to
> > other fixes and improvements it no longer appears to be. The results of
> > "bitbake world -g" before and after this change are identical for oe-core
> > and meta-openembedded. Therefore drop the "parsing=True" special parameter to
> > setVar() meaning overrides can now be cleared.
> >
> > This means that something like:
> >
> > DEPENDS:append = " bash"
> >
> > now functions as expected, adding bash to the target recipe and bash-native to
> > the native BBCLASSEXTENDED version.
> >
> > Without this change, it would add bash to the native version as well as
> > bash-native which is clearly incorrect.
> >
> > [YOCTO #15010]
> >
> > Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> > Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
> > Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> > (cherry picked from commit 99a5105f7b5303cd36077b5910c662a865c1782c)
> > Signed-off-by: Steve Sakoman <steve@sakoman.com>
> > ---
> >  meta/classes/native.bbclass | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/meta/classes/native.bbclass b/meta/classes/native.bbclass
> > index fc7422c5d7..4de96cd59b 100644
> > --- a/meta/classes/native.bbclass
> > +++ b/meta/classes/native.bbclass
> > @@ -153,7 +153,7 @@ python native_virtclass_handler () {
> >                  newdeps.append(dep.replace(pn, bpn) + "-native")
> >              else:
> >                  newdeps.append(dep)
> > -        d.setVar(varname, " ".join(newdeps), parsing=True)
> > +        d.setVar(varname, " ".join(newdeps))
> >
> >      map_dependencies("DEPENDS", e.data, selfref=False)
> >      for pkg in e.data.getVar("PACKAGES", False).split():
>
> Steve: Did you check "bitbake world -g" is the same before and after
> this change for kirkstone?

task-depends.dot files are identical with and without this patch.

Ordering of pn-buildlist is different before and after, but sorted
they are identical.

Steve
diff mbox series

Patch

diff --git a/meta/classes/native.bbclass b/meta/classes/native.bbclass
index fc7422c5d7..4de96cd59b 100644
--- a/meta/classes/native.bbclass
+++ b/meta/classes/native.bbclass
@@ -153,7 +153,7 @@  python native_virtclass_handler () {
                 newdeps.append(dep.replace(pn, bpn) + "-native")
             else:
                 newdeps.append(dep)
-        d.setVar(varname, " ".join(newdeps), parsing=True)
+        d.setVar(varname, " ".join(newdeps))
 
     map_dependencies("DEPENDS", e.data, selfref=False)
     for pkg in e.data.getVar("PACKAGES", False).split():