Bug 10392 - Some suggested changes in '5.3.20.5. Packaging Externally Produced Binaries'
Summary: Some suggested changes in '5.3.20.5. Packaging Externally Produced Binaries'
Status: RESOLVED FIXED
Alias: None
Product: Development Manual
Classification: Documentation
Component: development (show other bugs)
Version: 2.2
Hardware: x86 Multiple
: Undecided normal
Target Milestone: 2.3 M1
Assignee: Scott Rifenbark
QA Contact:
URL:
Whiteboard: 11 Oct 2016: RESOLVED
Depends on:
Blocks:
 
Reported: 2016-10-07 05:19 UTC by ulfalizer
Modified: 2016-10-11 14:38 UTC (History)
2 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Done (doc changes complete)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ulfalizer 2016-10-07 05:19:52 UTC
Hello Scott,

Here's two suggested changes in '5.3.20.5. Packaging Externally Produced Binaries'

1. I often see people needlessly putting [noexec] on tasks, making recipes more
   complicated than they need to be. Replacing the first note with the
   following one might help. I think the note about making the tasks empty at
   the end could be removed, because [noexec] is simpler.

     * Create a recipe where the do_configure and do_compile tasks do nothing.
       It is usually sufficient to just not define these tasks in the recipe,
       because the default implementations do nothing unless a Makefile is
       found in ${S}.
       
       If ${S} might contain a Makefile, or if you inherit some class that
       replaces do_configure and do_compile with custom versions, then you can
       use the [[noexec]](https://www.yoctoproject.org/docs/2.2/bitbake-user-manual/bitbake-user-manual.html#variable-flags)
       flag to turn the tasks into no-ops, as follows:

         do_configure[noexec] = "1"
         do_compile[noexec] = "1"

       Unlike [deleting the tasks](https://www.yoctoproject.org/docs/2.2/bitbake-user-manual/bitbake-user-manual.html#deleting-a-task),
       this preserves the dependency chain from the do_fetch, do_unpack, and
       do_patch tasks to the do_install task.

2. There's already a note in the DEPENDS glossary entry, but I think it helps
   to emphasize that DEPENDS might be needed for binary components here as
   well. This new note could be added at the end:

     * Using [DEPENDS] is a good idea even for components distributed in binary
       form, and often necessary for shared libraries. For a shared library,
       listing the library dependencies in DEPENDS makes sure that they are
       available in the staging sysroot when other recipes link against the
       library, which might be necessary for successful linking.
       
       Using DEPENDS also allows runtime dependencies between packages to be
       added automatically. See the
       [Automatically Added Runtime Dependencies](http://www.yoctoproject.org/docs/2.2/ref-manual/ref-manual.html#automatically-added-runtime-dependencies)
       section in the Yocto Project Reference Manual.


Cheers,
Ulf
Comment 1 Scott Rifenbark 2016-10-10 18:23:25 UTC
Hi Ulf, 

See http://www.yoctoproject.org/docs/2.2/dev-manual/dev-manual.html#packaging-externally-produced-binaries for the first change.  I am unclear what you want me to do for where you say "I think the note about making the tasks empty at the end could be removed, because [noexec] is simpler."  I don't see that in the original section.  So maybe you can explain that further to me.

See the newly added last bullet item for the second change about mentioning DEPENDS.  

Thanks,
Scott
Comment 2 ulfalizer 2016-10-11 00:59:05 UTC
Hello,

The old description had "alternatively, you can make these tasks an empty function", so that was what I was talking about. :)

The changes look good. I just realized that it's a bit weird to have the DEPENDS bullet item at the end though, since it applies regardless of whether you're using bin_package. Could it be turned into a Note {} and moved before "if you can't use the bin_package class, you need..." instead?

Could close right away after that.

Thanks,
Ulf
Comment 3 Scott Rifenbark 2016-10-11 14:38:53 UTC
Ulf, 

Ok - fixed it up.  See http://www.yoctoproject.org/docs/2.2/dev-manual/dev-manual.html#packaging-externally-produced-binaries.

Setting to RESOLVED and putting the flag to "done."

Thanks, 
Scott