All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Eggleton <paul.eggleton@linux.intel.com>
To: Chris Larson <clarson@kergoth.com>
Cc: bitbake-devel@lists.openembedded.org
Subject: Re: [PATCH 2/3] lib/bb/command.py: ensure setVariable only sets values as strings
Date: Wed, 12 Sep 2012 13:29:32 +0100	[thread overview]
Message-ID: <1987076.DYWImTfRFL@helios> (raw)
In-Reply-To: <CABcZAN=_7d0ovDP6nHBTYCWbrs+QGF8bcinsNSrzQLSe3w14Aw@mail.gmail.com>

On Tuesday 11 September 2012 15:57:24 Chris Larson wrote:
> On Tue, Sep 11, 2012 at 9:52 AM, Paul Eggleton
> <paul.eggleton@linux.intel.com> wrote:
> > This is the interface Hob uses to set variable values in many instances,
> > and at the moment it is possible that some of the values it passes are
> > not strings. If a non-string value gets into the datastore it can
> > trigger exceptions during parsing when we attempt to expand the variable
> > and substitute in the non-string value.
> > 
> > This fixes using the meta-ti layer within Hob - it currently has a
> > reference to BB_NUMBER_THREADS within a shell function and since this
> > is a variable that Hob was setting from its configuration as an integer,
> > due to the above this was triggering an ExpansionError.
> 
> This is probably a good change, but I think that failing expansion due
> to a non-string value is a bad behavior in bitbake. I think it should
> call str() on it as appropriate, as that's the most idiomatic
> solution: Don't check if something is a string, don't require only
> strings, but call str() to get your string

Hmm, I suppose so; I do still worry about existing python code assuming the 
result of getVar() is either None or a string though. Richard tells me that we 
have some non-string values mostly internal to BitBake that are considered 
legal, so that obviously isn't always 100% true, but it's a fair assumption to 
have made for most situations.

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre



  reply	other threads:[~2012-09-12 12:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-11 16:51 [PATCH 0/3] More Hob fixes Paul Eggleton
2012-09-11 16:51 ` [PATCH 1/3] hob: don't reorder layers list Paul Eggleton
2012-09-11 16:52 ` [PATCH 2/3] lib/bb/command.py: ensure setVariable only sets values as strings Paul Eggleton
2012-09-11 22:57   ` Chris Larson
2012-09-12 12:29     ` Paul Eggleton [this message]
2012-09-12 14:55       ` Richard Purdie
2012-09-11 16:52 ` [PATCH 3/3] hob: sort base image drop-down list Paul Eggleton
2012-09-14  8:27 ` [PATCH 0/3] More Hob fixes Richard Purdie

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=1987076.DYWImTfRFL@helios \
    --to=paul.eggleton@linux.intel.com \
    --cc=bitbake-devel@lists.openembedded.org \
    --cc=clarson@kergoth.com \
    /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.