All of lore.kernel.org
 help / color / mirror / Atom feed
* how to reuse generated library in a nativesdk recipe #sdk #systemd
@ 2020-02-19  9:37 Armando Hernandez
  2020-02-19  9:44 ` [yocto] " Mikko Rapeli
  0 siblings, 1 reply; 7+ messages in thread
From: Armando Hernandez @ 2020-02-19  9:37 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 893 bytes --]

Hello,

I have a recipe that builds a library. The recipe specifies an additional package "${PN}-systemd" along with other systemd related variables and finally it instructs that the package should be built with "-DWITH_SYSTEMD=ON" being passed to cmake. So far so good. But, I extended this recipe to nativesdk because I need this library on it. When trying to build the corresponding nativesdk package, the build fails at the configuration step (i.e. "do_configure") claiming it cannot find the package systemd.

Is there a way I can install the -already-generated libraries into my SDK (potentially via the corresponding nativesdk recipe) without having to rebuild the package? Or do I need to somehow include such systemd package in my sdk (which I don't think I need at all)?

Any hints and pointers as to were to look at are very well appreciated.
Thanks.

Armando Hernandez

[-- Attachment #2: Type: text/html, Size: 1871 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [yocto] how to reuse generated library in a nativesdk recipe #sdk #systemd
  2020-02-19  9:37 how to reuse generated library in a nativesdk recipe #sdk #systemd Armando Hernandez
@ 2020-02-19  9:44 ` Mikko Rapeli
       [not found]   ` <CAGpycA+PGsbqnJL1FD8pPNzWK3203RoBTPPD08Vwjn5J9aGMJA@mail.gmail.com>
  2020-02-19 21:57   ` Martin Jansa
  0 siblings, 2 replies; 7+ messages in thread
From: Mikko Rapeli @ 2020-02-19  9:44 UTC (permalink / raw)
  To: j.armandohernandez.j; +Cc: yocto

Hi,

