* [PATCH 0/1] runqemu bugfix
@ 2012-09-14 23:15 Scott Garman
2012-09-14 23:15 ` [PATCH 1/1] runqemu: show bitbake errors to user Scott Garman
0 siblings, 1 reply; 5+ messages in thread
From: Scott Garman @ 2012-09-14 23:15 UTC (permalink / raw)
To: openembedded-core
Hello,
This is a fix for Yocto bug #3112, where there are certain edge cases
where the bitbake command is avalable to fails to run. Previously we
mistakenly treated that as the same case as if bitbake didn't exist in
the user's $PATH, and this fix causes us to show the user the output
of bitbake so they can view the error message.
Scott
The following changes since commit 7887b99646d8e1e736ad6e4a306e47df9955221e:
local.conf.sample: change valgrind support architecture comment (2012-09-14 17:05:59 +0100)
are available in the git repository at:
git://git.yoctoproject.org/poky-contrib sgarman/runqemu-bitbake-fix-oe
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=sgarman/runqemu-bitbake-fix-oe
Scott Garman (1):
runqemu: show bitbake errors to user
scripts/runqemu | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
--
1.7.9.5
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/1] runqemu: show bitbake errors to user
2012-09-14 23:15 [PATCH 0/1] runqemu bugfix Scott Garman
@ 2012-09-14 23:15 ` Scott Garman
2012-09-14 23:20 ` Mark Hatle
0 siblings, 1 reply; 5+ messages in thread
From: Scott Garman @ 2012-09-14 23:15 UTC (permalink / raw)
To: openembedded-core
In certain edge cases, bitbake may fail to run and cause setup_tmpdir()
within runqemu to fail, and not give the user a helpful error message.
Catch this case and show the user the output of bitbake -e.
This fixes [YOCTO #3112]
Signed-off-by: Scott Garman <scott.a.garman@intel.com>
---
scripts/runqemu | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/scripts/runqemu b/scripts/runqemu
index e843946..8bb77ff 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -283,8 +283,16 @@ setup_tmpdir() {
# We have bitbake in PATH, get OE_TMPDIR from bitbake
OE_TMPDIR=`MACHINE=$MACHINE bitbake -e | grep ^TMPDIR=\" | cut -d '=' -f2 | cut -d '"' -f2`
if [ -z "$OE_TMPDIR" ]; then
- echo "Error: this script needs to be run from your build directory,"
- echo "or you need to explicitly set OE_TMPDIR in your environment"
+ # Check for errors from bitbake that the user needs to know about
+ BITBAKE_OUTPUT=`bitbake -e`
+ if [ -z "$BITBAKE_OUTPUT" ]; then
+ echo "Error: this script needs to be run from your build directory,"
+ echo "or you need to explicitly set OE_TMPDIR in your environment"
+ else
+ echo "There was an error running bitbake to determine TMPDIR"
+ echo "Here is the output from 'bitbake -e':"
+ bitbake -e
+ fi
exit 1
fi
fi
--
1.7.9.5
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH 1/1] runqemu: show bitbake errors to user
2012-09-14 23:15 ` [PATCH 1/1] runqemu: show bitbake errors to user Scott Garman
@ 2012-09-14 23:20 ` Mark Hatle
2012-09-19 5:35 ` Scott Garman
0 siblings, 1 reply; 5+ messages in thread
From: Mark Hatle @ 2012-09-14 23:20 UTC (permalink / raw)
To: openembedded-core
On 9/14/12 6:15 PM, Scott Garman wrote:
> In certain edge cases, bitbake may fail to run and cause setup_tmpdir()
> within runqemu to fail, and not give the user a helpful error message.
> Catch this case and show the user the output of bitbake -e.
>
> This fixes [YOCTO #3112]
>
> Signed-off-by: Scott Garman <scott.a.garman@intel.com>
> ---
> scripts/runqemu | 12 ++++++++++--
> 1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/runqemu b/scripts/runqemu
> index e843946..8bb77ff 100755
> --- a/scripts/runqemu
> +++ b/scripts/runqemu
> @@ -283,8 +283,16 @@ setup_tmpdir() {
> # We have bitbake in PATH, get OE_TMPDIR from bitbake
> OE_TMPDIR=`MACHINE=$MACHINE bitbake -e | grep ^TMPDIR=\" | cut -d '=' -f2 | cut -d '"' -f2`
> if [ -z "$OE_TMPDIR" ]; then
> - echo "Error: this script needs to be run from your build directory,"
> - echo "or you need to explicitly set OE_TMPDIR in your environment"
> + # Check for errors from bitbake that the user needs to know about
> + BITBAKE_OUTPUT=`bitbake -e`
I'm not sure that is a good idea. If there is a failure (anything on stderr) it
will just be dumped to the screen...
If it does succeed, it could attempt to load that variable with many MB of data,
which also likely isn't what is desired.
It might be better to dump the items to a tmp file (securely created of course)
;) and then keep processing the same file for error messages, warnings, etc...
> + if [ -z "$BITBAKE_OUTPUT" ]; then
> + echo "Error: this script needs to be run from your build directory,"
> + echo "or you need to explicitly set OE_TMPDIR in your environment"
> + else
> + echo "There was an error running bitbake to determine TMPDIR"
> + echo "Here is the output from 'bitbake -e':"
> + bitbake -e
> + fi
> exit 1
> fi
> fi
>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH 1/1] runqemu: show bitbake errors to user
2012-09-14 23:20 ` Mark Hatle
@ 2012-09-19 5:35 ` Scott Garman
0 siblings, 0 replies; 5+ messages in thread
From: Scott Garman @ 2012-09-19 5:35 UTC (permalink / raw)
To: openembedded-core
On 09/14/2012 04:20 PM, Mark Hatle wrote:
> On 9/14/12 6:15 PM, Scott Garman wrote:
>> In certain edge cases, bitbake may fail to run and cause setup_tmpdir()
>> within runqemu to fail, and not give the user a helpful error message.
>> Catch this case and show the user the output of bitbake -e.
>>
>> This fixes [YOCTO #3112]
>>
>> Signed-off-by: Scott Garman <scott.a.garman@intel.com>
>> ---
>> scripts/runqemu | 12 ++++++++++--
>> 1 file changed, 10 insertions(+), 2 deletions(-)
>>
>> diff --git a/scripts/runqemu b/scripts/runqemu
>> index e843946..8bb77ff 100755
>> --- a/scripts/runqemu
>> +++ b/scripts/runqemu
>> @@ -283,8 +283,16 @@ setup_tmpdir() {
>> # We have bitbake in PATH, get OE_TMPDIR from bitbake
>> OE_TMPDIR=`MACHINE=$MACHINE bitbake -e | grep ^TMPDIR=\" |
>> cut -d '=' -f2 | cut -d '"' -f2`
>> if [ -z "$OE_TMPDIR" ]; then
>> - echo "Error: this script needs to be run from your build
>> directory,"
>> - echo "or you need to explicitly set OE_TMPDIR in your
>> environment"
>> + # Check for errors from bitbake that the user needs to
>> know about
>> + BITBAKE_OUTPUT=`bitbake -e`
>
> I'm not sure that is a good idea. If there is a failure (anything on
> stderr) it will just be dumped to the screen...
I'm afraid this is not the case with the error case I was testing this
against. That case being when there is an LCONF_VERSION mismatch in
bblayers.conf. Those user instructions are written to STDOUT.
> If it does succeed, it could attempt to load that variable with many MB
> of data, which also likely isn't what is desired.
This is a valid point. I could change it to bitbake -e | wc -l, and
check the number of lines of output. I'm basically just checking to see
that this is greater than 0.
> It might be better to dump the items to a tmp file (securely created of
> course) ;) and then keep processing the same file for error messages,
> warnings, etc...
This code path should only be run on very unusual edge cases, so I'm not
inclined to add additional tmpfile handling complexity and have to deal
with cleaning up the files, etc.
I will re-spin this patch with the wc -l modification.
Scott
--
Scott Garman
Embedded Linux Engineer - Yocto Project
Intel Open Source Technology Center
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 0/1] runqemu bugfix [v2]
@ 2012-09-19 5:50 Scott Garman
2012-09-19 5:50 ` [PATCH 1/1] runqemu: show bitbake errors to user Scott Garman
0 siblings, 1 reply; 5+ messages in thread
From: Scott Garman @ 2012-09-19 5:50 UTC (permalink / raw)
To: openembedded-core
Hello,
This is a fix for Yocto bug #3112, where there are certain edge cases
where the bitbake command is avalable to fails to run. Previously we
mistakenly treated that as the same case as if bitbake didn't exist in
the user's $PATH, and this fix causes us to show the user the output
of bitbake so they can view the error message.
v2 includes rework based on feedback from Mark Hatle (thanks!).
Scott
The following changes since commit 7887b99646d8e1e736ad6e4a306e47df9955221e:
local.conf.sample: change valgrind support architecture comment (2012-09-14 17:05:59 +0100)
are available in the git repository at:
git://git.yoctoproject.org/poky-contrib sgarman/runqemu-bitbake-fix-oe
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=sgarman/runqemu-bitbake-fix-oe
Scott Garman (1):
runqemu: show bitbake errors to user
scripts/runqemu | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
--
1.7.9.5
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/1] runqemu: show bitbake errors to user
2012-09-19 5:50 [PATCH 0/1] runqemu bugfix [v2] Scott Garman
@ 2012-09-19 5:50 ` Scott Garman
0 siblings, 0 replies; 5+ messages in thread
From: Scott Garman @ 2012-09-19 5:50 UTC (permalink / raw)
To: openembedded-core
In certain edge cases, bitbake may fail to run and cause setup_tmpdir()
within runqemu to fail, and not give the user a helpful error message.
Catch this case and show the user the output of bitbake -e.
This fixes [YOCTO #3112]
Signed-off-by: Scott Garman <scott.a.garman@intel.com>
---
scripts/runqemu | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/scripts/runqemu b/scripts/runqemu
index e843946..a9f513c 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -283,8 +283,16 @@ setup_tmpdir() {
# We have bitbake in PATH, get OE_TMPDIR from bitbake
OE_TMPDIR=`MACHINE=$MACHINE bitbake -e | grep ^TMPDIR=\" | cut -d '=' -f2 | cut -d '"' -f2`
if [ -z "$OE_TMPDIR" ]; then
- echo "Error: this script needs to be run from your build directory,"
- echo "or you need to explicitly set OE_TMPDIR in your environment"
+ # Check for errors from bitbake that the user needs to know about
+ BITBAKE_OUTPUT=`bitbake -e | wc -l`
+ if [ "$BITBAKE_OUTPUT" -eq "0" ]; then
+ echo "Error: this script needs to be run from your build directory,"
+ echo "or you need to explicitly set OE_TMPDIR in your environment"
+ else
+ echo "There was an error running bitbake to determine TMPDIR"
+ echo "Here is the output from 'bitbake -e':"
+ bitbake -e
+ fi
exit 1
fi
fi
--
1.7.9.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-09-19 6:03 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-14 23:15 [PATCH 0/1] runqemu bugfix Scott Garman
2012-09-14 23:15 ` [PATCH 1/1] runqemu: show bitbake errors to user Scott Garman
2012-09-14 23:20 ` Mark Hatle
2012-09-19 5:35 ` Scott Garman
-- strict thread matches above, loose matches on Subject: below --
2012-09-19 5:50 [PATCH 0/1] runqemu bugfix [v2] Scott Garman
2012-09-19 5:50 ` [PATCH 1/1] runqemu: show bitbake errors to user Scott Garman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox