[bitbake-devel] Conditionally inherit own-mirrors and set SOURCE_MIRROR_URL?

Evade Flow evadeflow at gmail.com
Fri Sep 2 19:26:39 UTC 2016


> You could do something like:
...
>
SOURCE_MIRROR_URL ?= "{@base_contains('LOCALBUILD', 'local', 'file://xxx', '
http://xxx', d)}"


That's exactly what I was looking for, thanks. I gather I can't put
functions in local.conf, which is where our current build is setting
SOURCE_MIRROR_URL. Can I trouble you to recommend a home for such a
function? It 'feels weird' to put it in a recipe, is there some other,
semi-standard place to stuff helper functions?

On Fri, Sep 2, 2016 at 7:57 AM, Richard Purdie <
richard.purdie at linuxfoundation.org> wrote:

> On Thu, 2016-09-01 at 11:29 -0400, Evade Flow wrote:
> > This might be an 'X-Y' problem, so I should explain what I'm trying
> > to achieve. We have a somewhat beefy build server with 32 cores that
> > most of my team likes to `ssh` into to do builds of our Yocto/OE
> > -based BSP. But a few of us build on different machines often enough
> > that I recently spun up a web server—on the 32-core build machine—to
> > act as a 'pre-mirror' to statically serve  our dependencies for
> > remote builds. The web server is serving the exact same folder that
> > I've been pointing `SOURCE_MIRROR_URL` at, as described at: https://w
> > iki.yoctoproject.org/wiki/How_do_I#Q:_How_do_I_create_my_own_source_d
> > ownload_mirror_.3F
> >
> > When I went to integrate support for the HTTP pre-mirror, I ran into
> > the following problem: if I assign `SOURCE_MIRROR_URL` and the
> > specified folder doesn't exist (as will be the case for remote
> > builds), the build *fails*. I had hoped that bitbake would 'fall
> > through' to searching other pre-mirrors, but that doesn't appear to
> > be the case(?)
> >
> > IIs there some way I can use a specific (and *invariant*) local
> > source mirror folder *only if it exists*, and use our internal HTTP
> > pre-mirror otherwise?
>
> You could do something like:
>
> def testislocal(d):
>     if os.path.exists("xxxx")
>         return "local"
>
>   return ""
>
> LOCALBUILD = "${@testislocal(d)}"
>
> SOURCE_MIRROR_URL ?= "{@base_contains('LOCALBUILD', 'local', 'file://xxx',
> 'http://xxx', d)}"
>
> I'm sure there are ways to neaten this up but you get the idea...
>
> Cheers,
>
> Richard
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/bitbake-devel/attachments/20160902/c50968a9/attachment-0002.html>


More information about the bitbake-devel mailing list