Permalink
Browse files

SERVER-38446 idlc.py fails to report errors correct during dependency…

… analysis
  • Loading branch information...
markbenvenuto committed Dec 18, 2018
1 parent cb3781c commit 9af799a2ea8419e5836cf7c10e45872b5b79bf0e
Showing with 12 additions and 7 deletions.
  1. +5 −5 buildscripts/idl/idl/compiler.py
  2. +2 −1 buildscripts/idl/idl/errors.py
  3. +5 −1 site_scons/site_tools/idl_tool.py
@@ -201,12 +201,12 @@ def compile_idl(args):
parsed_doc = parser.parse(file_stream, args.input_file,
CompilerImportResolver(args.import_directories))

# Stop compiling if we only need to scan import dependencies
if args.write_dependencies:
_write_dependencies(parsed_doc.spec)
return True

if not parsed_doc.errors:
# Stop compiling if we only need to scan import dependencies
if args.write_dependencies:
_write_dependencies(parsed_doc.spec)
return True

_update_import_includes(args, parsed_doc.spec, header_file_name)

bound_doc = binder.bind(parsed_doc.spec)
@@ -183,9 +183,10 @@ def to_list(self):
def dump_errors(self):
# type: () -> None
"""Print the list of errors."""
', '.join(self.to_list())
print("Errors found while compiling IDL")
for error_msg in self.to_list():
print("%s\n\n" % error_msg)
print("Found %s errors" % (len(self.to_list())))

def count(self):
# type: () -> int
@@ -43,7 +43,11 @@ def idlc_emitter(target, source, env):
def idl_scanner(node, env, path):
# Use the import scanner mode of the IDL compiler to file imported files
cmd = [sys.executable, "buildscripts/idl/idlc.py", '--include','src', str(node), '--write-dependencies']
deps_str = subprocess.check_output(cmd)
try:
deps_str = subprocess.check_output(cmd)
except subprocess.CalledProcessError as e:
print("IDLC ERROR: %s" % (e.output) )
raise

deps_list = deps_str.splitlines()

0 comments on commit 9af799a

Please sign in to comment.