[Scons-users] Ignoring (some) errors

Tom Tanner (BLOOMBERG/ LONDON) ttanner2 at bloomberg.net
Mon Apr 13 12:09:17 EDT 2015


It depends on how your build works, but if you're executing a shell command, you can always prefix it with '-' to make scons ignore errors. Make compatible and rather horrible (and I think it's documented somewhere), so

env.Command(targets, source, '-do_something_that_might_not_work <$SOURCE >$TARGET')

will eat the errors.

From: scons-users at scons.org At: Apr 11 2015 04:27:21
To: scons-users at scons.org
Subject: Re: [Scons-users] Ignoring (some) errors

Marc,

What platform is this on?
Could you try swapping the SHELL for the commands you don't care if they fail and make a shell script which ignores the errors and always returns 0?

-Bill

On Fri, Apr 10, 2015 at 8:34 PM, William Blevins <wblevins001 at gmail.com> wrote:

Marc,

My recommendation is to run SCons twice with different "targets" and options.  Their will be some overhead, but I don't see another (easy) way to do what you are asking.

Pass 1) Run scons (on build targets) like normal so that it fails like normal if anything fails to build.
Pass 2) Run scons (on assembling targets) with -k option.

V/R,
William

On Wed, Apr 8, 2015 at 5:32 PM, Marc Branchaud <marcnarc at xiplink.com> wrote:

On 15-04-08 04:30 PM, Dirk Bächle wrote:
> Hi Marc,
>
> On 08.04.2015 20:06, Marc Branchaud wrote:
>> Hi all,
>>
>> I have a project that builds many binaries, then assembles them in different
>> ways to create different products.  All of this is conveniently depended-on
>> by a single Alias target (e.g. "allproducts").
>>
>> I would like to execute this build in parallel (with --jobs).  However, I
>> would also like for the second step to be robust against a failure to
>> assemble a product.
>>
>> There is --keep-going, but if I read the man page correctly that would still
>> abort my single allproducts target if there's a failure ("The target that
>> failed and those that depend on it will not be remade, but other targets
>> specified on the command line will still be processed.")
>>
>
> there is also -i/--ignore-errors (see
> http://stackoverflow.com/questions/23825405/ignore-build-errors-and-build-as-far-as-possible-with-scons-i-or-with-scons-k
> , amongst others).
> Does that help?

(Heh -- missed -i when I skimmed through the man page...)

I guess --ignore-errors wouldn't abort the single allproducts target, but
it's still not what I want.

 - Any error in the first part, where the many binaries are being built,
should abort the whole build.  It's in the second part that I want to get as
many products assembled as possible, irrespective of any products failing.

 - I still want the build to report any product-assembly failures
(specifically, exit with a non-zero code), so that they get noticed and fixed.

 - The description of -i talks about "commands executed to rebuild files" but
I want this to work on clean builds.  (Perhaps I should mention that the main
user of this "allproducts" target is a build bot, not a human.)

                M.

_______________________________________________
Scons-users mailing list
Scons-users at scons.org
https://pairlist4.pair.net/mailman/listinfo/scons-users


_______________________________________________
Scons-users mailing list
Scons-users at scons.org
https://pairlist4.pair.net/mailman/listinfo/scons-users


_______________________________________________
Scons-users mailing list
Scons-users at scons.org
https://pairlist4.pair.net/mailman/listinfo/scons-users


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20150413/4e7063ff/attachment.html>


More information about the Scons-users mailing list