help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Catching errors in pipes


From: Sébastien Hinderer
Subject: Re: Catching errors in pipes
Date: Wed, 20 Dec 2023 14:38:28 +0100

Dear Malcolm,

So sorry for the late response!

I just wanted to say thank you for your repsone!

In what we distribute, at themoment we do not require bash for running
our GNU make commands.

That being said, I find all your suggestions very valuable and I think
even if we don't use them in our distribution, we can use them locally
and that will definitely help us debugging things.

Best wishes,

Seb.

Cook, Malcolm (2023/12/05 18:54 +0000):
> > Is there a recommended way to catch errors in pipelines of coommands that
> > are used in recipes, please?
>
> I use the following with good success:
>
> SHELL=/usr/bin/bash
> .SHELLFLAGS = -eu -o pipefail -c
>
> FWIW: I usually use the above in combination with:
>
> .ONESHELL:
> MAKEFLAGS += --no-builtin-rules
> MAKEFLAGS += --no-builtin-variables
> MAKEFLAGS += --output-sync
> MAKEFLAGS += --warn-undefined-variables
> .DELETE_ON_ERROR:
> .SUFFIXES:
> .SECONDEXPANSION:
>
> > If so, how backward-compatible are they?
>
> To my knowledge this has always had the same results.
>
> > I saw the .SHELLFLAGS variable but also found a bug report saying that its
> > content is passed to the shell as one single argument. Is it thus mandatory 
> > to
> > prefix every pipeline with set -o pipefail; or is there a more global way 
> > to get
> > the desired behaviour?
>
> If you reference this report you might get a reply that considers it.
>
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]