Skip to contentSkip to conversation

kernelsrc/perf: fix dependency on non existant task when using externalsrc

PATCH In review Stefan Stanacar 3 participants 6 messages Jan 11, 2018 – Jan 18, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kernelsrc/perf: fix dependency on non existant task when using externalsrc

When externalsrc is enabled for kernel, do_patch doesn't exist since is in SRCTREECOVEREDTASKS, so make these depend on a real task.

Fixes:
ERROR: Task do_unpack in /data/yocto/poky/meta/recipes-kernel/perf/perf.bb
depends upon non-existent task do_patch in /data/yocto/poky/meta/recipes-kernel/linux/linux-yocto_4.8.bb

---
 meta/classes/kernelsrc.bbclass   | 2 +-
 meta/recipes-kernel/perf/perf.bb | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
meta/classes/kernelsrc.bbclass +1 -1
index 9efd46a..ce6c999 100644
@@ -1,6 +1,6 @@
 S = "${STAGING_KERNEL_DIR}"
 do_fetch[noexec] = "1"
-do_unpack[depends] += "virtual/kernel:do_patch"
+do_unpack[depends] += "virtual/kernel:do_configure"
 do_unpack[noexec] = "1"
 do_patch[noexec] = "1"
 do_package[depends] += "virtual/kernel:do_populate_sysroot"
meta/recipes-kernel/perf/perf.bb +1 -1
index 03ae446..145774b 100644
@@ -47,7 +47,7 @@ export PYTHON_SITEPACKAGES_DIR
 #kernel 3.1+ supports WERROR to disable warnings as errors
 export WERROR = "0"
 
-do_populate_lic[depends] += "virtual/kernel:do_patch"
+do_populate_lic[depends] += "virtual/kernel:do_configure"
 
 # needed for building the tools/perf Perl binding
 inherit perlnative cpan-base
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 kernel.bbclass: Fix symlink creation when using externalsrc

do_unpack is by default in SRCTREECOVEREDTASKS so this append can't run, since this tasks gets removed by externalsrc when it's enabled.

However this was hidden because externalsrc does run do_fetch and do_unpack if there are type=kmeta or file:// entries in the SRC_URI value of the kernel recipe. (e.g linux-yocto).

Make this a separate task so that it actually gets run for kernel recipes with no file:// or type=kmeta in SRC_URI.

---
 meta/classes/kernel.bbclass | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
meta/classes/kernel.bbclass +3 -1
index f8318b8..3eaae03 100644
@@ -102,7 +102,7 @@ inherit ${KERNEL_CLASSES}
 # the symlink.
 do_unpack[cleandirs] += " ${S} ${STAGING_KERNEL_DIR} ${B} ${STAGING_KERNEL_BUILDDIR}"
 do_clean[cleandirs] += " ${S} ${STAGING_KERNEL_DIR} ${B} ${STAGING_KERNEL_BUILDDIR}"
