All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Diego Santa Cruz" <diego.santacruz@spinetix.com>
To: "rpjday@crashcourse.ca" <rpjday@crashcourse.ca>,
	OE Core mailing list <openembedded-core@lists.openembedded.org>
Subject: Re: [OE-core] SDK question: does "-c populate_sdk" build SDK based on entire image?
Date: Wed, 12 May 2021 08:05:32 +0000	[thread overview]
Message-ID: <DB6PR0102MB2630B6451A1EA31186636ABC88529@DB6PR0102MB2630.eurprd01.prod.exchangelabs.com> (raw)
In-Reply-To: <36cf577f-e2e2-4c58-5cb5-37eafa42b266@crashcourse.ca>

> -----Original Message-----
> From: openembedded-core@lists.openembedded.org <openembedded-
> core@lists.openembedded.org> On Behalf Of Robert P. J. Day via
> lists.openembedded.org
> Sent: 07 May 2021 15:12
> To: OE Core mailing list <openembedded-core@lists.openembedded.org>
> Subject: [OE-core] SDK question: does "-c populate_sdk" build SDK based on
> entire image?
> 
> 
>   almost certainly a silly question as i'm still poring over the
> mechanics of standard SDK creation, but if i define a perfectly normal
> image, then build the corresponding SDK with:
> 
>   $ bitbake -c populate_sdk my_image
> 
> is the resulting SDK populated based on the entire contents of the
> target image? that is, if i subsequently add a new package to the
> target and rebuild the SDK, will the new SDK now contain the
> corresponding content from that newly-added package? (i'm just about
> to test this with a build but that's going to take over an hour on
> this server. *sigh* ...)

We use the SDK a lot to give application developers an easy to use a dev environment which has all the support to build against the libraries included in target images. The SDK of an image recipe will contain all the *-dev packages matching the packages installed in the target for the same image (i.e. if foobar is installed in the target image then foobar-dev is installed in the SDK image, if it exists).

> 
>   now, i realize that if i just want to add content to the SDK without
> adding to target, i can use one or both of:
> 
>   TOOLCHAIN_HOST_TASK
>   TOOLCHAIN_TARGET_TASK
> 
> but if someone asks for new content both for the target and the SDK,
> is it sufficient to just add to target?

Yes, with the exception of recipes for which only the headers are used when compiling a recipe that is included in the target image. As no library is being linked for it then no package is installed into the target, so no corresponding *-dev package is included in the SDK. A typical example of this is boost when the header-only boost libs are used (and I suspect the same happens for static libs). In such a case you can add the recipes to TOOLCHAIN_TARGET_TASK (we actually have an sdk packagegroup that we add to TOOLCHAIN_TARGET_TASK that pulls in all target SDK things that we want in the SDK but not in the target image).

Other things that you may need to add manually to TOOLCHAIN_HOST_TASK are supporting tools to run on the build host which are not included in the SDK by default, like nativesdk-glib-2.0-codegen to get the gdbus-codegen utility.

> 
>   and one more question that inspired all of this. i was asked to add
> a particular executable to an SDK, call it /usr/bin/fubar. fair
> enough, i thought, it was short work to determine that that binary
> came from the recipe fubar_1.0.bb. but i checked and that package was,
> in fact, being installed in the target, so i was puzzled as to why it
> wasn't in the SDK as well.
> 
>   i checked the recipe for fubar and, to my chagrin, it contained the
> snippet:
> 
>   do_install_append() {
>     rm -rf ${D}/usr/bin/fubar
>   }
> 
> well, that explained it, so as a first test, i'm just going to dump
> that snippet from the recipe, which will install the executable on the
> target, and will(?) also install it in the SDK?
> 
> rday
-- 
Diego Santa Cruz, PhD
Technology Architect
spinetix.com



      parent reply	other threads:[~2021-05-12  8:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-07 13:11 SDK question: does "-c populate_sdk" build SDK based on entire image? Robert P. J. Day
2021-05-07 13:21 ` [OE-core] " Quentin Schulz
2021-05-07 13:25   ` Robert P. J. Day
2021-05-07 13:47   ` Robert P. J. Day
2021-05-07 16:49     ` Andre McCurdy
2021-05-07 16:58       ` Robert P. J. Day
2021-05-10 16:21       ` Denys Dmytriyenko
2021-05-12  8:05 ` Diego Santa Cruz [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DB6PR0102MB2630B6451A1EA31186636ABC88529@DB6PR0102MB2630.eurprd01.prod.exchangelabs.com \
    --to=diego.santacruz@spinetix.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=rpjday@crashcourse.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.