Yocto Project Discussions
 help / color / mirror / Atom feed
From: "Denys Dmytriyenko" <denis@denix.org>
To: Joel A Cohen <aaron@assonance.org>
Cc: Yocto list discussion <yocto@yoctoproject.org>
Subject: Re: [yocto] Using "latest git" versions of recipes
Date: Tue, 25 Feb 2020 13:30:24 -0500	[thread overview]
Message-ID: <20200225183024.GA1578@denix.org> (raw)
In-Reply-To: <CAFSZm+g8iFD3XgDK9XbcQmzDJdH70=URXXqZdMPcEjT2wU286Q@mail.gmail.com>

On Tue, Feb 25, 2020 at 01:21:53PM -0500, Joel A Cohen wrote:
> Hi all,
> 
> What I've done for quite a while when creating recipes for code that is
> under heavy development is create 2 version of the recipe.
> 
> 1) recipe_1.0.0.bb (a known-stable recipe)
> 
> 2) recipe_git.bb (which contains something like:
> SRCREV="${AUTOREV}"
> SRCPV="1.0.1+git${SRCPV}"
> DEFAULT_PREFERENCE = "-1"
> 
> 
> The major problem I have with this, is that it defeats BB_NO_NETWORK, even
> if I'm not using the git version of the recipe (because bitbake wants to go
> check what the latest version is of the recipe during parsing).
> 
> I'm currently experimenting with a different approapch, which seems to have
> several advantages. I wanted to share it and get commentary.
> 
> 1) Add a new class, "use-git.bbclass":
> # This allows using the latest version of the source without requiring a
> separate
> # "recipe_git.bb". To use:
> # 1) Add: INHERIT += "use-git"
> # 2) Add: GIT_PNS = "recipe1 recipe2 etc"
> 
> GIT_PNS ?= ""
> GIT_PNS[type] = "list"
> 
> python () {
>     pn = d.getVar('PN')
>     git_pns = d.getVar('GIT_PNS', [])
> 
>     if pn in git_pns:
>         d.setVar('SRCREV', d.getVar('AUTOREV'))
>         srcpv = d.getVar('SRCPV')
>         d.appendVar('PV', '+git' + srcpv)
>         bb.note('Using latest git source code for %s, as recipe %s' % (pn,
> d.getVar('BP')))
> }
> 
> 
> 
> 2) In local.conf:
> INHERIT += "use-git"
> GIT_PNS = "recipe1 recipe2 etc"
> 
> 
> 
> This is nice, because I no longer have to create those recipe_git.bb
> recipes, and it's a central place to go configure a "use latest source
> code" setting.
> 
> Is this interesting to anyone else?
> 
> --Aaron

You know that you can poke SRCREV and other vars from a config file, 
such as local.conf?

SRCREV_pn-recipe1 = "${AUTOREV}"
SRCREV_pn-recipe2 = "${AUTOREV}"

-- 
Denys

  reply	other threads:[~2020-02-25 18:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-25 18:21 Using "latest git" versions of recipes Joel A Cohen
2020-02-25 18:30 ` Denys Dmytriyenko [this message]
2020-02-25 19:10   ` [yocto] " Joel A Cohen
2020-02-25 19:28     ` Martin Jansa
2020-02-25 19:32       ` Joel A Cohen
2020-02-25 20:39         ` Joshua Watt
2020-02-25 20:53           ` Denys Dmytriyenko

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=20200225183024.GA1578@denix.org \
    --to=denis@denix.org \
    --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