On Wed, Feb 19, 2020 at 01:37:19AM -0800, Armando Hernandez wrote:
> Hello,
> 
> I have a recipe that builds a library. The recipe specifies an additional package "${PN}-systemd" along with other systemd related variables and finally it instructs that the package should be built with "-DWITH_SYSTEMD=ON" being passed to cmake. So far so good. But, I extended this recipe to nativesdk because I need this library on it. When trying to build the corresponding nativesdk package, the build fails at the configuration step (i.e. "do_configure") claiming it cannot find the package systemd.
> 
> Is there a way I can install the -already-generated libraries into my SDK (potentially via the corresponding nativesdk recipe) without having to rebuild the package? Or do I need to somehow include such systemd package in my sdk (which I don't think I need at all)?
> 
> Any hints and pointers as to were to look at are very well appreciated.
> Thanks.

Make the systemd dependency for target only, e.g. DEPENDS_class-target += "systemd"
etc.

There may be relevant use cases to build some of systemd components or tools
to native or nativesdk targets too. In that case add BBCLASSEXTEND += "nativesdk" etc
in a bbappend to systemd.

Hope this helps,

-Mikko

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [yocto] how to reuse generated library in a nativesdk recipe #sdk #systemd
       [not found]   ` <CAGpycA+PGsbqnJL1FD8pPNzWK3203RoBTPPD08Vwjn5J9aGMJA@mail.gmail.com>
@ 2020-02-19 15:57     ` Mikko Rapeli
  0 siblings, 0 replies; 7+ messages in thread
From: Mikko Rapeli @ 2020-02-19 15:57 UTC (permalink / raw)
  To: j.armandohernandez.j, yocto

Hi,

(lets keep this on the list too)

On Wed, Feb 19, 2020 at 04:51:18PM +0100, Armando Hernandez wrote:
> Hi Mikko,
> 
> Thanks for your reply. I checked your suggestion but does not work for me.
> I did included a .bbappend file in which I:
> 
>    - re-set EXTRA_OECMAKE to an empty string (i.e. ""). - my intention was
>    to pass no arguments when building the nativesdk. Now I know that this
>    accion overwrites the value of EXTRA_OECMAKE in the original .bb file
>    - added the line BBCLASSEXTEND = "nativesdk" to this new .bbappend file
>    - added the line DEPENDS_class-target += "systemd" to the original .bb
>    file
> 
> I found out that this configures both the target and the nativesdk
> libraries without systemd - which later on causes a failure when bitbake
> attempts to pull up everything to create the final image.
> 
> Basically, I'd like to find a way to unset or overwrite the following
> variables when building the nativesdk package:
> 
>    - SYSTEMD_PACKAGES
>    - SYSTEMD_SERVICE_${PN}
>    - SYSTEMD_AUTO_ENABLE_${PN}
>    - SYSTEMD_SERVICE_${PN}-systemd
>    - SYSTEMD_AUTO_ENABLE_${PN}-systemd
>    - EXTRA_OECMAKE

You can add _class-[target|native|nativesdk] to all variables
to override defaults.

Verify with "bitbake -e".

Hope this helps,

-Mikko

> Is it possible to do so? Or do I come up with another recipe of the sama
> package exclusively for the nativesdk?
> 
> Thanks again.
> 
> Armando Hernandez
> 
> On Wed, Feb 19, 2020 at 10:44 AM <Mikko.Rapeli@bmw.de> wrote:
> 
> > Hi,
> >
> > On Wed, Feb 19, 2020 at 01:37:19AM -0800, Armando Hernandez wrote:
> > > Hello,
> > >
> > > I have a recipe that builds a library. The recipe specifies an
> > additional package "${PN}-systemd" along with other systemd related
> > variables and finally it instructs that the package should be built with
> > "-DWITH_SYSTEMD=ON" being passed to cmake. So far so good. But, I extended
> > this recipe to nativesdk because I need this library on it. When trying to
> > build the corresponding nativesdk package, the build fails at the
> > configuration step (i.e. "do_configure") claiming it cannot find the
> > package systemd.
> > >
> > > Is there a way I can install the -already-generated libraries into my
> > SDK (potentially via the corresponding nativesdk recipe) without having to
> > rebuild the package? Or do I need to somehow include such systemd package
> > in my sdk (which I don't think I need at all)?
> > >
> > > Any hints and pointers as to were to look at are very well appreciated.
> > > Thanks.
> >
> > Make the systemd dependency for target only, e.g. DEPENDS_class-target +=
> > "systemd"
> > etc.
> >
> > There may be relevant use cases to build some of systemd components or
> > tools
> > to native or nativesdk targets too. In that case add BBCLASSEXTEND +=
> > "nativesdk" etc
> > in a bbappend to systemd.
> >
> > Hope this helps,
> >
> > -Mikko

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [yocto] how to reuse generated library in a nativesdk recipe #sdk #systemd
  2020-02-19  9:44 ` [yocto] " Mikko Rapeli
       [not found]   ` <CAGpycA+PGsbqnJL1FD8pPNzWK3203RoBTPPD08Vwjn5J9aGMJA@mail.gmail.com>
@ 2020-02-19 21:57   ` Martin Jansa
  2020-02-20  8:14     ` Mikko Rapeli
  1 sibling, 1 reply; 7+ messages in thread
From: Martin Jansa @ 2020-02-19 21:57 UTC (permalink / raw)
  To: Mikko Rapeli; +Cc: j.armandohernandez.j, yocto

[-- Attachment #1: Type: text/plain, Size: 1541 bytes --]

> DEPENDS_class-target += "systemd"

You surely meant
DEPENDS_append_class-target = " systemd"
here

On Wed, Feb 19, 2020 at 10:48 PM Mikko Rapeli <mikko.rapeli@bmw.de> wrote:

> Hi,
>
> On Wed, Feb 19, 2020 at 01:37:19AM -0800, Armando Hernandez wrote:
> > Hello,
> >
> > I have a recipe that builds a library. The recipe specifies an
> additional package "${PN}-systemd" along with other systemd related
> variables and finally it instructs that the package should be built with
> "-DWITH_SYSTEMD=ON" being passed to cmake. So far so good. But, I extended
> this recipe to nativesdk because I need this library on it. When trying to
> build the corresponding nativesdk package, the build fails at the
> configuration step (i.e. "do_configure") claiming it cannot find the
> package systemd.
> >
> > Is there a way I can install the -already-generated libraries into my
> SDK (potentially via the corresponding nativesdk recipe) without having to
> rebuild the package? Or do I need to somehow include such systemd package
> in my sdk (which I don't think I need at all)?
> >
> > Any hints and pointers as to were to look at are very well appreciated.
> > Thanks.
>
> Make the systemd dependency for target only, e.g. DEPENDS_class-target +=
> "systemd"
> etc.
>
> There may be relevant use cases to build some of systemd components or
> tools
> to native or nativesdk targets too. In that case add BBCLASSEXTEND +=
> "nativesdk" etc
> in a bbappend to systemd.
>
> Hope this helps,
>
> -Mikko
>

[-- Attachment #2: Type: text/html, Size: 1969 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [yocto] how to reuse generated library in a nativesdk recipe #sdk #systemd
  2020-02-19 21:57   ` Martin Jansa
@ 2020-02-20  8:14     ` Mikko Rapeli
  2020-02-20 11:55       ` Martin Jansa
  0 siblings, 1 reply; 7+ messages in thread
From: Mikko Rapeli @ 2020-02-20  8:14 UTC (permalink / raw)
  To: martin.jansa; +Cc: j.armandohernandez.j, yocto

On Wed, Feb 19, 2020 at 10:57:41PM +0100, Martin Jansa wrote:
> > DEPENDS_class-target += "systemd"
> 
> You surely meant
> DEPENDS_append_class-target = " systemd"
> here

Yes, quite likely. Tough reason why += doesn't work is a mystery to me :)

I hack things until "bitbake -e" shows the right things for the recipes.

-Mikko

> On Wed, Feb 19, 2020 at 10:48 PM Mikko Rapeli <mikko.rapeli@bmw.de> wrote:
> 
> > Hi,
> >
> > On Wed, Feb 19, 2020 at 01:37:19AM -0800, Armando Hernandez wrote:
> > > Hello,
> > >
> > > I have a recipe that builds a library. The recipe specifies an
> > additional package "${PN}-systemd" along with other systemd related
> > variables and finally it instructs that the package should be built with
> > "-DWITH_SYSTEMD=ON" being passed to cmake. So far so good. But, I extended
> > this recipe to nativesdk because I need this library on it. When trying to
> > build the corresponding nativesdk package, the build fails at the
> > configuration step (i.e. "do_configure") claiming it cannot find the
> > package systemd.
> > >
> > > Is there a way I can install the -already-generated libraries into my
> > SDK (potentially via the corresponding nativesdk recipe) without having to
> > rebuild the package? Or do I need to somehow include such systemd package
> > in my sdk (which I don't think I need at all)?
> > >
> > > Any hints and pointers as to were to look at are very well appreciated.
> > > Thanks.
> >
> > Make the systemd dependency for target only, e.g. DEPENDS_class-target +=
> > "systemd"
> > etc.
> >
> > There may be relevant use cases to build some of systemd components or
> > tools
> > to native or nativesdk targets too. In that case add BBCLASSEXTEND +=
> > "nativesdk" etc
> > in a bbappend to systemd.
> >
> > Hope this helps,
> >
> > -Mikko
> >

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [yocto] how to reuse generated library in a nativesdk recipe #sdk #systemd
  2020-02-20  8:14     ` Mikko Rapeli
@ 2020-02-20 11:55       ` Martin Jansa
  2020-02-20 12:01         ` Mikko Rapeli
  0 siblings, 1 reply; 7+ messages in thread
From: Martin Jansa @ 2020-02-20 11:55 UTC (permalink / raw)
  To: Mikko.Rapeli; +Cc: j.armandohernandez.j, yocto

[-- Attachment #1: Type: text/plain, Size: 2890 bytes --]

On Thu, Feb 20, 2020 at 08:14:04AM +0000, Mikko.Rapeli@bmw.de wrote:
> On Wed, Feb 19, 2020 at 10:57:41PM +0100, Martin Jansa wrote:
> > > DEPENDS_class-target += "systemd"
> > 
> > You surely meant
> > DEPENDS_append_class-target = " systemd"
> > here
> 
> Yes, quite likely. Tough reason why += doesn't work is a mystery to me :)
> 
> I hack things until "bitbake -e" shows the right things for the recipes.

I agree it's a bit confusing at first (I was doing the same long time
ago, before bitbake -e was even showing the history of evaluation), but
everybody who uses bitbake often should learn this simple difference:

FOO_append_override = " bar"
  is "conditional" append, so it will append "bar" only when "override" is
being used

FOO_override += "bar"
  always appends to "FOO_override" and then it overrides whole "FOO" variable

There are other more subtle differences like "+=" adds leading space,
_append doesn't and _append is processed later (which is important when
appending to variable set with ?=), but the above difference is a must
to know.

Also
FOO_append += "bar"
is just silly way how to add leading space to the value, one should
always use
FOO_append = " bar"
when appending to space separated list (like DEPENDS).

Cheers,

> -Mikko
> 
> > On Wed, Feb 19, 2020 at 10:48 PM Mikko Rapeli <mikko.rapeli@bmw.de> wrote:
> > 
> > > Hi,
> > >
> > > On Wed, Feb 19, 2020 at 01:37:19AM -0800, Armando Hernandez wrote:
> > > > Hello,
> > > >
> > > > I have a recipe that builds a library. The recipe specifies an
> > > additional package "${PN}-systemd" along with other systemd related
> > > variables and finally it instructs that the package should be built with
> > > "-DWITH_SYSTEMD=ON" being passed to cmake. So far so good. But, I extended
> > > this recipe to nativesdk because I need this library on it. When trying to
> > > build the corresponding nativesdk package, the build fails at the
> > > configuration step (i.e. "do_configure") claiming it cannot find the
> > > package systemd.
> > > >
> > > > Is there a way I can install the -already-generated libraries into my
> > > SDK (potentially via the corresponding nativesdk recipe) without having to
> > > rebuild the package? Or do I need to somehow include such systemd package
> > > in my sdk (which I don't think I need at all)?
> > > >
> > > > Any hints and pointers as to were to look at are very well appreciated.
> > > > Thanks.
> > >
> > > Make the systemd dependency for target only, e.g. DEPENDS_class-target +=
> > > "systemd"
> > > etc.
> > >
> > > There may be relevant use cases to build some of systemd components or
> > > tools
> > > to native or nativesdk targets too. In that case add BBCLASSEXTEND +=
> > > "nativesdk" etc
> > > in a bbappend to systemd.
> > >
> > > Hope this helps,
> > >
> > > -Mikko
> > >

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 201 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [yocto] how to reuse generated library in a nativesdk recipe #sdk #systemd
  2020-02-20 11:55       ` Martin Jansa
@ 2020-02-20 12:01         ` Mikko Rapeli
  0 siblings, 0 replies; 7+ messages in thread
From: Mikko Rapeli @ 2020-02-20 12:01 UTC (permalink / raw)
  To: martin.jansa; +Cc: j.armandohernandez.j, yocto

Hi,

On Thu, Feb 20, 2020 at 12:55:43PM +0100, Martin Jansa wrote:
> On Thu, Feb 20, 2020 at 08:14:04AM +0000, Mikko.Rapeli@bmw.de wrote:
> > On Wed, Feb 19, 2020 at 10:57:41PM +0100, Martin Jansa wrote:
> > > > DEPENDS_class-target += "systemd"
> > > 
> > > You surely meant
> > > DEPENDS_append_class-target = " systemd"
> > > here
> > 
> > Yes, quite likely. Tough reason why += doesn't work is a mystery to me :)
> > 
> > I hack things until "bitbake -e" shows the right things for the recipes.
> 
> I agree it's a bit confusing at first (I was doing the same long time
> ago, before bitbake -e was even showing the history of evaluation), but
> everybody who uses bitbake often should learn this simple difference:
> 
> FOO_append_override = " bar"
>   is "conditional" append, so it will append "bar" only when "override" is
> being used
> 
> FOO_override += "bar"
>   always appends to "FOO_override" and then it overrides whole "FOO" variable

Thanks for this explanation!

> There are other more subtle differences like "+=" adds leading space,
> _append doesn't and _append is processed later (which is important when
> appending to variable set with ?=), but the above difference is a must
> to know.
> 
> Also
> FOO_append += "bar"
> is just silly way how to add leading space to the value, one should
> always use
> FOO_append = " bar"
> when appending to space separated list (like DEPENDS).

Hmm. I would rather see FOO_append += "bar" being used every time when
spaces are expected. It's way too easy to forget the extra space which causes
annoying and hard to debug issues, and is often missed in reviews too.

Cheers,

-Mikko

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-02-20 12:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-19  9:37 how to reuse generated library in a nativesdk recipe #sdk #systemd Armando Hernandez
2020-02-19  9:44 ` [yocto] " Mikko Rapeli
     [not found]   ` <CAGpycA+PGsbqnJL1FD8pPNzWK3203RoBTPPD08Vwjn5J9aGMJA@mail.gmail.com>
2020-02-19 15:57     ` Mikko Rapeli
2020-02-19 21:57   ` Martin Jansa
2020-02-20  8:14     ` Mikko Rapeli
2020-02-20 11:55       ` Martin Jansa
2020-02-20 12:01         ` Mikko Rapeli

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.