bug-make
[Top][All Lists]
Advanced

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

[bug #59243] Overcomplicated example of automatic dependency configurati


From: Martin Dorey
Subject: [bug #59243] Overcomplicated example of automatic dependency configuration
Date: Fri, 9 Oct 2020 17:55:35 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36

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
https://www.gnu.org/software/make/manual/make.html#Automatic-Prerequisites, 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:

  <https://savannah.gnu.org/bugs/?59243>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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