Skip to contentSkip to conversation

package.bbclass: Add support for specifying a suffix for debug files

PATCH In review Peter Kjellerstedt 3 participants 4 messages Dec 23, 2021 – Jan 10, 2022 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package.bbclass: Add support for specifying a suffix for debug files

The suffix is added to the names of all files with debug symbols produced by split_and_strip_files(). It can be used to make the debug files produced by one recipe unique to avoid them conflicting with identically named debug files produced by another recipe. This may be needed since while the target files may be split in multiple packages, the debug files for one recipe are all in one package.

---
 meta/classes/package.bbclass | 11 +++++++++++
 meta/conf/documentation.conf |  1 +
 2 files changed, 12 insertions(+)
meta/classes/package.bbclass +11 -0
index 09cd376f4a..3df1edd4a8 100644
@@ -62,6 +62,14 @@ PACKAGE_DEPENDS += "rpm-native dwarfsrcfiles-native"
 # tools at rootfs build time.
 PACKAGE_WRITE_DEPS ??= ""
 
+# This suffix is added to the names of all files with debug symbols produced by
+# split_and_strip_files(). It can be used to make the debug files produced by
+# one recipe unique to avoid them conflicting with identically named debug files
+# produced by another recipe. This may be needed since while the target files
+# may be split in multiple packages, the debug files for one recipe are all in
+# one package.
+PACKAGE_DEBUG_FILE_SUFFIX ??= ""
+
 def legitimize_package_name(s):
     """
     Make sure package names are legitimate strings
@@ -1117,6 +1125,9 @@ python split_and_strip_files () {
         debugstaticlibdir = ""
         debugsrcdir = "/usr/src/debug"
 
+    debugappend += d.getVar('PACKAGE_DEBUG_FILE_SUFFIX')
+    debugstaticappend += d.getVar('PACKAGE_DEBUG_FILE_SUFFIX')
+
     #
     # First lets figure out all of the files we may have to process ... do this only once!
     #
meta/conf/documentation.conf +1 -0
index f63f4b223a..ad49410249 100644
@@ -311,6 +311,7 @@ PACKAGE_ARCH[doc] = "The architecture of the resulting package or packages."
 PACKAGE_ARCHS[doc] = "A list of architectures compatible with the given target in order of priority."
 PACKAGE_BEFORE_PN[doc] = "Enables easily adding packages to PACKAGES before ${PN} so that the packages can pick up files that would normally be included in the default package."
 PACKAGE_CLASSES[doc] = "This variable specifies the package manager to use when packaging data. It is set in the conf/local.conf file in the Build Directory."
+PACKAGE_DEBUG_FILE_SUFFIX[doc] = "This suffix is added to the names of all files with debug symbols in the dbg package."
 PACKAGE_EXCLUDE[doc] = "Packages to exclude from the installation. If a listed package is required, an error is generated."
 PACKAGE_EXTRA_ARCHS[doc] = "Specifies the list of architectures compatible with the device CPU. This variable is useful when you build for several different devices that use miscellaneous processors."
 PACKAGE_INSTALL[doc] = "List of the packages to be installed into the image. The variable is generally not user-defined and uses IMAGE_INSTALL as part of the list."
#1 lore raw
Quoted 8 lines · Peter Kjellerstedt

The suffix is added to the names of all files with debug symbols produced by split_and_strip_files(). It can be used to make the debug files produced by one recipe unique to avoid them conflicting with identically named debug files produced by another recipe. This may be needed since while the target files may be split in multiple packages, the debug files for one recipe are all in one package.

can you point to an example recipe clash ?

Quoted 56 lines
---
 meta/classes/package.bbclass | 11 +++++++++++
 meta/conf/documentation.conf |  1 +
 2 files changed, 12 insertions(+)
meta/classes/package.bbclass +11 -0
index 09cd376f4a..3df1edd4a8 100644
@@ -62,6 +62,14 @@ PACKAGE_DEPENDS += "rpm-native dwarfsrcfiles-native"
 # tools at rootfs build time.
 PACKAGE_WRITE_DEPS ??= ""
 
+# This suffix is added to the names of all files with debug symbols produced by
+# split_and_strip_files(). It can be used to make the debug files produced by
+# one recipe unique to avoid them conflicting with identically named debug files
+# produced by another recipe. This may be needed since while the target files
+# may be split in multiple packages, the debug files for one recipe are all in
+# one package.
+PACKAGE_DEBUG_FILE_SUFFIX ??= ""
+
 def legitimize_package_name(s):
     """
     Make sure package names are legitimate strings
