All of lore.kernel.org
 help / color / mirror / Atom feed
* Enforcing version constraints on dependencies at build-time
@ 2017-04-04 20:26 Matt Hoosier
  2017-04-04 21:07 ` Burton, Ross
  0 siblings, 1 reply; 2+ messages in thread
From: Matt Hoosier @ 2017-04-04 20:26 UTC (permalink / raw)
  To: yocto

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

The RDEPENDS variable supports giving numeric version bounds. For example:

  RDEPENDS_${PN} = "foo (>= 1.3)"

That works well for getting version dependencies respected at rootfs time.
But DEPENDS (used at build-time) silently ignores any similar constraint
arguments. For example:

  DEPENDS = "foo (>= 1.3)"

will not cause a recipe to be skipped if foo is present only at some
version less than 1.3.

I've tried a couple of workarounds in functions like so:

  python () {
    # Pseudocode. Version-number parsing would have to be done.
    if d.getVar('PV_pn-foo', True) < '1.3':
      raise bb.parse.SkipException('...')
  }

but ${PV_pn-foo} always just evaluates to None. I think this is because of
the well-defined boundaries between instantiations of variables in one
recipe and the next.

Is there any way to escape that isolation and express version boundaries?

-Matt

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

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

* Re: Enforcing version constraints on dependencies at build-time
  2017-04-04 20:26 Enforcing version constraints on dependencies at build-time Matt Hoosier
@ 2017-04-04 21:07 ` Burton, Ross
  0 siblings, 0 replies; 2+ messages in thread
From: Burton, Ross @ 2017-04-04 21:07 UTC (permalink / raw)
  To: Matt Hoosier; +Cc: yocto

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

On 4 April 2017 at 21:26, Matt Hoosier <matt.hoosier@gmail.com> wrote:

> Is there any way to escape that isolation and express version boundaries?
>

You're right, the recipe isolation means you can't do this from inside a
recipe's contet.

I'd like to see bitbake actually verify that the version constraints are
satisfied, and fail if they are not.

https://bugzilla.yoctoproject.org/show_bug.cgi?id=8745 is a bug talking
about this.  Patches welcome...

Ross

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

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

end of thread, other threads:[~2017-04-04 21:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-04 20:26 Enforcing version constraints on dependencies at build-time Matt Hoosier
2017-04-04 21:07 ` Burton, Ross

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.