# HG changeset patch # User Nika Layzell # Date 1521090513 14400 # Thu Mar 15 01:08:33 2018 -0400 # Node ID bb10a801252acf83c581f860242636a241ad0a62 # Parent c217f857942fe082fd3738d645b082ad1af5d7ba Bug 1445668 - Don't hide includes when -showIncludes is explicitly passed to cl.exe, r=gps diff --git a/python/mozbuild/mozbuild/action/cl.py b/python/mozbuild/mozbuild/action/cl.py --- a/python/mozbuild/mozbuild/action/cl.py +++ b/python/mozbuild/mozbuild/action/cl.py @@ -60,16 +60,17 @@ def InvokeClWithDependencyGeneration(cmd # Assume the source file is the last argument source = cmdline[-1] assert not source.startswith('-') # The deps target lives here depstarget = os.path.basename(target) + ".pp" + showincludes = '-showIncludes' in cmdline cmdline += ['-showIncludes'] mk = Makefile() rule = mk.create_rule([target]) rule.add_dependencies([normcase(source)]) def on_line(line): # cl -showIncludes prefixes every header with "Note: including file:" @@ -77,21 +78,23 @@ def InvokeClWithDependencyGeneration(cmd if line.startswith(CL_INCLUDES_PREFIX): dep = line[len(CL_INCLUDES_PREFIX):].strip() # We can't handle pathes with spaces properly in mddepend.pl, but # we can assume that anything in a path with spaces is a system # header and throw it away. dep = normcase(dep) if ' ' not in dep: rule.add_dependencies([dep]) - else: - # Make sure we preserve the relevant output from cl. mozprocess - # swallows the newline delimiter, so we need to re-add it. - sys.stdout.write(line) - sys.stdout.write('\n') + # Hide the line by returning early + if not showincludes: + return + # Make sure we preserve the relevant output from cl. mozprocess + # swallows the newline delimiter, so we need to re-add it. + sys.stdout.write(line) + sys.stdout.write('\n') # We need to ignore children because MSVC can fire up a background process # during compilation. This process is cleaned up on its own. If we kill it, # we can run into weird compilation issues. p = ProcessHandlerMixin(cmdline, processOutputLine=[on_line], ignore_children=True) p.run() p.processOutput()