diff mbox

[U-Boot,1/2] buildman: don't fail --list-toolchains when toolchains fail

Message ID 1381350490-25867-1-git-send-email-swarren@wwwdotorg.org
State Accepted
Delegated to: Simon Glass
Headers show

Commit Message

Stephen Warren Oct. 9, 2013, 8:28 p.m. UTC
From: Stephen Warren <swarren@nvidia.com>

When a toolchain invocation fails, an exception is thrown but not caught
which then aborts the entire toolchain detection process. To solve this,
request that exceptions not be thrown, since the toolchain init code
already error-checks the command result. This solves e.g.:

         - found '/usr/bin/winegcc'
Traceback (most recent call last):
...
Exception: Error running '/usr/bin/winegcc --version'

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
 tools/buildman/toolchain.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Simon Glass Oct. 9, 2013, 10:24 p.m. UTC | #1
On Wed, Oct 9, 2013 at 2:28 PM, Stephen Warren <swarren@wwwdotorg.org> wrote:
> From: Stephen Warren <swarren@nvidia.com>
>
> When a toolchain invocation fails, an exception is thrown but not caught
> which then aborts the entire toolchain detection process. To solve this,
> request that exceptions not be thrown, since the toolchain init code
> already error-checks the command result. This solves e.g.:
>
>          - found '/usr/bin/winegcc'
> Traceback (most recent call last):
> ...
> Exception: Error running '/usr/bin/winegcc --version'
>
> Signed-off-by: Stephen Warren <swarren@nvidia.com>

Acked-by: Simon Glass <sjg@chromium.org>
Stephen Warren Oct. 10, 2013, 3:48 p.m. UTC | #2
On 10/09/2013 04:24 PM, Simon Glass wrote:
> On Wed, Oct 9, 2013 at 2:28 PM, Stephen Warren <swarren@wwwdotorg.org> wrote:
>> From: Stephen Warren <swarren@nvidia.com>
>>
>> When a toolchain invocation fails, an exception is thrown but not caught
>> which then aborts the entire toolchain detection process. To solve this,
>> request that exceptions not be thrown, since the toolchain init code
>> already error-checks the command result. This solves e.g.:
>>
>>          - found '/usr/bin/winegcc'
>> Traceback (most recent call last):
>> ...
>> Exception: Error running '/usr/bin/winegcc --version'
>>
>> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> 
> Acked-by: Simon Glass <sjg@chromium.org>

Thanks. Oh. I didn't send this patch directly to any person other than
you, since I thought you collected patches and sent pull requests for
it. Should I resend it to Tom Rini?
Simon Glass Oct. 10, 2013, 3:50 p.m. UTC | #3
Hi Stephen,

On Thu, Oct 10, 2013 at 9:48 AM, Stephen Warren <swarren@wwwdotorg.org> wrote:
> On 10/09/2013 04:24 PM, Simon Glass wrote:
>> On Wed, Oct 9, 2013 at 2:28 PM, Stephen Warren <swarren@wwwdotorg.org> wrote:
>>> From: Stephen Warren <swarren@nvidia.com>
>>>
>>> When a toolchain invocation fails, an exception is thrown but not caught
>>> which then aborts the entire toolchain detection process. To solve this,
>>> request that exceptions not be thrown, since the toolchain init code
>>> already error-checks the command result. This solves e.g.:
>>>
>>>          - found '/usr/bin/winegcc'
>>> Traceback (most recent call last):
>>> ...
>>> Exception: Error running '/usr/bin/winegcc --version'
>>>
>>> Signed-off-by: Stephen Warren <swarren@nvidia.com>
>>
>> Acked-by: Simon Glass <sjg@chromium.org>
>
> Thanks. Oh. I didn't send this patch directly to any person other than
> you, since I thought you collected patches and sent pull requests for
> it. Should I resend it to Tom Rini?

Yes I tend to do that. Perhaps this should go into the release? Let me
know - I'll do a little pull request for Tom.

