From 83532bf22dc817e755d6a49557f31076a75b695a Mon Sep 17 00:00:00 2001 From: ShaharNaveh <50263213+ShaharNaveh@users.noreply.github.com> Date: Sat, 7 Mar 2026 13:39:45 +0100 Subject: [PATCH 1/4] Use new action --- .github/actions/install-linux-deps/action.yml | 49 +++++++++++++++++++ .github/workflows/ci.yaml | 17 +++++-- 2 files changed, 63 insertions(+), 3 deletions(-) create mode 100644 .github/actions/install-linux-deps/action.yml diff --git a/.github/actions/install-linux-deps/action.yml b/.github/actions/install-linux-deps/action.yml new file mode 100644 index 00000000000..367e8159a57 --- /dev/null +++ b/.github/actions/install-linux-deps/action.yml @@ -0,0 +1,49 @@ +# This action installs a few dependencies necessary to build RustPython on Linux. +# It can be configured depending on which libraries are needed: +# +# ``` +# - uses: ./.github/actions/install-linux-deps +# with: +# gcc-multilib: true +# musl-tools: false +# ``` +# +# See the `inputs` section for all options and their defaults. Note that you must checkout the +# repository before you can use this action. +# +# This action will only install dependencies when the current operating system is Linux. It will do +# nothing on any other OS (macOS, Windows). + +name: Install macOS dependencies +description: Installs the dependencies necessary to build RustPython on macOS. +inputs: + gcc-multilib: + description: Install gcc-multilib (gcc-multilib) + required: false + default: "false" + musl-tools: + description: Install musl-tools (musl-tools) + required: false + default: "false" + gcc-aarch64-linux-gnu: + description: Install gcc-aarch64-linux-gnu (gcc-aarch64-linux-gnu) + required: false + default: "false" + clang: + description: Install clang (clang) + required: false + default: "false" +runs: + using: composite + steps: + - name: Install Linux dependencies + shell: bash + if: ${{ runner.os == 'Linux' }} + run: > + sudo apt-get update + + sudo apt-get install --no-install-recommends + ${{ fromJSON(inputs.gcc-multilib) && 'gcc-multilib' || '' }} + ${{ fromJSON(inputs.musl-tools) && 'musl-tools' || '' }} + ${{ fromJSON(inputs.clang) && 'clang' || '' }} + ${{ fromJSON(inputs.gcc-aarch64-linux-gnu) && 'gcc-aarch64-linux-gnu' || '' }} diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0848d59295a..2c7fb9dea90 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -217,7 +217,11 @@ jobs: target: i686-unknown-linux-gnu - name: Install gcc-multilib and musl-tools - run: sudo apt-get update && sudo apt-get install gcc-multilib musl-tools + uses: ./.github/actions/install-linux/deps + with: + gcc-multilib: true + musl-tools: true + - name: Check compilation for x86 32bit run: cargo check --target i686-unknown-linux-gnu ${{ env.CARGO_ARGS_NO_SSL }} @@ -244,7 +248,10 @@ jobs: target: aarch64-unknown-linux-gnu - name: Install gcc-aarch64-linux-gnu - run: sudo apt install gcc-aarch64-linux-gnu + uses: ./.github/actions/install-linux/deps + with: + gcc-aarch64-linux-gnu: true + - name: Check compilation for aarch64 linux gnu run: cargo check --target aarch64-unknown-linux-gnu ${{ env.CARGO_ARGS_NO_SSL }} @@ -597,8 +604,12 @@ jobs: - uses: Swatinem/rust-cache@v2 - name: Setup Wasmer uses: wasmerio/setup-wasmer@v3 + - name: Install clang - run: sudo apt-get update && sudo apt-get install clang -y + uses: ./.github/actions/install-linux/deps + with: + clang: true + - name: build rustpython run: cargo build --release --target wasm32-wasip1 --features freeze-stdlib,stdlib --verbose - name: run snippets From 5f4e4a259c679417aa2f6602f99b929daee239cd Mon Sep 17 00:00:00 2001 From: ShaharNaveh <50263213+ShaharNaveh@users.noreply.github.com> Date: Sat, 7 Mar 2026 13:42:35 +0100 Subject: [PATCH 2/4] Fix name --- .github/actions/install-linux-deps/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/install-linux-deps/action.yml b/.github/actions/install-linux-deps/action.yml index 367e8159a57..4046d98be61 100644 --- a/.github/actions/install-linux-deps/action.yml +++ b/.github/actions/install-linux-deps/action.yml @@ -14,8 +14,8 @@ # This action will only install dependencies when the current operating system is Linux. It will do # nothing on any other OS (macOS, Windows). -name: Install macOS dependencies -description: Installs the dependencies necessary to build RustPython on macOS. +name: Install Linux dependencies +description: Installs the dependencies necessary to build RustPython on Linux. inputs: gcc-multilib: description: Install gcc-multilib (gcc-multilib) From 7bb83b038794fb3e1a4917bb2042b7dba59710cc Mon Sep 17 00:00:00 2001 From: ShaharNaveh <50263213+ShaharNaveh@users.noreply.github.com> Date: Sat, 7 Mar 2026 13:57:18 +0100 Subject: [PATCH 3/4] Use correct path --- .github/workflows/ci.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 2c7fb9dea90..a659be6e328 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -217,7 +217,7 @@ jobs: target: i686-unknown-linux-gnu - name: Install gcc-multilib and musl-tools - uses: ./.github/actions/install-linux/deps + uses: ./.github/actions/install-linux-deps with: gcc-multilib: true musl-tools: true @@ -248,7 +248,7 @@ jobs: target: aarch64-unknown-linux-gnu - name: Install gcc-aarch64-linux-gnu - uses: ./.github/actions/install-linux/deps + uses: ./.github/actions/install-linux-deps with: gcc-aarch64-linux-gnu: true @@ -606,7 +606,7 @@ jobs: uses: wasmerio/setup-wasmer@v3 - name: Install clang - uses: ./.github/actions/install-linux/deps + uses: ./.github/actions/install-linux-deps with: clang: true From 11f1af77f14e75149bcc43e7c773a7cb431580bb Mon Sep 17 00:00:00 2001 From: ShaharNaveh <50263213+ShaharNaveh@users.noreply.github.com> Date: Sat, 7 Mar 2026 14:11:48 +0100 Subject: [PATCH 4/4] Install recommends --- .github/actions/install-linux-deps/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/install-linux-deps/action.yml b/.github/actions/install-linux-deps/action.yml index 4046d98be61..e3452170532 100644 --- a/.github/actions/install-linux-deps/action.yml +++ b/.github/actions/install-linux-deps/action.yml @@ -42,7 +42,7 @@ runs: run: > sudo apt-get update - sudo apt-get install --no-install-recommends + sudo apt-get install ${{ fromJSON(inputs.gcc-multilib) && 'gcc-multilib' || '' }} ${{ fromJSON(inputs.musl-tools) && 'musl-tools' || '' }} ${{ fromJSON(inputs.clang) && 'clang' || '' }}