epel 6 fedpkg build or koji scratch builds failing — I'm stumped

Jim Meyering jim at meyering.net
Thu Nov 24 17:41:14 UTC 2011


Richard W.M. Jones wrote:
> On Thu, Nov 24, 2011 at 03:01:03PM +0000, Paul Howarth wrote:
>> http://marc.info/?l=pptpclient-devel&m=132102054518031
>
> This is indeed rather unexpected behaviour of make!

Actually it should not be unexpected.
Whenever you update a target non-atomically that can happen.

The moment the first non-atomic write affects the target,
any parallel make job that is then inspecting that file's "mtime"
(date of last modification) will think that it is "up to date"
and consider it ready to be used.  That is why the recommended
approach is to write only to a temporary (as you did below)
and only update atomically via mv's rename.

> BTW I think your patch is incomplete, since it will create an
> incomplete config.h if the disk runs out of space.  I think this would
> be better, and should also avoid the parallel make problem:
>
> config.h:
> 	echo "/* text added by Makefile target config.h */" > $@-t
> 	echo "#define PPTP_LINUX_VERSION \"$(VERSION)$(RELEASE)\"" >> $@-t
> 	echo "#define PPPD_BINARY \"$(PPPD)\"" >> $@-t
> 	echo "#define IP_BINARY \"$(IP)\"" >> $@-t
> 	mv $@-t $@


More information about the devel mailing list