* [PATCH] Add source package to ${PACKAGES}
@ 2019-03-05 2:45 Joshua Watt
2019-03-05 11:19 ` Burton, Ross
2019-03-06 16:32 ` [PATCH v2] " Joshua Watt
0 siblings, 2 replies; 4+ messages in thread
From: Joshua Watt @ 2019-03-05 2:45 UTC (permalink / raw)
To: openembedded-core
Permanently adds the -src source package to ${PACKAGES} instead of
relying on creating it dynamically at packaging time. The source package
is now defined in bitbake.conf, just like -dev and -dbg packages.
For compatibility, the -src package is still added dynamically if it was
missing, since some recipes have a tendency to completely override
PACKAGES and do so without manually adding back the -src package.
This allows RDEPENDS on the -src packages, which wasn't previously
possible.
[YOCTO #13203]
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
---
meta/classes/package.bbclass | 28 +++++++++++++++-------------
meta/conf/bitbake.conf | 12 +++++++++++-
2 files changed, 26 insertions(+), 14 deletions(-)
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 749c7d9ea14..4c0a8595363 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -1128,7 +1128,7 @@ python populate_packages () {
workdir = d.getVar('WORKDIR')
outdir = d.getVar('DEPLOY_DIR')
dvar = d.getVar('PKGD')
- packages = d.getVar('PACKAGES')
+ packages = d.getVar('PACKAGES').split()
pn = d.getVar('PN')
bb.utils.mkdirhier(outdir)
@@ -1138,32 +1138,34 @@ python populate_packages () {
split_source_package = (d.getVar('PACKAGE_DEBUG_SPLIT_STYLE') == 'debug-with-srcpkg')
- # If debug-with-srcpkg mode is enabled then the src package is added
- # into the package list and the source directory as its main content
+ # 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.
if split_source_package:
src_package_name = ('%s-src' % d.getVar('PN'))
- packages += (' ' + src_package_name)
+ if not src_package_name in packages:
+ packages.append(src_package_name)
d.setVar('FILES_%s' % src_package_name, '/usr/src/debug')
# Sanity check PACKAGES for duplicates
# Sanity should be moved to sanity.bbclass once we have the infrastructure
package_dict = {}
- for i, pkg in enumerate(packages.split()):
+ for i, pkg in enumerate(packages):
if pkg in package_dict:
msg = "%s is listed in PACKAGES multiple times, this leads to packaging errors." % pkg
package_qa_handle_error("packages-list", msg, d)
- # If debug-with-srcpkg mode is enabled then the src package will have
- # priority over dbg package when assigning the files.
- # This allows src package to include source files and remove them from dbg.
- elif split_source_package and pkg.endswith("-src"):
+ # Ensure the source package gets the chance to pick up the source files
+ # before the debug package by ordering it first in PACKAGES. Whether it
+ # actually picks up any source files is controlled by
+ # PACKAGE_DEBUG_SPLIT_STYLE.
+ elif pkg.endswith("-src"):
package_dict[pkg] = (10, i)
elif autodebug and pkg.endswith("-dbg"):
package_dict[pkg] = (30, i)
else:
package_dict[pkg] = (50, i)
- package_list = sorted(package_dict.keys(), key=package_dict.get)
- d.setVar('PACKAGES', ' '.join(package_list))
+ packages = sorted(package_dict.keys(), key=package_dict.get)
+ d.setVar('PACKAGES', ' '.join(packages))
pkgdest = d.getVar('PKGDEST')
seen = []
@@ -1181,7 +1183,7 @@ python populate_packages () {
if "/.debug/" in path or path.endswith("/.debug"):
debug.append(path)
- for pkg in package_list:
+ for pkg in packages:
root = os.path.join(pkgdest, pkg)
bb.utils.mkdirhier(root)
@@ -1252,7 +1254,7 @@ python populate_packages () {
# Handle LICENSE_EXCLUSION
package_list = []
- for pkg in packages.split():
+ for pkg in packages:
if d.getVar('LICENSE_EXCLUSION-' + pkg):
msg = "%s has an incompatible license. Excluding from packaging." % pkg
package_qa_handle_error("incompatible-license", msg, d)
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index f1540a0acf7..5a4c4bbde94 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -237,6 +237,10 @@ DESCRIPTION ?= "${SUMMARY}."
#SUMMARY_${PN} ?= "${SUMMARY}"
#DESCRIPTION_${PN} ?= "${DESCRIPTION}"
+SUMMARY_${PN}-src ?= "${SUMMARY} - Source files"
+DESCRIPTION_${PN}-src ?= "${DESCRIPTION} \
+This package contains sources for debugging purposes."
+
SUMMARY_${PN}-dbg ?= "${SUMMARY} - Debugging files"
DESCRIPTION_${PN}-dbg ?= "${DESCRIPTION} \
This package contains ELF symbols and related sources for debugging purposes."
@@ -285,7 +289,7 @@ SOLIBSDEV_darwin = ".dylibbroken"
PACKAGE_DEBUG_SPLIT_STYLE ?= "debug-with-srcpkg"
PACKAGE_BEFORE_PN ?= ""
-PACKAGES = "${PN}-dbg ${PN}-staticdev ${PN}-dev ${PN}-doc ${PN}-locale ${PACKAGE_BEFORE_PN} ${PN}"
+PACKAGES = "${PN}-src ${PN}-dbg ${PN}-staticdev ${PN}-dev ${PN}-doc ${PN}-locale ${PACKAGE_BEFORE_PN} ${PN}"
PACKAGES_DYNAMIC = "^${PN}-locale-.*"
FILES = ""
@@ -324,6 +328,12 @@ FILES_${PN}-dbg = "/usr/lib/debug /usr/src/debug"
SECTION_${PN}-dbg = "devel"
ALLOW_EMPTY_${PN}-dbg = "1"
+# The files list for source packages are dynamically set based on
+# PACKAGE_DEBUG_SPLIT_STYLE
+FILES_${PN}-src = ""
+SECTION_${PN}-src = "devel"
+ALLOW_EMPTY_${PN}-src = "1"
+
FILES_${PN}-locale = "${datadir}/locale"
# File manifest
--
2.20.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Add source package to ${PACKAGES}
2019-03-05 2:45 [PATCH] Add source package to ${PACKAGES} Joshua Watt
@ 2019-03-05 11:19 ` Burton, Ross
2019-03-05 14:24 ` Joshua Watt
2019-03-06 16:32 ` [PATCH v2] " Joshua Watt
1 sibling, 1 reply; 4+ messages in thread
From: Burton, Ross @ 2019-03-05 11:19 UTC (permalink / raw)
To: Joshua Watt; +Cc: OE-core
On Tue, 5 Mar 2019 at 02:46, Joshua Watt <jpewhacker@gmail.com> wrote:
> +ALLOW_EMPTY_${PN}-src = "1"
Is that what we want? Empty PN-src packages for packages which have
no source code, or when source splitting is disabled?
Ross
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Add source package to ${PACKAGES}
2019-03-05 11:19 ` Burton, Ross
@ 2019-03-05 14:24 ` Joshua Watt
0 siblings, 0 replies; 4+ messages in thread
From: Joshua Watt @ 2019-03-05 14:24 UTC (permalink / raw)
To: Burton, Ross; +Cc: OE-core
On Tue, 2019-03-05 at 11:19 +0000, Burton, Ross wrote:
> On Tue, 5 Mar 2019 at 02:46, Joshua Watt <jpewhacker@gmail.com>
> wrote:
> > +ALLOW_EMPTY_${PN}-src = "1"
>
> Is that what we want? Empty PN-src packages for packages which have
> no source code, or when source splitting is disabled?
I found this while attempting to "targeted" debugging where I only put
the -dbg packages for the things I actually wanted to debug on the root
file system (as opposed to using the "dbg-pkgs src-pkgs"
IMAGE_FEATURES), i.e. IMAGE_INSTALL += "foo-dbg"
The problem I encountered was that I couldn't do the same thing with
the source packages (i.e. IMAGE_INSTALL += "foo-src") because they
don't exist at parsing time.
>
> Ross
--
Joshua Watt <JPEWhacker@gmail.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2] Add source package to ${PACKAGES}
2019-03-05 2:45 [PATCH] Add source package to ${PACKAGES} Joshua Watt
2019-03-05 11:19 ` Burton, Ross
@ 2019-03-06 16:32 ` Joshua Watt
1 sibling, 0 replies; 4+ messages in thread
From: Joshua Watt @ 2019-03-06 16:32 UTC (permalink / raw)
To: openembedded-core
Permanently adds the -src source package to ${PACKAGES} instead of
relying on creating it dynamically at packaging time. The source package
is now defined in bitbake.conf, just like -dev and -dbg packages.
For compatibility, the -src package is still added dynamically if it was
missing, since some recipes have a tendency to completely override
PACKAGES and do so without manually adding back the -src package.
This allows RDEPENDS on the -src packages, which wasn't previously
possible.
[YOCTO #13203]
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
---
meta/classes/package.bbclass | 28 +++++++++++++++-------------
meta/conf/bitbake.conf | 11 ++++++++++-
2 files changed, 25 insertions(+), 14 deletions(-)
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 749c7d9ea14..4c0a8595363 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -1128,7 +1128,7 @@ python populate_packages () {
workdir = d.getVar('WORKDIR')
outdir = d.getVar('DEPLOY_DIR')
dvar = d.getVar('PKGD')
- packages = d.getVar('PACKAGES')
+ packages = d.getVar('PACKAGES').split()
pn = d.getVar('PN')
bb.utils.mkdirhier(outdir)
@@ -1138,32 +1138,34 @@ python populate_packages () {
split_source_package = (d.getVar('PACKAGE_DEBUG_SPLIT_STYLE') == 'debug-with-srcpkg')
- # If debug-with-srcpkg mode is enabled then the src package is added
- # into the package list and the source directory as its main content
+ # 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.
if split_source_package:
src_package_name = ('%s-src' % d.getVar('PN'))
- packages += (' ' + src_package_name)
+ if not src_package_name in packages:
+ packages.append(src_package_name)
d.setVar('FILES_%s' % src_package_name, '/usr/src/debug')
# Sanity check PACKAGES for duplicates
# Sanity should be moved to sanity.bbclass once we have the infrastructure
package_dict = {}
- for i, pkg in enumerate(packages.split()):
+ for i, pkg in enumerate(packages):
if pkg in package_dict:
msg = "%s is listed in PACKAGES multiple times, this leads to packaging errors." % pkg
package_qa_handle_error("packages-list", msg, d)
- # If debug-with-srcpkg mode is enabled then the src package will have
- # priority over dbg package when assigning the files.
- # This allows src package to include source files and remove them from dbg.
- elif split_source_package and pkg.endswith("-src"):
+ # Ensure the source package gets the chance to pick up the source files
+ # before the debug package by ordering it first in PACKAGES. Whether it
+ # actually picks up any source files is controlled by
+ # PACKAGE_DEBUG_SPLIT_STYLE.
+ elif pkg.endswith("-src"):
package_dict[pkg] = (10, i)
elif autodebug and pkg.endswith("-dbg"):
package_dict[pkg] = (30, i)
else:
package_dict[pkg] = (50, i)
- package_list = sorted(package_dict.keys(), key=package_dict.get)
- d.setVar('PACKAGES', ' '.join(package_list))
+ packages = sorted(package_dict.keys(), key=package_dict.get)
+ d.setVar('PACKAGES', ' '.join(packages))
pkgdest = d.getVar('PKGDEST')
seen = []
@@ -1181,7 +1183,7 @@ python populate_packages () {
if "/.debug/" in path or path.endswith("/.debug"):
debug.append(path)
- for pkg in package_list:
+ for pkg in packages:
root = os.path.join(pkgdest, pkg)
bb.utils.mkdirhier(root)
@@ -1252,7 +1254,7 @@ python populate_packages () {
# Handle LICENSE_EXCLUSION
package_list = []
- for pkg in packages.split():
+ for pkg in packages:
if d.getVar('LICENSE_EXCLUSION-' + pkg):
msg = "%s has an incompatible license. Excluding from packaging." % pkg
package_qa_handle_error("incompatible-license", msg, d)
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index f1540a0acf7..8fc4e9bc1a8 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -237,6 +237,10 @@ DESCRIPTION ?= "${SUMMARY}."
#SUMMARY_${PN} ?= "${SUMMARY}"
#DESCRIPTION_${PN} ?= "${DESCRIPTION}"
+SUMMARY_${PN}-src ?= "${SUMMARY} - Source files"
+DESCRIPTION_${PN}-src ?= "${DESCRIPTION} \
+This package contains sources for debugging purposes."
+
SUMMARY_${PN}-dbg ?= "${SUMMARY} - Debugging files"
DESCRIPTION_${PN}-dbg ?= "${DESCRIPTION} \
This package contains ELF symbols and related sources for debugging purposes."
@@ -285,7 +289,7 @@ SOLIBSDEV_darwin = ".dylibbroken"
PACKAGE_DEBUG_SPLIT_STYLE ?= "debug-with-srcpkg"
PACKAGE_BEFORE_PN ?= ""
-PACKAGES = "${PN}-dbg ${PN}-staticdev ${PN}-dev ${PN}-doc ${PN}-locale ${PACKAGE_BEFORE_PN} ${PN}"
+PACKAGES = "${PN}-src ${PN}-dbg ${PN}-staticdev ${PN}-dev ${PN}-doc ${PN}-locale ${PACKAGE_BEFORE_PN} ${PN}"
PACKAGES_DYNAMIC = "^${PN}-locale-.*"
FILES = ""
@@ -324,6 +328,11 @@ FILES_${PN}-dbg = "/usr/lib/debug /usr/src/debug"
SECTION_${PN}-dbg = "devel"
ALLOW_EMPTY_${PN}-dbg = "1"
+# The files list for source packages are dynamically set based on
+# PACKAGE_DEBUG_SPLIT_STYLE
+FILES_${PN}-src = ""
+SECTION_${PN}-src = "devel"
+
FILES_${PN}-locale = "${datadir}/locale"
# File manifest
--
2.20.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-03-06 16:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-05 2:45 [PATCH] Add source package to ${PACKAGES} Joshua Watt
2019-03-05 11:19 ` Burton, Ross
2019-03-05 14:24 ` Joshua Watt
2019-03-06 16:32 ` [PATCH v2] " Joshua Watt
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.