Bug 11120

Summary: perf doesn't compile when devtool used with kernel
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Jonathan Richardson <jon.richardson>
Component: kernelAssignee: Saul Wold <sgw>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: lixin.yao, tom.zanussi
Version: 2.2   
Target Milestone: 2.4 M1   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Jonathan Richardson 2017-03-02 22:31:29 UTC
The perf recipe doesn't compile when the kernel is "devtool'd". The recipe has this line:
do_populate_lic[depends] += "virtual/kernel:do_patch"

When devtool is used it looks like the do_patch task is removed. When reset the do_patch task is listed again (tested using bitbake -c listtasks). 

When the line above is removed the recipe compiles fine. perf is included in the image using IMAGE_FEATURES += "tools-debug tools-profile"

The error is:
ERROR: Task do_unpack in ../meta/recipes-kernel/perf/perf.bb depends upon non-existent task do_patch in my-linux_0.0.0.bb
ERROR: Command execution failed: 1

The kernel recipe inherits kernel.bbclass.
Comment 1 Jonathan Richardson 2017-03-10 02:22:17 UTC
Correction, the error is:

ERROR: Task do_populate_lic in /home/jonathar/work/yocto/sxc_test/poky/build/../meta/recipes-kernel/perf/perf.bb depends upon non-existent task do_patch in /home/jonathar/work/yocto/sxc_test/poky/build/../meta-brcm/common/recipes-kernel/linux/brcm-linux_0.0.0.bb

Then there is a subsequent error if I remove do_populate_lic[depends] += "virtual/kernel:do_patch" from perf.bb.

ERROR: Task do_unpack in ../meta/recipes-kernel/perf/perf.bb depends upon non-existent task do_patch in my-linux_0.0.0.bb
ERROR: Command execution failed: 1

This line from kernelsrc.bbclass:
do_unpack[depends] += "virtual/kernel:do_patch"

seems to cause the second error. Even though do_unpack is set to no_exec it's not enough to prevent the dependency error. Removing the line allows further progress but seems to cause other problems. I don't have a proper solution yet.
Comment 2 Jonathan Richardson 2017-03-21 18:11:13 UTC
Here is a fix or partial fix. There are a few issues.

1. STAGING_KERNEL_DIR isn't set when devtool is run on the kernel. This is probably a devtool bug. We set it manually to our source location.

2. In perf.bb I removed the following line. I don't think it's required anymore because commit 6e36cc9c40b16a51a60a3cbbd051da9285f37bcf removed LIC_FILES_CHKSUM:
-do_populate_lic[depends] += "virtual/kernel:do_patch"

3. In kernelsrc.bbclass I removed this line:
-do_unpack[depends] += "virtual/kernel:do_patch"

Not sure why perf's do_unpack dependency is required - there is no source for perf, it's compiling the kernel's code tools/perf. If kernelsrc.bbclass is intended to compile kernel utils only then I don't think it's required. As mentioned before, do_patch task doesn't exist when you devtool the kernel. 

Thanks.
Comment 3 Saul Wold 2017-05-18 19:04:35 UTC
*** Bug 11520 has been marked as a duplicate of this bug. ***