Bug 952206 - Abort execution when a required make file fails to remake; r=bsmedberg

Previously, errors during make file making (either the main make file or
an included make file) were ignored. This behavior diverged from GNU
Make, which aborted execution if the make file was required and ignored
the failure if it was optional.

This patch changes pymake to abort if the make file is required, brining
its behavior inline with GNU make.

--HG--
extra : rebase_source : f9a3f4c54273930616f4a8e41dafc463f363c891
extra : amend_source : f02236c3127602357f8f82a66d021144b3cdf3a0
This commit is contained in:
Gregory Szorc 2013-12-19 11:18:23 -08:00
parent 9ae1485883
commit de5adc60bd
2 changed files with 19 additions and 2 deletions

View File

@ -1590,8 +1590,13 @@ class _RemakeContext(object):
def remakecb(self, error, didanything):
assert error in (True, False)
if error and self.required:
print "Error remaking makefiles (ignored)"
if error:
if self.required:
self.cb(remade=False, error=util.MakeError(
'Error remaking required makefiles'))
return
else:
print 'Error remaking makefiles (ignored)'
if len(self.toremake):
target, self.required = self.toremake.pop(0)

View File

@ -0,0 +1,12 @@
#T returncode: 2
# Required include targets that fail should abort execution.
include dummy.mk
all:
@echo TEST-FAIL
dummy.mk:
@echo "Evaluated dummy.mk"
exit 1