From 31fe86546092b1fa07904c7f6ede6e2a29c0a0be Mon Sep 17 00:00:00 2001 From: Alessandro Gatti Date: Mon, 5 Jan 2026 14:25:55 +0100 Subject: [PATCH] tools/ci.sh: Use CPython 3.11 for Unix/RV64. This commit forces the installation of CPython 3.11 instead of CPython 3.12 in the OS image for Unix/RV64 CI jobs. CPython 3.12 is not compatible with settrace tests, but it is the CPython version that is installed by default in "ubuntu-latest" (which is Ubuntu 24.04 LTS right now). Updating the base image for the RV64 tests also disabled settrace tests to work around its incompatibility, however turns out there is a way to force CI to set up a base OS image with an arbitrary CPython version. Now the RV64 CI jobs are now going to be executed using CPython 3.11, and thus the settrace tests can be removed from the ignore list. Signed-off-by: Alessandro Gatti --- .github/workflows/ports_unix.yml | 5 +++++ tools/ci.sh | 7 +++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ports_unix.yml b/.github/workflows/ports_unix.yml index f083a9d0f1..5f9aa26d1b 100644 --- a/.github/workflows/ports_unix.yml +++ b/.github/workflows/ports_unix.yml @@ -288,6 +288,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 + - uses: actions/setup-python@v6 + # Python 3.12 is the default for ubuntu-24.04, but that has compatibility issues with settrace tests. + # Can remove this step when ubuntu-latest uses a more recent Python 3.x as the default. + with: + python-version: '3.11' - name: Install packages run: tools/ci.sh unix_qemu_riscv64_setup - name: Build diff --git a/tools/ci.sh b/tools/ci.sh index f9f40e5dd4..31ef77c260 100755 --- a/tools/ci.sh +++ b/tools/ci.sh @@ -961,8 +961,8 @@ function ci_unix_qemu_riscv64_setup { ci_gcc_riscv_setup sudo apt-get update sudo apt-get install gcc-riscv64-linux-gnu g++-riscv64-linux-gnu libltdl-dev - sudo pip3 install pyelftools - sudo pip3 install ar + python3 -m pip install pyelftools + python3 -m pip install ar sudo apt-get install qemu-user-static qemu-riscv64-static --version sudo mkdir -p /usr/gnemul @@ -977,13 +977,12 @@ function ci_unix_qemu_riscv64_build { function ci_unix_qemu_riscv64_run_tests { # Issues with RISCV-64 tests: - # - misc/sys_settrace_features.py doesn't work with CPython 3.12 # - thread/stress_aes.py takes around 180 seconds # - thread/stress_recurse.py is flaky # - thread/thread_gc1.py is flaky file ./ports/unix/build-coverage/micropython pushd tests - MICROPY_MICROPYTHON=../ports/unix/build-coverage/micropython MICROPY_TEST_TIMEOUT=200 ./run-tests.py --exclude 'misc/sys_settrace_features.py|thread/stress_recurse.py|thread/thread_gc1.py' + MICROPY_MICROPYTHON=../ports/unix/build-coverage/micropython MICROPY_TEST_TIMEOUT=200 ./run-tests.py --exclude 'thread/stress_recurse.py|thread/thread_gc1.py' MICROPY_MICROPYTHON=../ports/unix/build-coverage/micropython ./run-natmodtests.py extmod/btree*.py extmod/deflate*.py extmod/framebuf*.py extmod/heapq*.py extmod/random_basic*.py extmod/re*.py popd }