Check if the compiler components used to build the interpreter exist. Check for the existence of the compiler executables whose names are listed in 'cmd_names' or all the compiler executables when 'cmd_names' is empty and return the first missing executable or None when none is found
(cmd_names=[])
| 2100 | |
| 2101 | |
| 2102 | def missing_compiler_executable(cmd_names=[]): |
| 2103 | """Check if the compiler components used to build the interpreter exist. |
| 2104 | |
| 2105 | Check for the existence of the compiler executables whose names are listed |
| 2106 | in 'cmd_names' or all the compiler executables when 'cmd_names' is empty |
| 2107 | and return the first missing executable or None when none is found |
| 2108 | missing. |
| 2109 | |
| 2110 | """ |
| 2111 | from setuptools._distutils import ccompiler, sysconfig |
| 2112 | from setuptools import errors |
| 2113 | import shutil |
| 2114 | |
| 2115 | compiler = ccompiler.new_compiler() |
| 2116 | sysconfig.customize_compiler(compiler) |
| 2117 | if compiler.compiler_type == "msvc": |
| 2118 | # MSVC has no executables, so check whether initialization succeeds |
| 2119 | try: |
| 2120 | compiler.initialize() |
| 2121 | except errors.PlatformError: |
| 2122 | return "msvc" |
| 2123 | for name in compiler.executables: |
| 2124 | if cmd_names and name not in cmd_names: |
| 2125 | continue |
| 2126 | cmd = getattr(compiler, name) |
| 2127 | if cmd_names: |
| 2128 | assert cmd is not None, \ |
| 2129 | "the '%s' executable is not configured" % name |
| 2130 | elif not cmd: |
| 2131 | continue |
| 2132 | if shutil.which(cmd[0]) is None: |
| 2133 | return cmd[0] |
| 2134 | |
| 2135 | |
| 2136 | _old_android_emulator = None |
nothing calls this directly
no test coverage detected
searching dependent graphs…