Windows heuristics may decide to want to run some tested processes
as elevated (since it may think some of them are installers - executables
with "dispatch" in the name may hit a heuristic looking for "patch").
Set this environment variable to disable this heuristic and just run
the executable with whatever privileges the caller has.
This fixes a couple tests on such versions of Windows where this
heuristic is active.
Differential Revision: https://reviews.llvm.org/D137772
if config.operating_system in ['Linux']:
config.available_features.add('hidden-helper')
+# Avoid Windows heuristics which try to detect potential installer programs
+# (which may need to run with elevated privileges) and ask if the user wants
+# to run them in that way. This heuristic may match for executables containing
+# the word "patch" which is a substring of "dispatch". Set an environment
+# variable indicating that we want to execute them with the current user.
+if config.operating_system == 'Windows':
+ config.environment['__COMPAT_LAYER'] = 'RunAsInvoker'
+
import multiprocessing
try:
if multiprocessing.cpu_count() > 1: