X Tutup
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/actions/install-linux-deps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ runs:
run: >
sudo apt-get update
sudo apt-get install
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' || '' }}
${{ fromJSON(inputs.gcc-aarch64-linux-gnu) && 'gcc-aarch64-linux-gnu linux-libc-dev-arm64-cross libc6-dev-arm64-cross' || '' }}
115 changes: 42 additions & 73 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -188,102 +188,71 @@ jobs:
PYTHONPATH: scripts
if: runner.os == 'Linux'

- name: prepare Intel MacOS build
uses: dtolnay/rust-toolchain@stable
with:
target: x86_64-apple-darwin
if: runner.os == 'macOS'
- name: Check compilation for Intel MacOS
run: cargo check --target x86_64-apple-darwin
if: runner.os == 'macOS'
- name: prepare iOS build
uses: dtolnay/rust-toolchain@stable
with:
target: aarch64-apple-ios
if: runner.os == 'macOS'
- name: Check compilation for iOS
run: cargo check --target aarch64-apple-ios ${{ env.CARGO_ARGS_NO_SSL }}
if: runner.os == 'macOS'

exotic_targets:
cargo_check:
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip:ci') }}
name: Ensure compilation on various targets
runs-on: ubuntu-latest
timeout-minutes: 30
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
targets:
- aarch64-linux-android
- i686-unknown-linux-gnu
- i686-unknown-linux-musl
- wasm32-wasip2
- x86_64-unknown-freebsd
dependencies:
gcc-multilib: true
musl-tools: true
- os: ubuntu-latest
targets:
- aarch64-unknown-linux-gnu
dependencies:
gcc-aarch64-linux-gnu: true # conflict with `gcc-multilib`
- os: macos-latest
targets:
- aarch64-apple-ios
- x86_64-apple-darwin
fail-fast: false
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
target: i686-unknown-linux-gnu
persist-credentials: false

- name: Install gcc-multilib and musl-tools
uses: ./.github/actions/install-linux-deps
- uses: Swatinem/rust-cache@v2
with:
gcc-multilib: true
musl-tools: true
prefix-key: v0-rust-${{ join(matrix.targets, '-') }}

- name: Check compilation for x86 32bit
run: cargo check --target i686-unknown-linux-gnu ${{ env.CARGO_ARGS_NO_SSL }}
- name: Install dependencies
uses: ./.github/actions/install-linux-deps
with: ${{ matrix.dependencies || fromJSON('{}') }}
Comment on lines +197 to +229
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

# Find and examine the install-linux-deps action
fd -t f "install-linux-deps" --type d

Repository: RustPython/RustPython

Length of output: 47


🏁 Script executed:

# List the contents of the install-linux-deps action directory
git ls-files ".github/actions/install-linux-deps/"

Repository: RustPython/RustPython

Length of output: 110


🏁 Script executed:

# Read the install-linux-deps action.yml to see its inputs
cat ".github/actions/install-linux-deps/action.yml"

Repository: RustPython/RustPython

Length of output: 1730


🏁 Script executed:

# Also check the install-macos-deps for comparison (mentioned in the learning)
cat ".github/actions/install-macos-deps/action.yml"

Repository: RustPython/RustPython

Length of output: 1579


🏁 Script executed:

# Read the current ci.yaml workflow to see the exact line 229 context
sed -n '190,235p' ".github/workflows/ci.yaml"

Repository: RustPython/RustPython

Length of output: 1453


Fix the schema violation: with: must be a mapping, not a scalar expression.

Line 229 passes a scalar expression where GitHub Actions requires an explicit mapping. Flatten the matrix flags into individual booleans and bind each action input explicitly.

Proposed fix
       matrix:
         include:
         - os: ubuntu-latest
           targets:
             - aarch64-linux-android
             - i686-unknown-linux-gnu
             - i686-unknown-linux-musl
             - wasm32-wasip2
             - x86_64-unknown-freebsd
-          dependencies:
-            gcc-multilib: true
-            musl-tools: true
+          gcc_multilib: true
+          musl_tools: true
         - os: ubuntu-latest
           targets:
             - aarch64-unknown-linux-gnu
-          dependencies:
-            gcc-aarch64-linux-gnu: true # conflict with `gcc-multilib`
+          gcc_aarch64_linux_gnu: true # conflict with `gcc-multilib`
         - os: macos-latest
           targets:
             - aarch64-apple-ios
             - x86_64-apple-darwin
       fail-fast: false
...
       - name: Install dependencies
+        if: runner.os == 'Linux'
         uses: ./.github/actions/install-linux-deps
