[build] Improve build error handling #1223
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context: #1211 (comment)
Context: #1211 (comment)
What should happen when a portion of a build fails?
That's not entirely rhetorical: the entire build should fail.
What does happen when a portion of a build fails?
Unfortunately that's also not rhetorical: the build continues!
(Say what?!)
Case in point: PR #1211 build 2373, which experienced a
failure in the mono build:
But the error was ignored, and the build continued, resulting in the
"final" errors (among others)
This is madness. The first error should have stopped the
build. The build wasn't stopped, meaning that it continued -- with
an "unstable" tree state -- resulting in "bizarre" build errors
later. In particular,
Xamarin.Android.NUniteLite.dll
wasn't builtin the Debug configuration because the mono build failed for the
Debug configuration, but everything "worked" in Release.
The fundamental cause of this madness? Makefile rules such as
make leeroy-all
, which effectively are:Because of the
;
separating the commands, any errors from thefirst command are ignored, resulting in the tearing out of my hair
when everything goes "weird".
Review the Makefile targets in
Makefile
andbuild-tools/scripts/BuildEverything.mk
and replace;
with|| exit 1
when the command should have fatal errors. This shouldcause the build to fail the first time an error is encountered,
instead of continuing on its merry way to die horribly later.