All of lore.kernel.org
 help / color / mirror / Atom feed
* Error managing features
@ 2011-10-21 11:50 Gary Thomas
  2011-10-21 12:02 ` Gary Thomas
  0 siblings, 1 reply; 3+ messages in thread
From: Gary Thomas @ 2011-10-21 11:50 UTC (permalink / raw)
  To: Poky Project

In my $DISTRO, I have a default set of image features:
   IMAGE_FEATURES ?= "package-management debug-tweaks "

I'd like to build a minimized image which leaves out the package stuff, so
I added this line to my <image>.bb:
   IMAGE_FEATURES := "${@oe_filter_out('package-management', '${IMAGE_FEATURES}', d)}"

Sadly, this gives me this error:
   ERROR: Failure expanding variable IMAGE_FEATURES[:=], expression was ${@oe_filter_out('package-management', 'package-management debug-tweaks  ${EXTRA_IMAGE_FEATURES}', d)} which 
triggered exception SyntaxError: EOL while scanning string literal (IMAGE_FEATURES[:=], line 1)

Any idea what I've done wrong?

Thanks

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Error managing features
  2011-10-21 11:50 Error managing features Gary Thomas
@ 2011-10-21 12:02 ` Gary Thomas
  2011-10-21 14:14   ` Chris Larson
  0 siblings, 1 reply; 3+ messages in thread
From: Gary Thomas @ 2011-10-21 12:02 UTC (permalink / raw)
  To: Poky Project

On 2011-10-21 05:50, Gary Thomas wrote:
> In my $DISTRO, I have a default set of image features:
> IMAGE_FEATURES ?= "package-management debug-tweaks "
>
> I'd like to build a minimized image which leaves out the package stuff, so
> I added this line to my <image>.bb:
> IMAGE_FEATURES := "${@oe_filter_out('package-management', '${IMAGE_FEATURES}', d)}"
>
> Sadly, this gives me this error:
> ERROR: Failure expanding variable IMAGE_FEATURES[:=], expression was ${@oe_filter_out('package-management', 'package-management debug-tweaks ${EXTRA_IMAGE_FEATURES}', d)} which
> triggered exception SyntaxError: EOL while scanning string literal (IMAGE_FEATURES[:=], line 1)
>
> Any idea what I've done wrong?

Note: I noticed that EXTRA_IMAGE_FEATURES is only set in a few Yocto
images (no default/fallback), so I added
   EXTRA_IMAGE_FEATURES ?= ""
to $DISTRO.conf and the syntax error went away.

I guess there must be some difference inside bitbake that manages
to ignore unset variables when expanding, but not in this case?

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Error managing features
  2011-10-21 12:02 ` Gary Thomas
@ 2011-10-21 14:14   ` Chris Larson
  0 siblings, 0 replies; 3+ messages in thread
From: Chris Larson @ 2011-10-21 14:14 UTC (permalink / raw)
  To: Gary Thomas; +Cc: Poky Project

On Fri, Oct 21, 2011 at 5:02 AM, Gary Thomas <gary@mlbassoc.com> wrote:
> On 2011-10-21 05:50, Gary Thomas wrote:
>>
>> In my $DISTRO, I have a default set of image features:
>> IMAGE_FEATURES ?= "package-management debug-tweaks "
>>
>> I'd like to build a minimized image which leaves out the package stuff, so
>> I added this line to my <image>.bb:
>> IMAGE_FEATURES := "${@oe_filter_out('package-management',
>> '${IMAGE_FEATURES}', d)}"
>>
>> Sadly, this gives me this error:
>> ERROR: Failure expanding variable IMAGE_FEATURES[:=], expression was
>> ${@oe_filter_out('package-management', 'package-management debug-tweaks
>> ${EXTRA_IMAGE_FEATURES}', d)} which
>> triggered exception SyntaxError: EOL while scanning string literal
>> (IMAGE_FEATURES[:=], line 1)
>>
>> Any idea what I've done wrong?
>
> Note: I noticed that EXTRA_IMAGE_FEATURES is only set in a few Yocto
> images (no default/fallback), so I added
>  EXTRA_IMAGE_FEATURES ?= ""
> to $DISTRO.conf and the syntax error went away.
>
> I guess there must be some difference inside bitbake that manages
> to ignore unset variables when expanding, but not in this case?

I really think the current behavior of leaving unset variables in
their unexpanded form so that the shell may expand them needs to die.
Better to just make it raise an exception, I think. It would help
catch bugs, and worst case you define some default values.. heh. In
this case, you could also have worked around it by using d.getVar()
rather than '${}' in the python snippet.
-- 
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-10-21 14:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-21 11:50 Error managing features Gary Thomas
2011-10-21 12:02 ` Gary Thomas
2011-10-21 14:14   ` Chris Larson

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.