[yocto] Enforcing version constraints on dependencies at build-time

Matt Hoosier matt.hoosier at gmail.com
Tue Apr 4 13:26:34 PDT 2017


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20170404/d7b0cc92/attachment.html>


More information about the yocto mailing list