-base_do_unpack_append () {
+python do_symlink_staging_dir () {
     s = d.getVar("S", True)
     if s[-1] == '/':
         # drop trailing slash, so that os.symlink(kernsrc, s) doesn't use s as directory name and fail
@@ -119,6 +119,8 @@ base_do_unpack_append () {
             shutil.move(s, kernsrc)
             os.symlink(kernsrc, s)
 }
+addtask do_symlink_staging_dir after do_unpack before do_patch do_configure
+
 
 inherit kernel-arch deploy
 
Signature · 1 line
2.7.4
#2 lore raw

Re: [morty][PATCH] kernel.bbclass: Fix symlink creation when using externalsrc

Quoted 9 lines · Stefan Stanacar

do_unpack is by default in SRCTREECOVEREDTASKS so this append can't run, since this tasks gets removed by externalsrc when it's enabled.

However this was hidden because externalsrc does run do_fetch and do_unpack if there are type=kmeta or file:// entries in the SRC_URI value of the kernel recipe. (e.g linux-yocto).

Make this a separate task so that it actually gets run for kernel recipes with no file:// or type=kmeta in SRC_URI.

Is this fixed in Master?

- armin

Quoted 27 lines
---
 meta/classes/kernel.bbclass | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
meta/classes/kernel.bbclass +3 -1
index f8318b8..3eaae03 100644
@@ -102,7 +102,7 @@ inherit ${KERNEL_CLASSES}
 # the symlink.
 do_unpack[cleandirs] += " ${S} ${STAGING_KERNEL_DIR} ${B} ${STAGING_KERNEL_BUILDDIR}"
 do_clean[cleandirs] += " ${S} ${STAGING_KERNEL_DIR} ${B} ${STAGING_KERNEL_BUILDDIR}"
-base_do_unpack_append () {
+python do_symlink_staging_dir () {
     s = d.getVar("S", True)
     if s[-1] == '/':
         # drop trailing slash, so that os.symlink(kernsrc, s) doesn't use s as directory name and fail
@@ -119,6 +119,8 @@ base_do_unpack_append () {
             shutil.move(s, kernsrc)
             os.symlink(kernsrc, s)
 }
+addtask do_symlink_staging_dir after do_unpack before do_patch do_configure
+
 
 inherit kernel-arch deploy
 
#3 lore raw

Re: [morty][PATCH] kernel.bbclass: Fix symlink creation when using externalsrc

Quoted 10 lines · On Wed, Jan 17, 2018 at 9:04 PM, akuster808 <[email protected]> wrote:
Quoted 1 line · Stefan Stanacar

do_unpack is by default in SRCTREECOVEREDTASKS so this append can't run,

since

Quoted 3 lines

this tasks gets removed by externalsrc when it's enabled.

However this was hidden because externalsrc does run do_fetch and

do_unpack if

Quoted 1 line

there are type=kmeta or file:// entries in the SRC_URI value of the

Quoted 10 lines

kernel recipe.

Quoted 3 lines

(e.g linux-yocto).

Make this a separate task so that it actually gets run for kernel

recipes with

Quoted 1 line

no file:// or type=kmeta in SRC_URI.

Is this fixed in Master?

Nope, I've sent a patch for master as well:
http://lists.openembedded.org/pipermail/openembedded-core/2018-January/146355.html
but it wasn't merged (yet?)

Cheers,
Stefan

Quoted 34 lines

- armin

meta/classes/kernel.bbclass inherit ${KERNEL_CLASSES} · line 103

Quoted 12 lines
---
 meta/classes/kernel.bbclass | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
meta/classes/kernel.bbclass +0 -0
index f8318b8..3eaae03 100644
@@ -102,7 +102,7 @@ inherit ${KERNEL_CLASSES}
 # the symlink.
 do_unpack[cleandirs] += " ${S} ${STAGING_KERNEL_DIR} ${B}

${STAGING_KERNEL_BUILDDIR}"

meta/classes/kernel.bbclass inherit ${KERNEL_CLASSES} · line 104

Quoted 1 line
meta/classes/kernel.bbclass +0 -0
 do_clean[cleandirs] += " ${S} ${STAGING_KERNEL_DIR} ${B}

${STAGING_KERNEL_BUILDDIR}"

meta/classes/kernel.bbclass inherit ${KERNEL_CLASSES}

Quoted 5 lines
meta/classes/kernel.bbclass +1 -1
-base_do_unpack_append () {
+python do_symlink_staging_dir () {
     s = d.getVar("S", True)
     if s[-1] == '/':
         # drop trailing slash, so that os.symlink(kernsrc, s) doesn't

use s as directory name and fail

meta/classes/kernel.bbclass base_do_unpack_append () { · line 122

Quoted 5 lines
meta/classes/kernel.bbclass +1 -0
@@ -119,6 +119,8 @@ base_do_unpack_append () {
             shutil.move(s, kernsrc)
             os.symlink(kernsrc, s)
 }
+addtask do_symlink_staging_dir after do_unpack before do_patch

do_configure

Quoted 4 lines
meta/classes/kernel.bbclass +1 -0
+
 
 inherit kernel-arch deploy
 
#4 lore raw
In reply to Stefan Stanacar
Quoted 22 lines · Stefan Stanacar

When externalsrc is enabled for kernel, do_patch doesn't exist since is in
SRCTREECOVEREDTASKS, so make these depend on a real task.

Fixes:
ERROR: Task do_unpack in /data/yocto/poky/meta/recipes-
kernel/perf/perf.bb
depends upon non-existent task do_patch in
/data/yocto/poky/meta/recipes-kernel/linux/linux-yocto_4.8.bb

---
 meta/classes/kernelsrc.bbclass   | 2 +-
 meta/recipes-kernel/perf/perf.bb | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
meta/classes/kernelsrc.bbclass +0 -0
index 9efd46a..ce6c999 100644

meta/classes/kernelsrc.bbclass line 3

Quoted 4 lines
meta/classes/kernelsrc.bbclass +1 -1
@@ -1,6 +1,6 @@
 S = "${STAGING_KERNEL_DIR}"
 do_fetch[noexec] = "1"
-do_unpack[depends] += "virtual/kernel:do_patch"
+do_unpack[depends] += "virtual/kernel:do_configure"

I was looking at fixing this as well, but I had another approach. Instead of perpetually changing these to handle externalsrc corner cases, perhaps externalsrc.bbclass should not delete the tasks, but instead mark them as noexec as follows (I'll push this up for real if in a moment...). Then recipes should be able to work transparently regardless of externalsrc being used or not.

(quoted diff) +0 -0

b/meta/classes/externalsrc.bbclass
index 65dd13ddc1f..12046d74e17 100644

meta/classes/externalsrc.bbclass +1 -1
@@ -102,7 +102,7 @@ python () {
         for task in d.getVar("SRCTREECOVEREDTASKS").split():
             if local_srcuri and task in fetch_tasks:
                 continue
-            bb.build.deltask(task, d)
+            d.setVarFlag(task, 'noexec', '1')
 
         d.prependVarFlag('do_compile', 'prefunc

s', "externalsrc_compile_prefunc ")
d.prependVarFlag('do_configure', 'prefuncs',
"externalsrc_configure_prefunc ")

Quoted 20 lines
meta/classes/kernelsrc.bbclass +0 -0
 do_unpack[noexec] = "1"
 do_patch[noexec] = "1"
 do_package[depends] += "virtual/kernel:do_populate_sysroot"
meta/recipes- renamed from meta/recipes-kernel/perf/perf.bb +0 -0

kernel/perf/perf.bb
index 03ae446..145774b 100644

meta/recipes-kernel/perf/perf.bb +1 -1
@@ -47,7 +47,7 @@ export PYTHON_SITEPACKAGES_DIR
 #kernel 3.1+ supports WERROR to disable warnings as errors
 export WERROR = "0"
 
-do_populate_lic[depends] += "virtual/kernel:do_patch"
+do_populate_lic[depends] += "virtual/kernel:do_configure"
 
 # needed for building the tools/perf Perl binding
 inherit perlnative cpan-base
Signature · 1 line
2.7.4
#5 lore raw
Quoted 26 lines · Joshua Watt
Quoted 25 lines · Stefan Stanacar

When externalsrc is enabled for kernel, do_patch doesn't exist since is in
SRCTREECOVEREDTASKS, so make these depend on a real task.

Fixes:
ERROR: Task do_unpack in /data/yocto/poky/meta/recipes-
kernel/perf/perf.bb
depends upon non-existent task do_patch in
/data/yocto/poky/meta/recipes-kernel/linux/linux-yocto_4.8.bb

---
 meta/classes/kernelsrc.bbclass   | 2 +-
 meta/recipes-kernel/perf/perf.bb | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
meta/classes/kernelsrc.bbclass +0 -1
index 9efd46a..ce6c999 100644
@@ -1,6 +1,6 @@
 S = "${STAGING_KERNEL_DIR}"
 do_fetch[noexec] = "1"
-do_unpack[depends] += "virtual/kernel:do_patch"
Quoted 10 lines

meta/classes/kernelsrc.bbclass line 3

Quoted 1 line
meta/classes/kernelsrc.bbclass +1 -0
+do_unpack[depends] += "virtual/kernel:do_configure"

I was looking at fixing this as well, but I had another approach. Instead of perpetually changing these to handle externalsrc corner cases, perhaps externalsrc.bbclass should not delete the tasks, but instead mark them as noexec as follows (I'll push this up for real if in a moment...). Then recipes should be able to work transparently regardless of externalsrc being used or not.

+1
Yup, I like this, it's a better fix. I've sent another patch for kernel.bbclass (both for master and morty) which I think is still needed even with your patch.

Cheers,
Stefan

Quoted 39 lines
meta/classes/externalsrc.bbclass +1 -1
index 65dd13ddc1f..12046d74e17 100644
@@ -102,7 +102,7 @@ python () {
         for task in d.getVar("SRCTREECOVEREDTASKS").split():
             if local_srcuri and task in fetch_tasks:
                 continue
-            bb.build.deltask(task, d)
+            d.setVarFlag(task, 'noexec', '1')
 
         d.prependVarFlag('do_compile', 'prefunc
 s', "externalsrc_compile_prefunc ")

d.prependVarFlag('do_configure', 'prefuncs',
"externalsrc_configure_prefunc ")

Quoted 20 lines
meta/classes/kernelsrc.bbclass +0 -0
 do_unpack[noexec] = "1"
 do_patch[noexec] = "1"
 do_package[depends] += "virtual/kernel:do_populate_sysroot"
meta/recipes- renamed from meta/recipes-kernel/perf/perf.bb +0 -0

kernel/perf/perf.bb
index 03ae446..145774b 100644

meta/recipes-kernel/perf/perf.bb +1 -2
@@ -47,7 +47,7 @@ export PYTHON_SITEPACKAGES_DIR
 #kernel 3.1+ supports WERROR to disable warnings as errors
 export WERROR = "0"
 
-do_populate_lic[depends] += "virtual/kernel:do_patch"
+do_populate_lic[depends] += "virtual/kernel:do_configure"
 
 # needed for building the tools/perf Perl binding
 inherit perlnative cpan-base
--

2.7.4