7
7
from distutils .sysconfig import get_python_lib , get_config_vars
8
8
from distutils .dist import DistributionMetadata
9
9
from distutils .command .install_data import install_data
10
- from distutils .spawn import find_executable
11
10
import subprocess
12
11
from tempfile import TemporaryFile
13
12
import fnmatch
14
13
import io
15
14
import os
16
15
import platform
17
- from shutil import copy2 , copyfile , rmtree
16
+ from shutil import copy2 , copyfile , rmtree , which
18
17
import sys
19
18
import tempfile
20
19
import atexit
@@ -58,7 +57,7 @@ def win_find_clang_path():
58
57
return winreg .QueryValueEx (rkey , None )[0 ]
59
58
except FileNotFoundError :
60
59
# Visual Studio ships with an optional Clang distribution, try to detect it
61
- clang_cl = find_executable ("clang-cl" )
60
+ clang_cl = which ("clang-cl" )
62
61
if clang_cl is None :
63
62
return None
64
63
return os .path .abspath (os .path .join (os .path .dirname (clang_cl ), ".." , ".." ))
@@ -93,7 +92,7 @@ def win_use_clang():
93
92
94
93
# If you run the installation from a Visual Studio command prompt link.exe will already exist
95
94
# Fall back to LLVM's lld-link.exe which is compatible with link's command line
96
- if find_executable ("link" ) is None :
95
+ if True : #which ("link") is None:
97
96
# LLVM >= 14.0.0 started supporting the /LTCG flag
98
97
# Earlier versions will error during the linking phase so bail out now
99
98
if clang_version [0 ] < 14 :
@@ -110,7 +109,7 @@ def win_use_clang():
110
109
build_warnings = []
111
110
win_force_clang = False
112
111
if is_win :
113
- if is_64bit or find_executable ("cl" ) is None :
112
+ if is_64bit or which ("cl" ) is None :
114
113
# We do not change to clang if under 32 bits, because even with Clang we
115
114
# do not use uint128_t with the 32 bits ABI. Regardless we can try to
116
115
# find it when building in 32-bit mode if cl.exe was not found in the PATH.
@@ -119,8 +118,8 @@ def win_use_clang():
119
118
build_warnings .append ("Could not find a suitable Clang/LLVM installation. You can download LLVM from https://releases.llvm.org" )
120
119
build_warnings .append ("Alternatively you can select the 'C++ Clang-cl build tools' in the Visual Studio Installer" )
121
120
build_extensions = False
122
- cl = find_executable ("cl" )
123
- link = find_executable ("link" )
121
+ cl = which ("cl" )
122
+ link = which ("link" )
124
123
if cl is None or link is None :
125
124
build_warnings .append ("Could not find cl.exe and/or link.exe in the PATH, try building miasm from a Visual Studio command prompt" )
126
125
build_warnings .append ("More information at: https://wiki.python.org/moin/WindowsCompilers" )
@@ -314,7 +313,7 @@ def build_all():
314
313
try :
315
314
s = setup (
316
315
name = "miasm" ,
317
- version = __import__ ( "miasm" ). VERSION ,
316
+ version = "0.1.5" ,
318
317
packages = packages ,
319
318
data_files = [("" , ["README.md" ])],
320
319
package_data = {
0 commit comments