makefiles writing to $@ should first write to $@.new - Mailing list pgsql-hackers

From Justin Pryzby
Subject makefiles writing to $@ should first write to $@.new
Date
Msg-id 20220124032305.GR23027@telsasoft.com
Whole thread Raw
Responses Re: makefiles writing to $@ should first write to $@.new
Re: makefiles writing to $@ should first write to $@.new
List pgsql-hackers
There are many Makefile rules like

foo: bar
    ./tool $< > $@

If the rule is interrupted (due to ^C or ENOSPC), foo can be 0 bytes or
partially written, but won't be rebuilt until someone runs distclean or debugs
it and removes the individual file, as I did for errcodes.h.

It'd be better if these did

./tool $< > $@.new
mv $@.new $@

-- 
Justin



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Skipping logical replication transactions on subscriber side
Next
From: Michael Paquier
Date:
Subject: Re: Catalog version access