-        with: ${{ matrix.dependencies || fromJSON('{}') }}
+        with:
+          gcc-multilib: ${{ matrix.gcc_multilib || false }}
+          musl-tools: ${{ matrix.musl_tools || false }}
+          clang: ${{ matrix.clang || false }}
+          gcc-aarch64-linux-gnu: ${{ matrix.gcc_aarch64_linux_gnu || false }}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
include:
- os: ubuntu-latest
targets:
- aarch64-linux-android
- i686-unknown-linux-gnu
- i686-unknown-linux-musl
- wasm32-wasip2
- x86_64-unknown-freebsd
dependencies:
gcc-multilib: true
musl-tools: true
- os: ubuntu-latest
targets:
- aarch64-unknown-linux-gnu
dependencies:
gcc-aarch64-linux-gnu: true # conflict with `gcc-multilib`
- os: macos-latest
targets:
- aarch64-apple-ios
- x86_64-apple-darwin
fail-fast: false
steps:
- uses: actions/checkout@v6.0.2
- uses: dtolnay/rust-toolchain@stable
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
target: i686-unknown-linux-gnu
persist-credentials: false
- name: Install gcc-multilib and musl-tools
uses: ./.github/actions/install-linux-deps
- uses: Swatinem/rust-cache@v2
with:
gcc-multilib: true
musl-tools: true
prefix-key: v0-rust-${{ join(matrix.targets, '-') }}
- name: Check compilation for x86 32bit
run: cargo check --target i686-unknown-linux-gnu ${{ env.CARGO_ARGS_NO_SSL }}
- name: Install dependencies
uses: ./.github/actions/install-linux-deps
with: ${{ matrix.dependencies || fromJSON('{}') }}
include:
- os: ubuntu-latest
targets:
- aarch64-linux-android
- i686-unknown-linux-gnu
- i686-unknown-linux-musl
- wasm32-wasip2
- x86_64-unknown-freebsd
gcc_multilib: true
musl_tools: true
- os: ubuntu-latest
targets:
- aarch64-unknown-linux-gnu
gcc_aarch64_linux_gnu: true # conflict with `gcc-multilib`
- os: macos-latest
targets:
- aarch64-apple-ios
- x86_64-apple-darwin
fail-fast: false
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: Swatinem/rust-cache@v2
with:
prefix-key: v0-rust-${{ join(matrix.targets, '-') }}
- name: Install dependencies
if: runner.os == 'Linux'
uses: ./.github/actions/install-linux-deps
with:
gcc-multilib: ${{ matrix.gcc_multilib || false }}
musl-tools: ${{ matrix.musl_tools || false }}
clang: ${{ matrix.clang || false }}
gcc-aarch64-linux-gnu: ${{ matrix.gcc_aarch64_linux_gnu || false }}
🧰 Tools
🪛 actionlint (1.7.11)

[error] 229-229: "with" section is scalar node but mapping node is expected

(syntax-check)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yaml around lines 197 - 229, The Install dependencies
step uses a scalar expression for with: (with: ${{ matrix.dependencies ||
fromJSON('{}') }}) which violates GitHub Actions schema; change the with: to an
explicit mapping of the action inputs (the boolean flags) instead of a single
scalar. Update the step that uses ./.github/actions/install-linux-deps so its
with: lists each dependency key as a mapping entry (e.g., gcc-multilib,
musl-tools, gcc-aarch64-linux-gnu) and set each value to a safe expression that
reads the matrix entry with a default (e.g., ${{
matrix.dependencies.gcc-multilib || false }}), ensuring every possible
dependency key in the matrix is represented as a boolean input.


- uses: dtolnay/rust-toolchain@stable
with:
target: aarch64-linux-android
targets: ${{ join(matrix.targets, ',') }}

- name: Setup Android NDK
if: ${{ contains(matrix.targets, 'aarch64-linux-android') }}
id: setup-ndk
uses: nttld/setup-ndk@v1
with:
ndk-version: r27
add-to-path: true

- name: Check compilation for android
run: cargo check --target aarch64-linux-android ${{ env.CARGO_ARGS_NO_SSL }}
- name: Check compilation
run: |
for target in ${{ join(matrix.targets, ' ') }}
do
echo "::group::${target}"
cargo check --target $target ${{ env.CARGO_ARGS_NO_SSL }}
echo "::endgroup::"
done
env:
CC_aarch64_linux_android: ${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang
AR_aarch64_linux_android: ${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar
CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER: ${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang

- uses: dtolnay/rust-toolchain@stable
with:
target: aarch64-unknown-linux-gnu

- name: 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 }}

- uses: dtolnay/rust-toolchain@stable
with:
target: i686-unknown-linux-musl

- name: Check compilation for musl
run: cargo check --target i686-unknown-linux-musl ${{ env.CARGO_ARGS_NO_SSL }}

- uses: dtolnay/rust-toolchain@stable
with:
target: x86_64-unknown-freebsd

- name: Check compilation for freebsd
run: cargo check --target x86_64-unknown-freebsd ${{ env.CARGO_ARGS_NO_SSL }}

- uses: dtolnay/rust-toolchain@stable
with:
target: wasm32-wasip2

- name: Check compilation for wasip2
run: cargo check --target wasm32-wasip2 ${{ env.CARGO_ARGS_NO_SSL }}

# - name: Prepare repository for redox compilation
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where should redox to be put?

Copy link
Contributor Author

@ShaharNaveh ShaharNaveh Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In one of the target groups. I can try to do in a separate PR. this PR isn't meant to change existing behavior.

I assume we will have a special condition for it like we do in the setup-ndk step

# run: bash scripts/redox/uncomment-cargo.sh
# - name: Check compilation for Redox
# uses: coolreader18/redoxer-action@v1
# with:
# command: check
# args: --ignore-rust-version

snippets_cpython:
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip:ci') }}
env:
Expand Down
X Tutup