All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boszormenyi Zoltan <zboszor@pr.hu>
To: openembedded-devel@lists.openembedded.org
Subject: Trying to resolve build-time cyclic dependency between packages
Date: Wed, 29 Jul 2015 15:26:29 +0200	[thread overview]
Message-ID: <55B8D485.7080207@pr.hu> (raw)

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

Hi,

I have a customized Mesa 10.6.3 package recipe which depends on libva
to be able to build its mesa-va-driver subpackage, but libva also depends
on Mesa to support GLX.

Previously, I simply created a libva-noglx package that builds libva
with --disable-glx that Mesa depend on and the "real" libva package can
depend on Mesa.

But since I also have to produce an SDK image with all the *-dev packages,
creating such an initial image with bitbake fails because of a conflict
in the dependency chain: libva-dev -> mesa-dev -> libva-noglx-dev.

I have come up with the attached bbclass (based on Yocto 1.6) that
now Mesa can inherit and that patches the RDEPENDS / RRECOMMENDS
variables according to externally set variables. The comment at
the beginning of the file explains how to use it.

This pushes the cyclic dependency to opkg which happily breaks it and
installs both libva* and *mesa* packages properly. Creating the initial
image via bitbake works now.

Comments?

Best regards,
Zoltán Böszörményi


[-- Attachment #2: cyclic-deps.bbclass --]
[-- Type: text/plain, Size: 1766 bytes --]

# Resolve cyclic dependencies in final packages
#
# Example: Mesa vs libva cyclic dependency
#
# Resolving the cyclic dependency can be:
# 1. build libva without GLX support (libva-noglx package)
# 2. build mesa
# 3. build libva with GLX support
#
# Mesa's DEPENDS contains libva-noglx
# libva's DEPENDS contains mesa
# The subpackages of mesa will reference libva-noglx
#
# This class attempts to patch the final package dependencies
# with the following:
# CYCLIC_DEPENDS = "pkg"
# CYCLIC_DEPENDS_pkg = "basepkg"
#
# With the example of Mesa:
# CYCLIC_DEPENDS_PKGS = "libva"
# CYCLIC_DEPENDS_libva = "libva-noglx"

python package_depchains_append () {
    deps = d.getVar('CYCLIC_DEPENDS_PKGS', True).split()
    packages = d.getVar('PACKAGES', True).split()
    for pkg in packages:
        for dep in deps:
            depvar = 'CYCLIC_DEPENDS_' + dep
            basedep = d.getVar(depvar, True)
            bb.note("before cyclic dependency dep %s depvar %s basedep %s" % (dep, depvar, basedep))

            rdep = 'RDEPENDS_' + pkg
            rdepends = d.getVar(rdep, True)
            if rdepends:
                bb.note("before cyclic dependency fix %s = '%s'" % (rdep, rdepends))
                d.setVar(rdep, rdepends.replace(basedep, dep))
                bb.note("after cyclic dependency fix %s = '%s'" % (rdep, d.getVar(rdep, True)))

            rrec = 'RRECOMMENDS_' + pkg
            rrecommends = d.getVar(rrec, True)
            if rrecommends:
                bb.note("before cyclic dependency fix %s = '%s'" % (rrec, rrecommends))
                d.setVar(rrec, rrecommends.replace(basedep, dep))
                bb.note("after cyclic dependency fix %s = '%s'" % (rrec, d.getVar(rrec, True)))
}

             reply	other threads:[~2015-07-29 13:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-29 13:26 Boszormenyi Zoltan [this message]
2015-08-08 22:14 ` Trying to resolve build-time cyclic dependency between packages Khem Raj
2020-02-26  8:49   ` Böszörményi Zoltán
2020-02-26 11:43     ` Böszörményi Zoltán

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=55B8D485.7080207@pr.hu \
    --to=zboszor@pr.hu \
    --cc=openembedded-devel@lists.openembedded.org \
    /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.