From 87aa7ad370d97adc89f799b6a6b942c946cf5296 Mon Sep 17 00:00:00 2001 From: ShaharNaveh <50263213+ShaharNaveh@users.noreply.github.com> Date: Sat, 7 Mar 2026 09:43:17 +0100 Subject: [PATCH 1/4] `--features` flag can take multiple values --- scripts/whats_left.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/scripts/whats_left.py b/scripts/whats_left.py index 00db9a0ac5c..f8878369954 100755 --- a/scripts/whats_left.py +++ b/scripts/whats_left.py @@ -67,9 +67,9 @@ def parse_args(): ) parser.add_argument( "--features", - action="store", - help="which features to enable when building RustPython (default: ssl)", - default="ssl", + action="append", + help="which features to enable when building RustPython (default: [ssl])", + default=["ssl"], ) args = parser.parse_args() @@ -449,16 +449,20 @@ def remove_one_indent(s): cargo_build_command = ["cargo", "build", "--release"] if args.no_default_features: cargo_build_command.append("--no-default-features") + +joined_features = ",".join(args.features) if args.features: - cargo_build_command.extend(["--features", args.features]) + cargo_build_command.extend(["--features", joined_features]) subprocess.run(cargo_build_command, check=True) cargo_run_command = ["cargo", "run", "--release"] if args.no_default_features: cargo_run_command.append("--no-default-features") + if args.features: - cargo_run_command.extend(["--features", args.features]) + cargo_run_command.extend(["--features", joined_features]) + cargo_run_command.extend(["-q", "--", GENERATED_FILE]) result = subprocess.run( From 89d4b84a425517eae3d04fd4060cbdfa0b8627f0 Mon Sep 17 00:00:00 2001 From: ShaharNaveh <50263213+ShaharNaveh@users.noreply.github.com> Date: Sat, 7 Mar 2026 09:48:34 +0100 Subject: [PATCH 2/4] Simplify CI job --- .github/workflows/ci.yaml | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a58490666c7..7f9dde5e024 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -293,7 +293,13 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [macos-latest, ubuntu-latest, windows-2025] + include: + - os: macos-latest + cargo_args: "" # TODO: Fix jit on macOS + - os: ubuntu-latest + cargo_args: "--features jit" + - os: windows-2025 + cargo_args: "--features jit" fail-fast: false steps: - uses: actions/checkout@v6.0.2 @@ -302,18 +308,14 @@ jobs: - uses: actions/setup-python@v6.2.0 with: python-version: ${{ env.PYTHON_VERSION }} + - name: Set up the Mac environment run: brew install autoconf automake libtool openssl@3 if: runner.os == 'macOS' + - name: build rustpython - run: cargo build --release --verbose --features=threading ${{ env.CARGO_ARGS }} - if: runner.os == 'macOS' - - name: build rustpython - run: cargo build --release --verbose --features=threading ${{ env.CARGO_ARGS }},jit - if: runner.os != 'macOS' - - uses: actions/setup-python@v6.2.0 - with: - python-version: ${{ env.PYTHON_VERSION }} + run: cargo build --release --verbose --features=threading ${{ env.CARGO_ARGS }} ${{ matrix.cargo_args }} + - name: run snippets run: python -m pip install -r requirements.txt && pytest -v working-directory: ./extra_tests @@ -445,14 +447,10 @@ jobs: run: | target/release/rustpython -m venv testvenv testvenv/bin/rustpython -m pip install wheel - - if: runner.os != 'macOS' - name: Check whats_left is not broken - shell: bash - run: python -I scripts/whats_left.py --no-default-features --features "$(sed -e 's/--[^ ]*//g' <<< "${{ env.CARGO_ARGS }}" | tr -d '[:space:]'),threading,jit" - - if: runner.os == 'macOS' # TODO fix jit on macOS - name: Check whats_left is not broken (macOS) + + - name: Check whats_left is not broken shell: bash - run: python -I scripts/whats_left.py --no-default-features --features "$(sed -e 's/--[^ ]*//g' <<< "${{ env.CARGO_ARGS }}" | tr -d '[:space:]'),threading" # no jit on macOS for now + run: python -I scripts/whats_left.py ${{ env.CARGO_ARGS }} ${{ matrix.cargo_args }} lint: name: Lint Rust & Python code From 9a84b59831150bb90033a41b94d35f0a2fd74ad2 Mon Sep 17 00:00:00 2001 From: ShaharNaveh <50263213+ShaharNaveh@users.noreply.github.com> Date: Sat, 7 Mar 2026 09:57:12 +0100 Subject: [PATCH 3/4] Remove bad default --- scripts/whats_left.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/whats_left.py b/scripts/whats_left.py index f8878369954..9a4d57df6ae 100755 --- a/scripts/whats_left.py +++ b/scripts/whats_left.py @@ -68,8 +68,8 @@ def parse_args(): parser.add_argument( "--features", action="append", - help="which features to enable when building RustPython (default: [ssl])", - default=["ssl"], + help="which features to enable when building RustPython (default: [])", + default=[], ) args = parser.parse_args() From a2a80ab91b50f90f9208510c0b5c9ce54e612955 Mon Sep 17 00:00:00 2001 From: ShaharNaveh <50263213+ShaharNaveh@users.noreply.github.com> Date: Sat, 7 Mar 2026 09:59:31 +0100 Subject: [PATCH 4/4] Enable jit on macOS --- .github/workflows/ci.yaml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7f9dde5e024..c476a07fbff 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -293,13 +293,10 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - include: - - os: macos-latest - cargo_args: "" # TODO: Fix jit on macOS - - os: ubuntu-latest - cargo_args: "--features jit" - - os: windows-2025 - cargo_args: "--features jit" + os: + - macos-latest + - ubuntu-latest + - windows-2025 fail-fast: false steps: - uses: actions/checkout@v6.0.2 @@ -314,7 +311,7 @@ jobs: if: runner.os == 'macOS' - name: build rustpython - run: cargo build --release --verbose --features=threading ${{ env.CARGO_ARGS }} ${{ matrix.cargo_args }} + run: cargo build --release --verbose --features=threading,jit ${{ env.CARGO_ARGS }} - name: run snippets run: python -m pip install -r requirements.txt && pytest -v @@ -450,7 +447,7 @@ jobs: - name: Check whats_left is not broken shell: bash - run: python -I scripts/whats_left.py ${{ env.CARGO_ARGS }} ${{ matrix.cargo_args }} + run: python -I scripts/whats_left.py ${{ env.CARGO_ARGS }} --features jit lint: name: Lint Rust & Python code