Returns with proper exit code if the build fails.