On Mon, 2022-01-31 at 22:39 +0100, Peter Kjellerstedt wrote:
> Break out the hardcoded values for the various debug info styles from
> split_and_strip_files() into bitbake variables. This allows the debug
> info styles to be adopted, and also allows new styles to be added
> (within the limits of the available variables).
> 
> Signed-off-by: Peter Kjellerstedt <[email protected]>
> ---
>  meta/classes/package.bbclass | 95 ++++++++++++++++++++++--------------
>  1 file changed, 58 insertions(+), 37 deletions(-)
> 
> diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
> index 4927fb99ff..a5358d5851 100644
> --- a/meta/classes/package.bbclass
> +++ b/meta/classes/package.bbclass
> @@ -1065,6 +1065,51 @@ python fixup_perms () {
>                      fix_perms(each_file, fs_perms_table[dir].fmode, 
> fs_perms_table[dir].fuid, fs_perms_table[dir].fgid, dir)
>  }
>  
> +# Debug info
> +PACKAGE_DEBUG_APPEND = "${@d.getVarFlag('PACKAGE_DEBUG_APPEND', 
> d.getVar('PACKAGE_DEBUG_SPLIT_STYLE'))}"
> +PACKAGE_DEBUG_STATICAPPEND = "${@d.getVarFlag('PACKAGE_DEBUG_STATICAPPEND', 
> d.getVar('PACKAGE_DEBUG_SPLIT_STYLE'))}"
> +PACKAGE_DEBUG_DIR = "${@d.getVarFlag('PACKAGE_DEBUG_DIR', 
> d.getVar('PACKAGE_DEBUG_SPLIT_STYLE'))}"
> +PACKAGE_DEBUG_STATICDIR = "${@d.getVarFlag('PACKAGE_DEBUG_STATICDIR', 
> d.getVar('PACKAGE_DEBUG_SPLIT_STYLE'))}"
> +PACKAGE_DEBUG_LIBDIR = "${@d.getVarFlag('PACKAGE_DEBUG_LIBDIR', 
> d.getVar('PACKAGE_DEBUG_SPLIT_STYLE'))}"
> +PACKAGE_DEBUG_STATICLIBDIR = "${@d.getVarFlag('PACKAGE_DEBUG_STATICLIBDIR', 
> d.getVar('PACKAGE_DEBUG_SPLIT_STYLE'))}"
> +PACKAGE_DEBUG_SRCDIR = "${@d.getVarFlag('PACKAGE_DEBUG_SRCDIR', 
> d.getVar('PACKAGE_DEBUG_SPLIT_STYLE'))}"
> +
> +# Original OE-core, a.k.a. ".debug", style debug info
> +PACKAGE_DEBUG_APPEND[.debug] = ""
> +PACKAGE_DEBUG_STATICAPPEND[.debug] = ""
> +PACKAGE_DEBUG_DIR[.debug] = "/.debug"
> +PACKAGE_DEBUG_STATICDIR[.debug] = "/.debug-static"
> +PACKAGE_DEBUG_LIBDIR[.debug] = ""
> +PACKAGE_DEBUG_STATICLIBDIR[.debug] = ""
> +PACKAGE_DEBUG_SRCDIR[.debug] = "/usr/src/debug"
> +
> +# Single debug-file-directory style debug info
> +PACKAGE_DEBUG_APPEND[debug-file-directory] = ".debug"
> +PACKAGE_DEBUG_STATICAPPEND[debug-file-directory] = ""
> +PACKAGE_DEBUG_DIR[debug-file-directory] = ""
> +PACKAGE_DEBUG_STATICDIR[debug-file-directory] = ""
> +PACKAGE_DEBUG_LIBDIR[debug-file-directory] = "/usr/lib/debug"
> +PACKAGE_DEBUG_STATICLIBDIR[debug-file-directory] = "/usr/lib/debug-static"
> +PACKAGE_DEBUG_SRCDIR[debug-file-directory] = "/usr/src/debug"
> +
> +# Debug info without sources in /usr/src/debug
> +PACKAGE_DEBUG_APPEND[debug-without-src] = ""
> +PACKAGE_DEBUG_STATICAPPEND[debug-without-src] = ""
> +PACKAGE_DEBUG_DIR[debug-without-src] = "/.debug"
> +PACKAGE_DEBUG_STATICDIR[debug-without-src] = "/.debug-static"
> +PACKAGE_DEBUG_LIBDIR[debug-without-src] = ""
> +PACKAGE_DEBUG_STATICLIBDIR[debug-without-src] = ""
> +PACKAGE_DEBUG_SRCDIR[debug-without-src] = ""
> +
> +# Debug info with separate -src packages
> +PACKAGE_DEBUG_APPEND[debug-with-srcpkg] = ""
> +PACKAGE_DEBUG_STATICAPPEND[debug-with-srcpkg] = ""
> +PACKAGE_DEBUG_DIR[debug-with-srcpkg] = "/.debug"
> +PACKAGE_DEBUG_STATICDIR[debug-with-srcpkg] = "/.debug-static"
> +PACKAGE_DEBUG_LIBDIR[debug-with-srcpkg] = ""
> +PACKAGE_DEBUG_STATICLIBDIR[debug-with-srcpkg] = ""
> +PACKAGE_DEBUG_SRCDIR[debug-with-srcpkg] = "/usr/src/debug"
> +
>  python split_and_strip_files () {
>      import stat, errno
>      import subprocess


I can see what you've done and why but I'm not really sure this is an
improvement, it adds a ton of "global" variables which are only every used in a
very specific use case. I'm also particularly not keen on mapping the flags into
the real variables with online python. It isn't going to help our overall
parsing performance in the long run.

I'm torn on it but at least wanted to share my first thoughts looking at it...

Cheers,

Richard


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#161154): 
https://lists.openembedded.org/g/openembedded-core/message/161154
Mute This Topic: https://lists.openembedded.org/mt/88819087/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to