Bug 11121

Summary: Error in depmodwrapper-cross_1.0.bb when archiver inherited
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Jonathan Richardson <jon.richardson>
Component: kernelAssignee: Richard Purdie <richard.purdie>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: mariano.lopez, ross.burton, tom.zanussi
Version: 2.2   
Target Milestone: 2.5   
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:41:36 UTC
'inherit nopackages' was added to the recipes-kernel/kmod/depmodwrapper-cross_1.0.bb. nopackages deletes the do_package_write_rpm task. But that task is required by the archiver and it reports an error when INHERIT += "archiver" is added to local.conf. The error reported is:

Initialising tasks...ERROR: Task do_deploy_archives in ../meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb depends upon non-existent task do_package_write_rpm in ../meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb

I added this line as a fix. Will report as a bug to let you decide whether it's an appropriate fix or not:

+# The archiver requires tasks that nopackages deletes.
+inherit ${@'nopackages' if not bb.data.inherits_class('archiver', d) else ''}
Comment 1 Leonardo Sandoval Gonzalez 2017-06-12 20:36:42 UTC
(In reply to comment #0)
> 'inherit nopackages' was added to the
> recipes-kernel/kmod/depmodwrapper-cross_1.0.bb. nopackages deletes the
> do_package_write_rpm task. But that task is required by the archiver and it
> reports an error when INHERIT += "archiver" is added to local.conf. The
> error reported is:
> 
> Initialising tasks...ERROR: Task do_deploy_archives in
> ../meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb depends upon
> non-existent task do_package_write_rpm in
> ../meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb
> 
> I added this line as a fix. Will report as a bug to let you decide whether
> it's an appropriate fix or not:
> 
> +# The archiver requires tasks that nopackages deletes.
> +inherit ${@'nopackages' if not bb.data.inherits_class('archiver', d) else
> ''}

I like the approach, but also not sure if this is the right one. Adding Ross, he definitely has better idea on how to handle this.
Comment 2 Leonardo Sandoval Gonzalez 2017-06-14 20:52:31 UTC
I see no problem with this approach so sent to the ML

http://lists.openembedded.org/pipermail/openembedded-core/2017-June/138170.html
Comment 3 Richard Purdie 2017-12-19 09:49:25 UTC
To reproduce you need:

    INHERIT += "archiver"
    ARCHIVER_MODE[srpm] = "1"

and the issue is that depmodwrapper-cross doesn't empty PACKAGES. I'll send a patch for emptying PACKAGES as that is a preferred fix to this anonymous python fragment.