diff --git a/.appveyor.yml b/.appveyor.yml index f4bcc33305..336703f215 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -35,7 +35,7 @@ environment: TEST_INCLUDE_HEADERS_CPP: false # Clang-cl 64 (Dynamic linking) - builder: clang_cl_64_dyn - PYTHON: 'C:\\Python314' + PYTHON: 'C:\\Python314-x64' INNO_SETUP: 'C:\\Program Files (x86)\\Inno Setup 6' APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2026 RUN_TESTS: true @@ -98,13 +98,14 @@ for: # Windows Python ships no python3.exe, so `python3` spawned by the tests would # resolve to another interpreter on PATH that has no rzpipe installed - copy /y "%PYTHON%\python.exe" "%PYTHON%\python3.exe" + - copy /y "%PYTHON%\pythonw.exe" "%PYTHON%\pythonw3.exe" - set PATH=%APPVEYOR_BUILD_FOLDER%\%DIST_FOLDER%\bin;%PYTHON%;C:\msys64\mingw64\bin;%PATH% - echo %PATH% - where rizin - where python3 - rizin -v - '%PYTHON%\\python -m pip install "git+https://github.com/rizinorg/rz-pipe#egg=rzpipe&subdirectory=python"' - - "%PYTHON%\\python -m pip install requests" + - "%PYTHON%\\python -m pip install psutil requests" - cd test - git clone -q --depth 1 -c core.symlinks=true https://github.com/rizinorg/rizin-testbins bins - cd .. diff --git a/.gitattributes b/.gitattributes index 704e12ef3d..2e07943159 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,4 @@ +test/www/simple.html text eol=lf subprojects/rizin-shell-parser/src/grammar.json linguist-generated=true subprojects/rizin-shell-parser/src/node-types.json linguist-generated=true subprojects/rizin-shell-parser/src/parser.c linguist-generated=true diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 70f1e5a18b..abc61191b4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -373,10 +373,10 @@ jobs: sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* - name: Install tools - run: yum install -y patch unzip git gcc make python3-pip + run: yum install -y patch unzip git gcc make python3-pip python3-devel # Pin Meson to the last version stil supporting Python 3.6 - name: Install meson and ninja - run: pip3 install meson==0.61.5 ninja PyYAML requests + run: pip3 install meson==0.61.5 ninja PyYAML psutil==6.1.1 requests - name: Checkout rizin run: | git clone https://github.com/${{ github.repository }} @@ -481,7 +481,7 @@ jobs: env: PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig - name: Install test dependencies - run: python3 -m pip install --user 'git+https://github.com/rizinorg/rz-pipe#egg=rzpipe&subdirectory=python' requests + run: python3 -m pip install --user 'git+https://github.com/rizinorg/rz-pipe#egg=rzpipe&subdirectory=python' psutil requests - name: Run tests # Debug tests fail on old Debian because of the runtime differences, ignore them run: | @@ -499,7 +499,7 @@ jobs: options: --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --security-opt apparmor=unconfined steps: - name: Install dependencies - run: apk add --no-cache git gcc g++ linux-headers cmake curl wget unzip py3-wheel py3-setuptools py3-pip meson ninja xz py3-requests + run: apk add --no-cache git gcc g++ linux-headers cmake curl wget unzip py3-wheel py3-setuptools py3-pip meson ninja xz py3-psutil py3-requests - name: Checkout rizin run: | git clone https://github.com/${{ github.repository }} diff --git a/.github/workflows/leaks.yml b/.github/workflows/leaks.yml index dda7655e87..6a94f8d106 100644 --- a/.github/workflows/leaks.yml +++ b/.github/workflows/leaks.yml @@ -68,7 +68,7 @@ jobs: path: test/rz-pipe - name: Install test dependencies - run: pip3 install --user "file://$GITHUB_WORKSPACE/test/rz-pipe#egg=rzpipe&subdirectory=python" requests + run: pip3 install --user "file://$GITHUB_WORKSPACE/test/rz-pipe#egg=rzpipe&subdirectory=python" psutil requests env: PIP_BREAK_SYSTEM_PACKAGES: 1 diff --git a/test/db/archos/not-windows-any/http b/test/db/io/http similarity index 100% rename from test/db/archos/not-windows-any/http rename to test/db/io/http diff --git a/test/scripts/http_server.py b/test/scripts/http_server.py index a4e2a27ce2..5f0b97bb4b 100755 --- a/test/scripts/http_server.py +++ b/test/scripts/http_server.py @@ -8,11 +8,17 @@ a new connection. import http.client import subprocess +import sys def main(): + args = "-m http.server 9000 --bind 127.0.0.1" + if sys.platform == "win32": + cmd = "start /B pythonw3 " + args + else: + cmd = "python3 " + args + " &" subprocess.run( - "python3 -m http.server 9000 --bind 127.0.0.1 &", + cmd, shell=True, check=True, cwd="www", diff --git a/test/scripts/kill_http_server.py b/test/scripts/kill_http_server.py index 084ce35bd1..99cd1dde11 100755 --- a/test/scripts/kill_http_server.py +++ b/test/scripts/kill_http_server.py @@ -9,14 +9,22 @@ import re import sys import psutil +http_server_killed = 0 for p in psutil.process_iter(["cmdline"]): try: - if re.search(r"[Pp]ython3? -m http\.server", " ".join(p.cmdline())): + if re.search(r"[Pp]ythonw?3? -m http\.server 9000", " ".join(p.cmdline())): p.kill() - print("Killed http.server") - sys.exit(0) + http_server_killed += 1 + if http_server_killed == 2: + # Not stopping at 1 since what got killed might have been the + # shell that ran the server + break except (psutil.AccessDenied, psutil.NoSuchProcess): pass -print("ERROR: http.server process not found") -sys.exit(1) +if http_server_killed > 0: + print("Killed http.server") + sys.exit(0) +else: + print("ERROR: http.server process not found") + sys.exit(1)