All of lore.kernel.org
 help / color / mirror / Atom feed
* DEPENDS only half working
@ 2017-02-01 10:38 colin.helliwell
  2017-02-01 10:48 ` Patrick Ohly
  0 siblings, 1 reply; 4+ messages in thread
From: colin.helliwell @ 2017-02-01 10:38 UTC (permalink / raw)
  To: yocto

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

I've got an odd problem with a pair of recipes:

App 'bar' uses 'libfoo', so I've set a DEPENDS in bar.bb - I can see this is
being half picked up, because 'bitbake bar' shows both builds being started.
However bar isn't waiting on libfoo - bar tries to compile before libfoo has
even finished configuring, let alone compiled and installed it's header
(foo_lib.h) into sysroot.

I think the recipes are probably otherwise correct - if I 'bitbake libfoo'
then 'bitbake bar' then all works.

I've looked at some simple lib recipes within poky (e.g. libwebp_0.4.3.bb /
webkitgtk_2.8.5.bb), and can't spot anything wrong/missing. Not sure if
libfoo should have any 'install' or similar sections, or any FILES_
settings, but I was [naively.?] hoping that the inherited classes will be
sorting out all that generic kinda stuff.

 

Anyone help please? 

 

libfoo.bb :

 

.

inherit autotools lib_package binconfig-disabled pkgconfig

RPROVIDES_${PN} = "libfoo"

PROVIDES_${PN} = "libfoo"

PR = "r0"

SRC_URI = " ...<src files>..   "

S = "${WORKDIR}"

 

 

bar.bb :

 

..

inherit autotools binconfig-disabled pkgconfig

DEPENDS_${PN} = "libfoo"

RDEPENDS_${PN} = "libfoo"

S = "${WORKDIR}"

SRC_URI = " ...<src files>..   "

EXTRA_OEMAKE = " CFLAGS=" -I${STAGING_DIR_TARGET}/usr/include/libfoo " "

EXTRA_OEMAKE += " LDFLAGS=" -lfoo " "

 

 

libfoo Makefile.am:

 

lib_LTLIBRARIES = libfoo.la

pkginclude_HEADERS = foo_lib.h  

libfoo_la_SOURCES = $(libfoo_a_HEADERS) foo_lib.c

 


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

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

* Re: DEPENDS only half working
  2017-02-01 10:38 DEPENDS only half working colin.helliwell
@ 2017-02-01 10:48 ` Patrick Ohly
  2017-02-01 10:53   ` colin.helliwell
  2017-02-01 12:52   ` Jussi Kukkonen
  0 siblings, 2 replies; 4+ messages in thread
From: Patrick Ohly @ 2017-02-01 10:48 UTC (permalink / raw)
  To: colin.helliwell; +Cc: yocto

On Wed, 2017-02-01 at 10:38 +0000, colin.helliwell@ln-systems.com wrote:
> I’ve got an odd problem with a pair of recipes:
> 
> App ‘bar’ uses ‘libfoo’, so I’ve set a DEPENDS in bar.bb – I can see
> this is being half picked up, because ‘bitbake bar’ shows both builds
> being started. However bar isn’t waiting on libfoo – bar tries to
> compile before libfoo has even finished configuring, let alone
> compiled and installed it’s header (foo_lib.h) into sysroot.
> 
> I think the recipes are probably otherwise correct - if I ‘bitbake
> libfoo’ then ‘bitbake bar’ then all works.
> 
> I’ve looked at some simple lib recipes within poky (e.g.
> libwebp_0.4.3.bb / webkitgtk_2.8.5.bb), and can’t spot anything
> wrong/missing. Not sure if libfoo should have any ‘install’ or similar
> sections, or any FILES_ settings, but I was [naively…?] hoping that
> the inherited classes will be sorting out all that generic kinda
> stuff.

[...]

> DEPENDS_${PN} = "libfoo"
  ^^^^^^^^^^^^^
This needs to be just "DEPENDS". DEPENDS sets the dependencies for the
compilation of the entire recipe, whereas...

> RDEPENDS_${PN} = "libfoo"

... RDEPENDS is for runtime dependencies specific packages and thus has
_<package name> as suffix ($PN = bar in this case).

libfoo gets compiled because of this entry, but because it is a runtime
dependency, compilation of bar doesn't wait for libfoo's completion.

-- 
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.





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

