mirror of
https://github.com/cea-sec/miasm
synced 2026-08-17 10:26:03 -04:00
Update setup & tests
This commit is contained in:
parent
0164999126
commit
d9fb6d58c7
8 changed files with 25 additions and 36 deletions
|
|
@ -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"
|
||||
- PYTHON: "C:\\Python312-x64"
|
||||
PYTHON_VERSION: "3.12.x"
|
||||
PYTHON_ARCH: "64"
|
||||
|
||||
- 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'))
|
||||
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*
|
||||
|
||||
|
|
|
|||
6
.github/workflows/tests.yml
vendored
6
.github/workflows/tests.yml
vendored
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
pycparser
|
||||
z3-solver==4.8.7.0
|
||||
llvmlite==0.38.0
|
||||
llvmlite==0.44.0
|
||||
parameterized~=0.8.1
|
||||
|
|
|
|||
|
|
@ -1,2 +1,3 @@
|
|||
setuptools
|
||||
pyparsing>=2.4.1
|
||||
future
|
||||
|
|
|
|||
15
setup.py
15
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 = {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue