staging: remove hard-coded values from _FIXMEs
PATCH 1/1 staging: remove hard-coded values from _FIXMEs
Let users to override these values in their layers and could match them with values in EXTRA_STAGING_FIXMES.
--- meta/classes/staging.bbclass | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
meta/classes/staging.bbclass +3 -1
@@ -127,6 +127,8 @@ python do_populate_sysroot_setscene () { } addtask do_populate_sysroot_setscene +SYSROOT_STAGING_FIXMES ?= "COMPONENTS_DIR HOSTTOOLS_DIR PKGDATA_DIR PSEUDO_LOCALSTATEDIR LOGFIFO" + def staging_copyfile(c, target, dest, postinsts, seendirs): import errno
@@ -167,7 +169,7 @@ def staging_processfixme(fixme, target, recipesysroot, recipesysrootnative, d): if not fixme: return cmd = "sed -e 's:^[^/]*/:%s/:g' %s | xargs sed -i -e 's:FIXMESTAGINGDIRTARGET:%s:g; s:FIXMESTAGINGDIRHOST:%s:g'" % (target, " ".join(fixme), recipesysroot, recipesysrootnative) - for fixmevar in ['COMPONENTS_DIR', 'HOSTTOOLS_DIR', 'PKGDATA_DIR', 'PSEUDO_LOCALSTATEDIR', 'LOGFIFO']: + for fixmevar in d.getVar("SYSROOT_STAGING_FIXMES").split(): fixme_path = d.getVar(fixmevar) cmd += " -e 's:FIXME_%s:%s:g'" % (fixmevar, fixme_path) bb.debug(2, cmd)
Signature · 1 line
2.11.0
Quoted 34 lines · Andrej Valek
Let users to override these values in their layers and could match them
with values inEXTRA_STAGING_FIXMES.Signed-off-by Andrej Valek <[email protected]>--- meta/classes/staging.bbclass | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)meta/classes/staging.bbclass +1
-0@@ -127,6 +127,8 @@ python do_populate_sysroot_setscene () { } addtask do_populate_sysroot_setscene +SYSROOT_STAGING_FIXMES ?= "COMPONENTS_DIR HOSTTOOLS_DIR PKGDATA_DIR
PSEUDO_LOCALSTATEDIRLOGFIFO"meta/classes/staging.bbclass +1
-0+ def staging_copyfile(c, target, dest, postinsts, seendirs): import errno@@ -167,7 +169,7 @@ def staging_processfixme(fixme, target,recipesysroot, recipesysrootnative, d):
if not fixme:
return
cmd = "sed -e 's:^[^/]*/:%s/:g' %s | xargs sed -i -e
's:FIXMESTAGINGDIRTARGET:%s:g; s:FIXMESTAGINGDIRHOST:%s:g'" % (target, " ".join(fixme), recipesysroot, recipesysrootnative)
- for fixmevar in ['COMPONENTS_DIR', 'HOSTTOOLS_DIR',
'PKGDATA_DIR', 'PSEUDO_LOCALSTATEDIR', 'LOGFIFO']:
+ for fixmevar in d.getVar("SYSROOT_STAGING_FIXMES").split():
Quoted 3 lines
fixme_path = d.getVar(fixmevar)
cmd += " -e 's:FIXME_%s:%s:g'" % (fixmevar, fixme_path)
bb.debug(2, cmd)I think this was deliberately left this way rather than letting users override it as the scope issues around this are not obvious and making it a variable gives users expectations which may not be met.
I'm going from memory with jetlag but I think that this variable would not work from recipe context, you'd have to do it in global scope and changing this in global scope for everything is a pretty serious change.
The reason is that it can get called when building any recipe sysroot so the datastore isn't to context of the original creator.
Cheers,
Richard
Hi Richard,
I have sent this patch, because of modification this replacement. What about adding TMPDIR into this hard-coded array? I think, even if it isn't added into EXTRA_STAGING_FIXMES it shouldn't influence default behavior.
Regards,
Andrej
Quoted 55 lines · Richard Purdie
Quoted 34 lines · Andrej Valek
Let users to override these values in their layers and could match them
with values inEXTRA_STAGING_FIXMES.Signed-off-by Andrej Valek <[email protected]>--- meta/classes/staging.bbclass | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)meta/classes/staging.bbclass +1
-0@@ -127,6 +127,8 @@ python do_populate_sysroot_setscene () { } addtask do_populate_sysroot_setscene +SYSROOT_STAGING_FIXMES ?= "COMPONENTS_DIR HOSTTOOLS_DIR PKGDATA_DIR
PSEUDO_LOCALSTATEDIRLOGFIFO"meta/classes/staging.bbclass +1
-0+ def staging_copyfile(c, target, dest, postinsts, seendirs): import errno@@ -167,7 +169,7 @@ def staging_processfixme(fixme, target,recipesysroot, recipesysrootnative, d):
if not fixme:
return
cmd = "sed -e 's:^[^/]*/:%s/:g' %s | xargs sed -i -e
's:FIXMESTAGINGDIRTARGET:%s:g; s:FIXMESTAGINGDIRHOST:%s:g'" % (target, " ".join(fixme), recipesysroot, recipesysrootnative)
- for fixmevar in ['COMPONENTS_DIR', 'HOSTTOOLS_DIR',
'PKGDATA_DIR', 'PSEUDO_LOCALSTATEDIR', 'LOGFIFO']:
+ for fixmevar in d.getVar("SYSROOT_STAGING_FIXMES").split():Quoted 3 lines
fixme_path = d.getVar(fixmevar) cmd += " -e 's:FIXME_%s:%s:g'" % (fixmevar, fixme_path) bb.debug(2, cmd)I think this was deliberately left this way rather than letting users override it as the scope issues around this are not obvious and making it a variable gives users expectations which may not be met.
I'm going from memory with jetlag but I think that this variable would not work from recipe context, you'd have to do it in global scope and changing this in global scope for everything is a pretty serious change.
The reason is that it can get called when building any recipe sysroot so the datastore isn't to context of the original creator.
Cheers,
Richard
Hi Richard,
Di you have some time to think about it?
Regards,
Andrej
-----Original Message-----
From: Andrej Valek [mailto:[email protected]]
Sent: 19. septembra 2018 15:09
To: Richard Purdie; [email protected]
Subject: Re: [OE-core] [PATCH] staging: remove hard-coded values from _FIXMEs
Hi Richard,
I have sent this patch, because of modification this replacement. What about adding TMPDIR into this hard-coded array? I think, even if it isn't added into EXTRA_STAGING_FIXMES it shouldn't influence default behavior.
Regards,
Andrej
Quoted 52 lines · Richard Purdie
Quoted 31 lines · Andrej Valek
Let users to override these values in their layers and could match them with values in
EXTRA_STAGING_FIXMES.Signed-off-by Andrej Valek <[email protected]>--- meta/classes/staging.bbclass | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)(quoted diff) +0
-0b/meta/classes/staging.bbclass index
84e13bab59..6db501dac1100644meta/classes/staging.bbclass +0
-0@@ -127,6 +127,8 @@ python do_populate_sysroot_setscene () { }addtask
do_populate_sysroot_setscene+SYSROOT_STAGING_FIXMES ?= "
COMPONENTS_DIRHOSTTOOLS_DIRPKGDATA_DIRPSEUDO_LOCALSTATEDIRLOGFIFO"meta/classes/staging.bbclass +1
-0+ def staging_copyfile(c, target, dest, postinsts, seendirs): import errno@@ -167,7 +169,7 @@ def staging_processfixme(fixme, target,recipesysroot, recipesysrootnative, d):
if not fixme:
return
cmd = "sed -e 's:^[^/]*/:%s/:g' %s | xargs sed -i -e
's:FIXMESTAGINGDIRTARGET:%s:g; s:FIXMESTAGINGDIRHOST:%s:g'" % (target, " ".join(fixme), recipesysroot, recipesysrootnative)
- for fixmevar in ['COMPONENTS_DIR', 'HOSTTOOLS_DIR',
'PKGDATA_DIR', 'PSEUDO_LOCALSTATEDIR', 'LOGFIFO']:
+ for fixmevar in d.getVar("SYSROOT_STAGING_FIXMES").split():Quoted 3 lines
fixme_path = d.getVar(fixmevar) cmd += " -e 's:FIXME_%s:%s:g'" % (fixmevar, fixme_path) bb.debug(2, cmd)I think this was deliberately left this way rather than letting users override it as the scope issues around this are not obvious and making it a variable gives users expectations which may not be met.
I'm going from memory with jetlag but I think that this variable would not work from recipe context, you'd have to do it in global scope and changing this in global scope for everything is a pretty serious change.
The reason is that it can get called when building any recipe sysroot so the datastore isn't to context of the original creator.
Cheers,
Richard
Quoted 7 lines · Andrej Valek
Hi Richard,
I have sent this patch, because of modification this replacement. What
about adding TMPDIR into this hard-coded array? I think, even if it isn't added intoEXTRA_STAGING_FIXMESit shouldn't influence default behavior.
The reason I wasn't keen on the patch is exactly because people will add TMPDIR into it and that can hide a number of problems which should really be better solved in other ways. I didn't want this to become a workaround for fixing things in the recipes.
So yes, I understand why you might want to do this, I'm still not convinced its a good idea. There was a good reason this was hard coded but I still haven't had the time to look more into exactly why that was :(.
Cheers,
Richard