@@ -1117,6 +1125,9 @@ python split_and_strip_files () {
         debugstaticlibdir = ""
         debugsrcdir = "/usr/src/debug"
 
+    debugappend += d.getVar('PACKAGE_DEBUG_FILE_SUFFIX')
+    debugstaticappend += d.getVar('PACKAGE_DEBUG_FILE_SUFFIX')
+
     #
     # First lets figure out all of the files we may have to process ... do this only once!
     #
meta/conf/documentation.conf +1 -1
index f63f4b223a..ad49410249 100644
@@ -311,6 +311,7 @@ PACKAGE_ARCH[doc] = "The architecture of the resulting package or packages."
 PACKAGE_ARCHS[doc] = "A list of architectures compatible with the given target in order of priority."
 PACKAGE_BEFORE_PN[doc] = "Enables easily adding packages to PACKAGES before ${PN} so that the packages can pick up files that would normally be included in the default package."
 PACKAGE_CLASSES[doc] = "This variable specifies the package manager to use when packaging data. It is set in the conf/local.conf file in the Build Directory."
+PACKAGE_DEBUG_FILE_SUFFIX[doc] = "This suffix is added to the names of all files with debug symbols in the dbg package."
 PACKAGE_EXCLUDE[doc] = "Packages to exclude from the installation. If a listed package is required, an error is generated."
 PACKAGE_EXTRA_ARCHS[doc] = "Specifies the list of architectures compatible with the device CPU. This variable is useful when you build for several different devices that use miscellaneous processors."
 PACKAGE_INSTALL[doc] = "List of the packages to be installed into the image. The variable is generally not user-defined and uses IMAGE_INSTALL as part of the list."
 
-=-=-=-=-=-=-=-=-=-=-=-

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

#2 lore raw
Quoted 20 lines

-----Original Message-----
From: Khem Raj <[email protected]>
Sent: den 24 december 2021 06:53
To: Peter Kjellerstedt <[email protected]>
Cc: Patches and discussions about the oe-core layer <openembedded- [email protected]>
Subject: Re: [OE-core] [PATCH] package.bbclass: Add support for specifying a suffix for debug files

Quoted 8 lines · Peter Kjellerstedt

The suffix is added to the names of all files with debug symbols produced by split_and_strip_files(). It can be used to make the debug files produced by one recipe unique to avoid them conflicting with identically named debug files produced by another recipe. This may be needed since while the target files may be split in multiple packages, the debug files for one recipe are all in one package.

Quoted 1 line

can you point to an example recipe clash ?

Not in OE-Core or OpenEmbedded. The example that required me to have to find a solution was that we have our own implementation of an srtp plugin for GStreamer that some of our products use, while some of our products use the official version from gstreamer1.0-plugins-bad. Our version is a drop-in replacement so it provides the libgstrtsp.so plugin just like the original package from gstreamer1.0-plugins-bad does. This is no problem for target as the GStreamer plugins are packaged one module per package. However, as the debug files are all in one package, the libgstrtsp.so file in our dbg package conflicts with the libgstrtsp.so in the gstreamer1.0-plugins-bad-dbg package and this becomes a problem for any product that uses both our rtsp plugin and some other plugin from gstreamer1.0-plugins-bad.

//Peter

Quoted 76 lines
Quoted 11 lines
---
 meta/classes/package.bbclass | 11 +++++++++++
 meta/conf/documentation.conf |  1 +
 2 files changed, 12 insertions(+)
meta/classes/package.bbclass +0 -0
index 09cd376f4a..3df1edd4a8 100644

meta/classes/package.bbclass PACKAGE_DEPENDS += "rpm-native dwarfsrcfiles-native" · line 65

Quoted 4 lines
meta/classes/package.bbclass +1 -0
@@ -62,6 +62,14 @@ PACKAGE_DEPENDS += "rpm-native dwarfsrcfiles-native"
 # tools at rootfs build time.
 PACKAGE_WRITE_DEPS ??= ""
 
+# This suffix is added to the names of all files with debug symbols

produced by

meta/classes/package.bbclass PACKAGE_DEPENDS += "rpm-native dwarfsrcfiles-native" · line 66

Quoted 1 line
meta/classes/package.bbclass +1 -0
+# split_and_strip_files(). It can be used to make the debug files

produced by

meta/classes/package.bbclass PACKAGE_DEPENDS += "rpm-native dwarfsrcfiles-native" · line 67

Quoted 1 line
meta/classes/package.bbclass +1 -0
+# one recipe unique to avoid them conflicting with identically named

debug files

meta/classes/package.bbclass PACKAGE_DEPENDS += "rpm-native dwarfsrcfiles-native" · line 68

Quoted 1 line
meta/classes/package.bbclass +1 -0
+# produced by another recipe. This may be needed since while the target

files

meta/classes/package.bbclass PACKAGE_DEPENDS += "rpm-native dwarfsrcfiles-native" · line 69

Quoted 1 line
meta/classes/package.bbclass +1 -0
+# may be split in multiple packages, the debug files for one recipe are

all in

Quoted 7 lines
meta/classes/package.bbclass +3 -0
+# one package.
+PACKAGE_DEBUG_FILE_SUFFIX ??= ""
+
 def legitimize_package_name(s):
     """
     Make sure package names are legitimate strings

meta/classes/package.bbclass python split_and_strip_files () { · line 1132

Quoted 8 lines
meta/classes/package.bbclass +3 -0
@@ -1117,6 +1125,9 @@ python split_and_strip_files () {
         debugstaticlibdir = ""
         debugsrcdir = "/usr/src/debug"
 
+    debugappend += d.getVar('PACKAGE_DEBUG_FILE_SUFFIX')
+    debugstaticappend += d.getVar('PACKAGE_DEBUG_FILE_SUFFIX')
+
     #
     # First lets figure out all of the files we may have to process ...

do this only once!

meta/conf/documentation.conf PACKAGE_ARCH[doc] = "The architecture of the

Quoted 6 lines
meta/classes/package.bbclass +0 -0
     #
meta/conf/documentation.conf +0 -0
index f63f4b223a..ad49410249 100644
@@ -311,6 +311,7 @@ PACKAGE_ARCH[doc] = "The architecture of the

resulting package or packages."

meta/conf/documentation.conf PACKAGE_ARCH[doc] = "The architecture of the · line 311

Quoted 1 line
meta/conf/documentation.conf +0 -0
 PACKAGE_ARCHS[doc] = "A list of architectures compatible with the given

target in order of priority."

meta/conf/documentation.conf PACKAGE_ARCH[doc] = "The architecture of the · line 312

Quoted 1 line
meta/conf/documentation.conf +0 -0
 PACKAGE_BEFORE_PN[doc] = "Enables easily adding packages to PACKAGES

before ${PN} so that the packages can pick up files that would normally be included in the default package."

meta/conf/documentation.conf PACKAGE_ARCH[doc] = "The architecture of the · line 313

Quoted 1 line
meta/conf/documentation.conf +0 -0
 PACKAGE_CLASSES[doc] = "This variable specifies the package manager to

use when packaging data. It is set in the conf/local.conf file in the Build Directory."

meta/conf/documentation.conf PACKAGE_ARCH[doc] = "The architecture of the · line 314

Quoted 1 line
meta/conf/documentation.conf +1 -0
+PACKAGE_DEBUG_FILE_SUFFIX[doc] = "This suffix is added to the names of

all files with debug symbols in the dbg package."

meta/conf/documentation.conf PACKAGE_ARCH[doc] = "The architecture of the · line 315

Quoted 1 line
meta/conf/documentation.conf +0 -0
 PACKAGE_EXCLUDE[doc] = "Packages to exclude from the installation. If a

listed package is required, an error is generated."

meta/conf/documentation.conf PACKAGE_ARCH[doc] = "The architecture of the · line 316

Quoted 1 line
meta/conf/documentation.conf +0 -0
 PACKAGE_EXTRA_ARCHS[doc] = "Specifies the list of architectures

compatible with the device CPU. This variable is useful when you build for several different devices that use miscellaneous processors."

meta/conf/documentation.conf PACKAGE_ARCH[doc] = "The architecture of the · line 317

Quoted 1 line
meta/conf/documentation.conf +0 -0
 PACKAGE_INSTALL[doc] = "List of the packages to be installed into the

image. The variable is generally not user-defined and uses IMAGE_INSTALL as part of the list."

Quoted 4 lines

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#159974):

https://lists.openembedded.org/g/openembedded-core/message/159974

Quoted 3 lines

Mute This Topic: https://lists.openembedded.org/mt/87915927/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub

[[email protected]]

Quoted 2 lines

-=-=-=-=-=-=-=-=-=-=-=-

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw

*ping*

//Peter

Quoted 87 lines

-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Peter Kjellerstedt
Sent: den 24 december 2021 18:19
To: Khem Raj <[email protected]>
Cc: Patches and discussions about the oe-core layer <[email protected]>
Subject: Re: [OE-core] [PATCH] package.bbclass: Add support for specifying a suffix for debug files

Quoted 17 lines

-----Original Message-----
From: Khem Raj <[email protected]>
Sent: den 24 december 2021 06:53
To: Peter Kjellerstedt <[email protected]>
Cc: Patches and discussions about the oe-core layer <[email protected]>
Subject: Re: [OE-core] [PATCH] package.bbclass: Add support for specifying a suffix for debug files

Quoted 8 lines · Peter Kjellerstedt

The suffix is added to the names of all files with debug symbols produced by split_and_strip_files(). It can be used to make the debug files produced by one recipe unique to avoid them conflicting with identically named debug files produced by another recipe. This may be needed since while the target files may be split in multiple packages, the debug files for one recipe are all in one package.

Quoted 1 line

can you point to an example recipe clash ?

Not in OE-Core or OpenEmbedded. The example that required me to have to find a solution was that we have our own implementation of an srtp plugin for GStreamer that some of our products use, while some of our products use the official version from gstreamer1.0-plugins-bad. Our version is a drop-in replacement so it provides the libgstrtsp.so plugin just like the original package from gstreamer1.0-plugins-bad does. This is no problem for target as the GStreamer plugins are packaged one module per package. However, as the debug files are all in one package, the libgstrtsp.so file in our dbg package conflicts with the libgstrtsp.so in the gstreamer1.0-plugins-bad-dbg package and this becomes a problem for any product that uses both our rtsp plugin and some other plugin from gstreamer1.0-plugins-bad.

//Peter

Quoted 47 lines
Quoted 47 lines
---
 meta/classes/package.bbclass | 11 +++++++++++
 meta/conf/documentation.conf |  1 +
 2 files changed, 12 insertions(+)
meta/classes/package.bbclass +11 -0
index 09cd376f4a..3df1edd4a8 100644
@@ -62,6 +62,14 @@ PACKAGE_DEPENDS += "rpm-native dwarfsrcfiles-native"
 # tools at rootfs build time.
 PACKAGE_WRITE_DEPS ??= ""
 
+# This suffix is added to the names of all files with debug symbols produced by
+# split_and_strip_files(). It can be used to make the debug files produced by
+# one recipe unique to avoid them conflicting with identically named debug files
+# produced by another recipe. This may be needed since while the target files
+# may be split in multiple packages, the debug files for one recipe are all in
+# one package.
+PACKAGE_DEBUG_FILE_SUFFIX ??= ""
+
 def legitimize_package_name(s):
     """
     Make sure package names are legitimate strings
@@ -1117,6 +1125,9 @@ python split_and_strip_files () {
         debugstaticlibdir = ""
         debugsrcdir = "/usr/src/debug"
 
+    debugappend += d.getVar('PACKAGE_DEBUG_FILE_SUFFIX')
+    debugstaticappend += d.getVar('PACKAGE_DEBUG_FILE_SUFFIX')
+
     #
     # First lets figure out all of the files we may have to process ... do this only once!
     #
meta/conf/documentation.conf +1 -0
index f63f4b223a..ad49410249 100644
@@ -311,6 +311,7 @@ PACKAGE_ARCH[doc] = "The architecture of the resulting package or packages."
 PACKAGE_ARCHS[doc] = "A list of architectures compatible with the given target in order of priority."
 PACKAGE_BEFORE_PN[doc] = "Enables easily adding packages to PACKAGES before ${PN} so that the packages can pick up files that would normally be included in the default package."
 PACKAGE_CLASSES[doc] = "This variable specifies the package manager to use when packaging data. It is set in the conf/local.conf file in the Build Directory."
+PACKAGE_DEBUG_FILE_SUFFIX[doc] = "This suffix is added to the names of all files with debug symbols in the dbg package."
 PACKAGE_EXCLUDE[doc] = "Packages to exclude from the installation. If a listed package is required, an error is generated."
 PACKAGE_EXTRA_ARCHS[doc] = "Specifies the list of architectures compatible with the device CPU. This variable is useful when you build for several different devices that use miscellaneous processors."
 PACKAGE_INSTALL[doc] = "List of the packages to be installed into the image. The variable is generally not user-defined and uses IMAGE_INSTALL as part of the list."