* Re: DEPENDS only half working
  2017-02-01 10:48 ` Patrick Ohly
@ 2017-02-01 10:53   ` colin.helliwell
  2017-02-01 12:52   ` Jussi Kukkonen
  1 sibling, 0 replies; 4+ messages in thread
From: colin.helliwell @ 2017-02-01 10:53 UTC (permalink / raw)
  To: yocto

Fantastic - thanks. (Thought it must have been something simple!)

-----Original Message-----
From: Patrick Ohly [mailto:patrick.ohly@intel.com] 
Sent: 01 February 2017 10:48
To: colin.helliwell@ln-systems.com
Cc: yocto@yoctoproject.org
Subject: Re: [yocto] DEPENDS only half working

On Wed, 2017-02-01 at 10:38 +0000, colin.helliwell@ln-systems.com wrote:
> I’ve got an odd problem with a pair of recipes:
> 
> App ‘bar’ uses ‘libfoo’, so I’ve set a DEPENDS in bar.bb – I can see 
> this is being half picked up, because ‘bitbake bar’ shows both builds 
> being started. However bar isn’t waiting on libfoo – bar tries to 
> compile before libfoo has even finished configuring, let alone 
> compiled and installed it’s header (foo_lib.h) into sysroot.
> 
> I think the recipes are probably otherwise correct - if I ‘bitbake 
> libfoo’ then ‘bitbake bar’ then all works.
> 
> I’ve looked at some simple lib recipes within poky (e.g.
> libwebp_0.4.3.bb / webkitgtk_2.8.5.bb), and can’t spot anything 
> wrong/missing. Not sure if libfoo should have any ‘install’ or similar 
> sections, or any FILES_ settings, but I was [naively…?] hoping that 
> the inherited classes will be sorting out all that generic kinda 
> stuff.

[...]

> DEPENDS_${PN} = "libfoo"
  ^^^^^^^^^^^^^
This needs to be just "DEPENDS". DEPENDS sets the dependencies for the compilation of the entire recipe, whereas...

> RDEPENDS_${PN} = "libfoo"

... RDEPENDS is for runtime dependencies specific packages and thus has _<package name> as suffix ($PN = bar in this case).

libfoo gets compiled because of this entry, but because it is a runtime dependency, compilation of bar doesn't wait for libfoo's completion.

--
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although I am an employee of Intel, the statements I make here in no way represent Intel's position on the issue, nor am I authorized to speak on behalf of Intel on this matter.






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

* Re: DEPENDS only half working
  2017-02-01 10:48 ` Patrick Ohly
  2017-02-01 10:53   ` colin.helliwell
@ 2017-02-01 12:52   ` Jussi Kukkonen
  1 sibling, 0 replies; 4+ messages in thread
From: Jussi Kukkonen @ 2017-02-01 12:52 UTC (permalink / raw)
  To: Patrick Ohly; +Cc: Yocto Project

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

On 1 February 2017 at 12:48, Patrick Ohly <patrick.ohly@intel.com> wrote:

> On Wed, 2017-02-01 at 10:38 +0000, colin.helliwell@ln-systems.com wrote:
> > I’ve got an odd problem with a pair of recipes:
> >
> > App ‘bar’ uses ‘libfoo’, so I’ve set a DEPENDS in bar.bb – I can see
> > this is being half picked up, because ‘bitbake bar’ shows both builds
> > being started. However bar isn’t waiting on libfoo – bar tries to
> > compile before libfoo has even finished configuring, let alone
> > compiled and installed it’s header (foo_lib.h) into sysroot.
> >
> > I think the recipes are probably otherwise correct - if I ‘bitbake
> > libfoo’ then ‘bitbake bar’ then all works.
> >
> > I’ve looked at some simple lib recipes within poky (e.g.
> > libwebp_0.4.3.bb / webkitgtk_2.8.5.bb), and can’t spot anything
> > wrong/missing. Not sure if libfoo should have any ‘install’ or similar
> > sections, or any FILES_ settings, but I was [naively…?] hoping that
> > the inherited classes will be sorting out all that generic kinda
> > stuff.
>
> [...]
>
> > DEPENDS_${PN} = "libfoo"
>   ^^^^^^^^^^^^^
> This needs to be just "DEPENDS". DEPENDS sets the dependencies for the
> compilation of the entire recipe, whereas...
>
> > RDEPENDS_${PN} = "libfoo"
>
> ... RDEPENDS is for runtime dependencies specific packages and thus has
> _<package name> as suffix ($PN = bar in this case).
>
>
You also don't need the RDEPENDS_${PN} line in your recipe at all in normal
cases: if your app links with libfoo, the runtime dependency will be
automatically added.

Jussi

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

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

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

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-01 10:38 DEPENDS only half working colin.helliwell
2017-02-01 10:48 ` Patrick Ohly
2017-02-01 10:53   ` colin.helliwell
2017-02-01 12:52   ` Jussi Kukkonen

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.