Follow-up Comment #1, bug #59243 (project make):

Given set -o pipefail isn't on by default even where supported, the OP
neglects the benefit of set -e in preventing the existing dependency file from
being truncated to empty if something goes wrong with the compiler step.  Even
the original example does not meet my standard for being production quality
because it doesn't take into account what happens if two builds run at the
same time or the user hits Ctrl-C after the truncation but before the sed. 
Scrambled, and particularly truncated, dependency files stop later rebuilds
from being triggered when they should be, leading to hours of frustrating
debugging, lost trust in the build system and a culture of wasting time with
"make clean" and rebuilds.  Atomic replacement with mv FTW.

Finding the example in context, at, I
see there is already prose discussing the set -e, explaining the cryptic sed,
and suggesting the -MM change that the OP slipped in.  I too might have
plunged in and spent minutes trying to understand it, only to kick myself when
I spotted the explanation later.  With its two code snippets, the explanation
is too large to have before the example.  I don't see a case to answer here.


Reply to this item at:


  Message sent via Savannah

Reply via email to