All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] glibc-tests: Correct PACKAGE_DEBUG_SPLIT_STYLE
@ 2022-01-31 21:39 Peter Kjellerstedt
  2022-01-31 21:39 ` [PATCH 2/2] packages.bbclass: Break out the debug info styles to bitbake variables Peter Kjellerstedt
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Kjellerstedt @ 2022-01-31 21:39 UTC (permalink / raw)
  To: openembedded-core

It was set to "debug", but the officially supported value is ".debug".

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
---
 meta/recipes-core/glibc/glibc-tests_2.34.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-core/glibc/glibc-tests_2.34.bb b/meta/recipes-core/glibc/glibc-tests_2.34.bb
index 9cbf8776dd..8c7ecf89ba 100644
--- a/meta/recipes-core/glibc/glibc-tests_2.34.bb
+++ b/meta/recipes-core/glibc/glibc-tests_2.34.bb
@@ -102,7 +102,7 @@ EXCLUDE_FROM_SHLIBS = "1"
 # It is more handy to have _all_ the sources and symbols in one
 # place (package) as this recipe will be used for validation and
 # debugging.
-PACKAGE_DEBUG_SPLIT_STYLE = "debug"
+PACKAGE_DEBUG_SPLIT_STYLE = ".debug"
 
 # glibc test cases violate by default some Yocto/OE checks (staticdev,
 # textrel)


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] packages.bbclass: Break out the debug info styles to bitbake variables
  2022-01-31 21:39 [PATCH 1/2] glibc-tests: Correct PACKAGE_DEBUG_SPLIT_STYLE Peter Kjellerstedt
@ 2022-01-31 21:39 ` Peter Kjellerstedt
  2022-02-01  8:13   ` [OE-core] " Richard Purdie
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Kjellerstedt @ 2022-01-31 21:39 UTC (permalink / raw)
  To: openembedded-core

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 <peter.kjellerstedt@axis.com>
---
 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
@@ -1076,42 +1121,18 @@ python split_and_strip_files () {
     oldcwd = os.getcwd()
     os.chdir(dvar)
 
-    # We default to '.debug' style
-    if d.getVar('PACKAGE_DEBUG_SPLIT_STYLE') == 'debug-file-directory':
-        # Single debug-file-directory style debug info
-        debugappend = ".debug"
-        debugstaticappend = ""
-        debugdir = ""
-        debugstaticdir = ""
-        debuglibdir = "/usr/lib/debug"
-        debugstaticlibdir = "/usr/lib/debug-static"
-        debugsrcdir = "/usr/src/debug"
-    elif d.getVar('PACKAGE_DEBUG_SPLIT_STYLE') == 'debug-without-src':
-        # Original OE-core, a.k.a. ".debug", style debug info, but without sources in /usr/src/debug
-        debugappend = ""
-        debugstaticappend = ""
-        debugdir = "/.debug"
-        debugstaticdir = "/.debug-static"
-        debuglibdir = ""
-        debugstaticlibdir = ""
-        debugsrcdir = ""
-    elif d.getVar('PACKAGE_DEBUG_SPLIT_STYLE') == 'debug-with-srcpkg':
-        debugappend = ""
-        debugstaticappend = ""
-        debugdir = "/.debug"
-        debugstaticdir = "/.debug-static"
-        debuglibdir = ""
-        debugstaticlibdir = ""
-        debugsrcdir = "/usr/src/debug"
-    else:
-        # Original OE-core, a.k.a. ".debug", style debug info
-        debugappend = ""
-        debugstaticappend = ""
-        debugdir = "/.debug"
-        debugstaticdir = "/.debug-static"
-        debuglibdir = ""
-        debugstaticlibdir = ""
-        debugsrcdir = "/usr/src/debug"
+    # Sanity test that PACKAGE_DEBUG_SPLIT_STYLE has a valid value.
+    if d.getVarFlag('PACKAGE_DEBUG_APPEND', d.getVar('PACKAGE_DEBUG_SPLIT_STYLE')) is None:
+        bb.fatal("Unknown PACKAGE_DEBUG_SPLIT_STYLE specified: %s" %
+                 d.getVar('PACKAGE_DEBUG_SPLIT_STYLE'))
+
+    debugappend = d.getVar('PACKAGE_DEBUG_APPEND')
+    debugstaticappend = d.getVar('PACKAGE_DEBUG_STATICAPPEND')
+    debugdir = d.getVar('PACKAGE_DEBUG_DIR')
+    debugstaticdir = d.getVar('PACKAGE_DEBUG_STATICDIR')
+    debuglibdir = d.getVar('PACKAGE_DEBUG_LIBDIR')
+    debugstaticlibdir = d.getVar('PACKAGE_DEBUG_STATICLIBDIR')
+    debugsrcdir = d.getVar('PACKAGE_DEBUG_SRCDIR')
 
     #
     # First lets figure out all of the files we may have to process ... do this only once!
@@ -1338,7 +1359,7 @@ python populate_packages () {
     
     autodebug = not (d.getVar("NOAUTOPACKAGEDEBUG") or False)
 
-    split_source_package = (d.getVar('PACKAGE_DEBUG_SPLIT_STYLE') == 'debug-with-srcpkg')
+    split_source_package = (d.getVar('PACKAGE_DEBUG_SPLIT_STYLE').endswith('-with-srcpkg'))
 
     # If debug-with-srcpkg mode is enabled then add the source package if it
     # doesn't exist and add the source file contents to the source package.


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [OE-core] [PATCH 2/2] packages.bbclass: Break out the debug info styles to bitbake variables
  2022-01-31 21:39 ` [PATCH 2/2] packages.bbclass: Break out the debug info styles to bitbake variables Peter Kjellerstedt
@ 2022-02-01  8:13   ` Richard Purdie
  0 siblings, 0 replies; 3+ messages in thread
From: Richard Purdie @ 2022-02-01  8:13 UTC (permalink / raw)
  To: Peter Kjellerstedt, openembedded-core

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 <peter.kjellerstedt@axis.com>
> ---
>  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




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-02-01  8:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-31 21:39 [PATCH 1/2] glibc-tests: Correct PACKAGE_DEBUG_SPLIT_STYLE Peter Kjellerstedt
2022-01-31 21:39 ` [PATCH 2/2] packages.bbclass: Break out the debug info styles to bitbake variables Peter Kjellerstedt
2022-02-01  8:13   ` [OE-core] " Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.