From: "Khem Raj" <raj.khem@gmail.com>
To: Joel A Cohen <aaron@assonance.org>, yocto@yoctoproject.org
Subject: Re: [yocto] Skipping network-required recipes automatically?
Date: Thu, 19 Dec 2019 09:15:37 -0800 [thread overview]
Message-ID: <46b9ca2c8ca78ea6c6ee6bf0af306edc0baee73e.camel@gmail.com> (raw)
In-Reply-To: <CAFSZm+giT64Fn93BWQc24NaPp6cr-tTo9z+hpqRzy=2p5GgPxg@mail.gmail.com>
On Thu, 2019-12-19 at 10:03 -0500, Joel A Cohen wrote:
> Hi all,
>
> My layer has a bunch of "development" recipes that contain something
> like:
>
> PV = "1.1.2+git${SRCPV}"
> SRCREV = "${AUTOREV}"
> DEFAULT_PREFERENCE = "-1"
>
>
> In these cases, my recipes have a "known good" version that has a
> specific known-good version number (recipe_1.1.2.bb), and then the
> "recipe_git.bb" file that I only enable using PREFERRED_VERSION when
> I'm wanting to use the latest source code.
>
> My problem with this is that it seems to defeat BB_NO_NETWORK, and
> I'm not sure how to handle it. I would like my layer to work
> correctly with no network, but the mere presence of these development
> recipes causes my build to fail during parsing if the network is not
> available.
>
> My last failed attempt was to create a "skip-git" class that I
> inherit in local.conf with the following:
>
> python () {
> no_network = d.getVar('BB_NO_NETWORK')
> pn = d.getVar('PN')
> pv = d.getVar('PV')
>
> if no_network and 'git' in pv:
> raise bb.parse.SkipRecipe("Recipe requires git, but no
> network: %s-%s" % (pn, pv))
> }
>
>
> Unfortunately, bitbake seems to fail in data_smart.py before my class
> actually has a chance to skip the recipe even in this case.
>
> Is there a better way to handle this?
>
you might add PREFERRED_VERSION to select the given recipe, in that
case recipe in your layer should have different version than the
original one. Then you can do something like
python () {
if d.getVar("PREFERRED_VERSION_<pn>") != d.getVar("PV"):
d.delVar("BB_DONT_CACHE")
raise bb.parse.SkipRecipe("Skip it")
}
not too sure if it will ignore it.
another option is to look at devupstream.bbclass it might have some
ideas for you.
> Thanks,
> Aaron
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> You automatically follow any topics you start or reply to.
>
> View/Reply Online (#47773):
> https://lists.yoctoproject.org/g/yocto/message/47773
> Mute This Topic: https://lists.yoctoproject.org/mt/68832469/1997914
> Group Owner: yocto+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [raj.khem@
> gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
prev parent reply other threads:[~2019-12-19 17:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-19 15:03 Skipping network-required recipes automatically? Joel A Cohen
2019-12-19 17:15 ` Khem Raj [this message]
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=46b9ca2c8ca78ea6c6ee6bf0af306edc0baee73e.camel@gmail.com \
--to=raj.khem@gmail.com \
--cc=aaron@assonance.org \
--cc=yocto@yoctoproject.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox