about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorserpilliere <serpilliere@users.noreply.github.com>2025-01-26 15:51:44 +0100
committerGitHub <noreply@github.com>2025-01-26 15:51:44 +0100
commit2a15c60712b326b541d42ac48f372f97023547e7 (patch)
treeeb779621340166a7d37980d5548b169168962ab2
parent0164999126ce49b8033eea283467c5d719a25640 (diff)
parentd9fb6d58c71b388709058fe28b72205fd5ea0061 (diff)
downloadfocaccia-miasm-develop.tar.gz
focaccia-miasm-develop.zip
Merge pull request #1506 from serpilliere/updt_llvm_ci develop
Fix distutils
Diffstat (limited to '')
-rw-r--r--.appveyor.yml31
-rw-r--r--.github/workflows/tests.yml6
-rw-r--r--miasm/jitter/jitcore_cc_base.py3
-rw-r--r--miasm/jitter/jitcore_gcc.py3
-rw-r--r--optional_requirements.txt2
-rw-r--r--requirements.txt1
-rw-r--r--setup.py15
-rwxr-xr-xtest/test_all.py2
8 files changed, 26 insertions, 37 deletions
diff --git a/.appveyor.yml b/.appveyor.yml
index 2d673193..22d25875 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -1,4 +1,4 @@
-version: 1.{build}
+image: Visual Studio 2022
 
 configuration:
   - Release
@@ -7,38 +7,29 @@ clone_folder: c:\projects\miasm
 
 environment:
   matrix:
-    - platform: Win32
-      APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
-      PLATFORM_TOOLSET: v141
-      PYTHON: c:\Python38
-      PYTHON_VERSION: "3.8.x"
-
-    - platform: x64
-      APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
-      PLATFORM_TOOLSET: v141
-      PYTHON: c:\Python38-x64
-      PYTHON_VERSION: "3.8.x"
-      # on_finish:
-      #  - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
+    - PYTHON: "C:\\Python312-x64"
+      PYTHON_VERSION: "3.12.x"
+      PYTHON_ARCH: "64"
+
+init:
+  - "ECHO %PYTHON% %PYTHON_VERSION% %PYTHON_ARCH%"
+  - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
 
 install:
   - cmd: cd c:\projects\miasm
-  - cmd: "%PYTHON%\\python.exe -m pip install -r requirements.txt"
-  - cmd: "%PYTHON%\\python.exe -m pip install -r optional_requirements.txt"
+  - cmd: "python.exe -m pip install -r requirements.txt"
+  - cmd: "python.exe -m pip install -r optional_requirements.txt"
 
 build_script:
-  - cmd: if "%platform%"=="Win32" call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86
-  - cmd: if "%platform%"=="x64" call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64
   - "%PYTHON%\\python.exe setup.py build"
   - "%PYTHON%\\python.exe setup.py install"
 
 test_script:
   - cmd: cd c:\projects\miasm\test
-  - "%PYTHON%\\python.exe -W error test_all.py"
+  - "%PYTHON%\\python.exe -W error test_all.py -t gcc"
 
 after_test:
   - cmd: chdir
-  - cmd: set plat
   - cmd: if "%platform%"=="Win32" 7z a -t7z ..\miasm.x86.release.7z c:\projects\miasm\build\*lib*
   - cmd: if "%platform%"=="X64" 7z a -t7z ..\miasm.x64.release.7z c:\projects\miasm\build\*lib*
 
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 3d609cdb..9a6cb9b7 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -7,7 +7,7 @@ jobs:
     runs-on: ubuntu-latest
     strategy:
       matrix:
-        python-version: ['3.8', '3.10']
+        python-version: ['3.10', '3.13']
 
     steps:
 
@@ -25,8 +25,8 @@ jobs:
     - name: Install requirements
       run: pip install -r requirements.txt
 
-    - name: Install llvm 11 (llvmlite compatible)
-      run: sudo apt-get install llvm-11
+    - name: Install llvm 15 (llvmlite compatible)
+      run: sudo apt-get install llvm-15
 
     - name: Install optional requirements
       run: pip install -r optional_requirements.txt
diff --git a/miasm/jitter/jitcore_cc_base.py b/miasm/jitter/jitcore_cc_base.py
index a6c7607a..c5819d1f 100644
--- a/miasm/jitter/jitcore_cc_base.py
+++ b/miasm/jitter/jitcore_cc_base.py
@@ -5,7 +5,6 @@ import os
 import tempfile
 import platform
 import sysconfig
-from distutils.sysconfig import get_python_inc
 
 from miasm.jitter.jitcore import JitCore
 from miasm.core.utils import keydefaultdict
@@ -95,7 +94,7 @@ class JitCore_Cc_Base(JitCore):
 
         include_files = [
             os.path.dirname(__file__),
-            get_python_inc()
+            sysconfig.get_paths()['include'],
         ]
         self.include_files = include_files
         self.libs = libs