Regards,
Simon
Stephen Warren Oct. 10, 2013, 4:04 p.m. UTC | #4
On 10/10/2013 09:50 AM, Simon Glass wrote:
> Hi Stephen,
> 
> On Thu, Oct 10, 2013 at 9:48 AM, Stephen Warren <swarren@wwwdotorg.org> wrote:
>> On 10/09/2013 04:24 PM, Simon Glass wrote:
>>> On Wed, Oct 9, 2013 at 2:28 PM, Stephen Warren <swarren@wwwdotorg.org> wrote:
>>>> From: Stephen Warren <swarren@nvidia.com>
>>>>
>>>> When a toolchain invocation fails, an exception is thrown but not caught
>>>> which then aborts the entire toolchain detection process. To solve this,
>>>> request that exceptions not be thrown, since the toolchain init code
>>>> already error-checks the command result. This solves e.g.:
>>>>
>>>>          - found '/usr/bin/winegcc'
>>>> Traceback (most recent call last):
>>>> ...
>>>> Exception: Error running '/usr/bin/winegcc --version'
>>>>
>>>> Signed-off-by: Stephen Warren <swarren@nvidia.com>
>>>
>>> Acked-by: Simon Glass <sjg@chromium.org>
>>
>> Thanks. Oh. I didn't send this patch directly to any person other than
>> you, since I thought you collected patches and sent pull requests for
>> it. Should I resend it to Tom Rini?
> 
> Yes I tend to do that. Perhaps this should go into the release? Let me
> know - I'll do a little pull request for Tom.

At least patch 1 sounds like a good idea for the release since it's a
bug-fix, yes.
Simon Glass Oct. 10, 2013, 4:42 p.m. UTC | #5
Hi Stephen,

On Thu, Oct 10, 2013 at 10:04 AM, Stephen Warren <swarren@wwwdotorg.org> wrote:
> On 10/10/2013 09:50 AM, Simon Glass wrote:
>> Hi Stephen,
>>
>> On Thu, Oct 10, 2013 at 9:48 AM, Stephen Warren <swarren@wwwdotorg.org> wrote:
>>> On 10/09/2013 04:24 PM, Simon Glass wrote:
>>>> On Wed, Oct 9, 2013 at 2:28 PM, Stephen Warren <swarren@wwwdotorg.org> wrote:
>>>>> From: Stephen Warren <swarren@nvidia.com>
>>>>>
>>>>> When a toolchain invocation fails, an exception is thrown but not caught
>>>>> which then aborts the entire toolchain detection process. To solve this,
>>>>> request that exceptions not be thrown, since the toolchain init code
>>>>> already error-checks the command result. This solves e.g.:
>>>>>
>>>>>          - found '/usr/bin/winegcc'
>>>>> Traceback (most recent call last):
>>>>> ...
>>>>> Exception: Error running '/usr/bin/winegcc --version'
>>>>>
>>>>> Signed-off-by: Stephen Warren <swarren@nvidia.com>
>>>>
>>>> Acked-by: Simon Glass <sjg@chromium.org>
>>>
>>> Thanks. Oh. I didn't send this patch directly to any person other than
>>> you, since I thought you collected patches and sent pull requests for
>>> it. Should I resend it to Tom Rini?
>>
>> Yes I tend to do that. Perhaps this should go into the release? Let me
>> know - I'll do a little pull request for Tom.
>
> At least patch 1 sounds like a good idea for the release since it's a
> bug-fix, yes.

OK will do. I noticed it should be formatted to 80cols so will tweak that too.

Regards,
Simon
diff mbox

Patch

diff --git a/tools/buildman/toolchain.py b/tools/buildman/toolchain.py
index a292338..7effb88 100644
--- a/tools/buildman/toolchain.py
+++ b/tools/buildman/toolchain.py
@@ -39,7 +39,7 @@  class Toolchain:
         # As a basic sanity check, run the C compiler with --version
         cmd = [fname, '--version']
         if test:
-            result = command.RunPipe([cmd], capture=True, env=env)
+            result = command.RunPipe([cmd], capture=True, env=env, raise_on_error=False)
             self.ok = result.return_code == 0
             if verbose:
                 print 'Tool chain test: ',