diff --git a/miasm/jitter/jitcore_gcc.py b/miasm/jitter/jitcore_gcc.py
index 365e00f7..958c9d13 100644
--- a/miasm/jitter/jitcore_gcc.py
+++ b/miasm/jitter/jitcore_gcc.py
@@ -8,7 +8,6 @@ import _ctypes
 import platform
 import sysconfig
 from subprocess import check_call
-from distutils.sysconfig import get_python_inc
 from miasm.jitter import Jitgcc
 from miasm.jitter.jitcore_cc_base import JitCore_Cc_Base, gen_core
 
@@ -68,7 +67,7 @@ class JitCore_Gcc(JitCore_Cc_Base):
             if is_win:
                 libs.append(
                     os.path.join(
-                        get_python_inc(),
+                        sysconfig.get_paths()['include'],
                         "..",
                         "libs",
                         "python%d%d.lib" % (sys.version_info.major, sys.version_info.minor)
diff --git a/optional_requirements.txt b/optional_requirements.txt
index 95081855..35cdab38 100644
--- a/optional_requirements.txt
+++ b/optional_requirements.txt
@@ -1,4 +1,4 @@
 pycparser
 z3-solver==4.8.7.0
-llvmlite==0.38.0
+llvmlite==0.44.0
 parameterized~=0.8.1
diff --git a/requirements.txt b/requirements.txt
index b518400d..028b73e4 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,2 +1,3 @@
+setuptools
 pyparsing>=2.4.1
 future
diff --git a/setup.py b/setup.py
index abecb1a1..3cc7b5a5 100644
--- a/setup.py
+++ b/setup.py
@@ -7,14 +7,13 @@ from distutils.util import get_platform
 from distutils.sysconfig import get_python_lib, get_config_vars
 from distutils.dist import DistributionMetadata
 from distutils.command.install_data import install_data
-from distutils.spawn import find_executable
 import subprocess
 from tempfile import TemporaryFile
 import fnmatch
 import io
 import os
 import platform
-from shutil import copy2, copyfile, rmtree
+from shutil import copy2, copyfile, rmtree, which
 import sys
 import tempfile
 import atexit
@@ -58,7 +57,7 @@ def win_find_clang_path():
             return winreg.QueryValueEx(rkey, None)[0]
     except FileNotFoundError:
         # Visual Studio ships with an optional Clang distribution, try to detect it
-        clang_cl = find_executable("clang-cl")
+        clang_cl = which("clang-cl")
         if clang_cl is None:
             return None
         return os.path.abspath(os.path.join(os.path.dirname(clang_cl), "..", ".."))
@@ -93,7 +92,7 @@ def win_use_clang():
 
     # If you run the installation from a Visual Studio command prompt link.exe will already exist
     # Fall back to LLVM's lld-link.exe which is compatible with link's command line
-    if find_executable("link") is None:
+    if True:#which("link") is None:
         # LLVM >= 14.0.0 started supporting the /LTCG flag
         # Earlier versions will error during the linking phase so bail out now
         if clang_version[0] < 14:
@@ -110,7 +109,7 @@ build_extensions = True
 build_warnings = []
 win_force_clang = False
 if is_win:
-    if is_64bit or find_executable("cl") is None:
+    if is_64bit or which("cl") is None:
         # We do not change to clang if under 32 bits, because even with Clang we
         # do not use uint128_t with the 32 bits ABI. Regardless we can try to
         # find it when building in 32-bit mode if cl.exe was not found in the PATH.
@@ -119,8 +118,8 @@ if is_win:
             build_warnings.append("Could not find a suitable Clang/LLVM installation. You can download LLVM from https://releases.llvm.org")
             build_warnings.append("Alternatively you can select the 'C++ Clang-cl build tools' in the Visual Studio Installer")
             build_extensions = False
-    cl = find_executable("cl")
-    link = find_executable("link")
+    cl = which("cl")
+    link = which("link")
     if cl is None or link is None:
         build_warnings.append("Could not find cl.exe and/or link.exe in the PATH, try building miasm from a Visual Studio command prompt")
         build_warnings.append("More information at: https://wiki.python.org/moin/WindowsCompilers")
@@ -314,7 +313,7 @@ def build_all():
         try:
             s = setup(
                 name = "miasm",
-                version = __import__("miasm").VERSION,
+                version = "0.1.5",
                 packages = packages,
                 data_files=[("", ["README.md"])],
                 package_data = {
diff --git a/test/test_all.py b/test/test_all.py
index 85ebb31f..ab2d898b 100755
--- a/test/test_all.py
+++ b/test/test_all.py
@@ -855,7 +855,7 @@ testset += ExampleJitter(["trace.py", Example.get_sample("md5_arm"), "-a",
 ## Toshiba MeP
 testset += RegressionTest(["launch.py"], base_dir="arch/mep/asm")
 testset += RegressionTest(["launch.py"], base_dir="arch/mep/ir")
-testset += RegressionTest(["launch.py"], base_dir="arch/mep/jit")
+testset += RegressionTest(["launch.py"], base_dir="arch/mep/jit", tags=[TAGS["gcc"]])
 
 
 # region Unittest compatibility