Skip to content

Cargo check features on all os#7733

Merged
youknowone merged 7 commits into
RustPython:mainfrom
ShaharNaveh:cargo-check-windows
May 1, 2026
Merged

Cargo check features on all os#7733
youknowone merged 7 commits into
RustPython:mainfrom
ShaharNaveh:cargo-check-windows

Conversation

@ShaharNaveh

@ShaharNaveh ShaharNaveh commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Chores
    • CI now runs a two-pass compilation check: threading-enabled always, plus an SSL-enabled check unless skipped.
    • Per-target flag added to skip SSL-enabled builds for specific platforms (e.g., musl, FreeBSD).
    • Android NDK toolchain settings moved into the build configuration for consistent toolchain setup.
    • Removed the redundant standalone "check without threading" step from the Rust test job.

@coderabbitai

coderabbitai Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

CI cargo_check workflow changed to a two-pass check: first run non-SSL with threading, then conditionally run SSL-enabled check unless skip_ssl is set per matrix entry. Matrix adds skip_ssl: true for MUSL and FreeBSD targets. Android NDK toolchain is written into .cargo/config.toml. rust_tests removed its standalone no-threading check.

Changes

Cohort / File(s) Summary
CI Workflow
/.github/workflows/ci.yaml
Replaced single no-threading cargo check with two-pass approach: always run CARGO_ARGS_NO_SSL with --features threading, then run CARGO_ARGS (SSL) unless matrix skip_ssl is true; extended matrix entries to set skip_ssl: true for MUSL and FreeBSD; moved Android (aarch64-linux-android) NDK CC/AR and linker config into .cargo/config.toml via appended [env] and CARGO_TARGET_*_LINKER; removed rust_tests standalone "check compilation without threading" step.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • youknowone

Poem

"I hopped through CI at break of dawn,
Two-checks I left on every lawn,
NDK tucked like clover sweet,
Matrix flags make testing neat,
A rabbit's stamp — CI passes on 🐇"

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Cargo check features on all os' relates to the PR's objective of enabling/adjusting cargo check across multiple target platforms, but is vague and doesn't clearly convey the specific changes (two-pass check approach, matrix extension, NDK config relocation, or test job cleanup). Consider a more specific title that highlights the main technical change, such as 'Add two-pass cargo check with conditional SSL for multi-platform CI' or 'Extend cargo check matrix with feature flags and NDK configuration'.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
.github/workflows/ci.yaml (2)

151-152: Prefer a pinned Windows runner image for reproducible CI.

This new matrix entry uses windows-latest, while other jobs in this workflow are pinned to windows-2025. Aligning to windows-2025 avoids surprise breakage when latest rolls over.

Suggested change
-        - os: windows-latest
+        - os: windows-2025
           target: x86_64-pc-windows-msvc
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yaml around lines 151 - 152, Update the CI matrix entry
that currently sets "os: windows-latest" to the pinned runner "windows-2025" so
it matches other jobs; locate the matrix definition containing the Windows entry
(the line with os: windows-latest and target: x86_64-pc-windows-msvc) and
replace the os value with windows-2025 to ensure reproducible builds.

211-213: Rename the second log group to match what this run is actually testing.

no threading isn’t the clearest differentiator here; with ssl would better reflect the second command.

Suggested change
-          echo "::group::no threading"
+          echo "::group::with ssl"
           cargo check --target "${{ matrix.target }}" ${{ env.CARGO_ARGS }}
           echo "::endgroup::"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yaml around lines 211 - 213, Rename the GitHub Actions
log group label around the cargo check that runs with SSL: replace the echo
"::group::no threading" string with echo "::group::with ssl" that encloses the
cargo check --target "${{ matrix.target }}" ${{ env.CARGO_ARGS }} line (keep the
echo "::endgroup::" as-is) so the group name accurately reflects the test being
run.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/workflows/ci.yaml:
- Around line 151-152: Update the CI matrix entry that currently sets "os:
windows-latest" to the pinned runner "windows-2025" so it matches other jobs;
locate the matrix definition containing the Windows entry (the line with os:
windows-latest and target: x86_64-pc-windows-msvc) and replace the os value with
windows-2025 to ensure reproducible builds.
- Around line 211-213: Rename the GitHub Actions log group label around the
cargo check that runs with SSL: replace the echo "::group::no threading" string
with echo "::group::with ssl" that encloses the cargo check --target "${{
matrix.target }}" ${{ env.CARGO_ARGS }} line (keep the echo "::endgroup::"
as-is) so the group name accurately reflects the test being run.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 8f75cf97-18ba-4ace-a4e5-0ca31787fac5

📥 Commits

Reviewing files that changed from the base of the PR and between 6b67067 and f27f919.

📒 Files selected for processing (1)
  • .github/workflows/ci.yaml

Comment thread .github/workflows/ci.yaml Fixed
Comment thread .github/workflows/ci.yaml Fixed
Comment thread .github/workflows/ci.yaml Fixed
Comment thread .github/workflows/ci.yaml Outdated
- os: macos-latest
target: x86_64-apple-darwin
- os: windows-latest
target: x86_64-pc-windows-msvc

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

isn't this duplication of default windows machine? did you mean x86 32bit?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes it is. See my table below.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I just moved this

- name: check compilation without threading
run: cargo check ${{ env.CARGO_ARGS }}

to the cargo_check job. but if that was already duplicated then sure, we can remove it

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

we don't need to run cargo check when we actually build the target

@fanninpm

Copy link
Copy Markdown
Contributor

Here's what we're currently compiling for (on the main branch):

Target What We're Doing Rust Support Level
aarch64-apple-darwin rust_tests, snippets_cpython Tier 1 with Host Tools
x86_64-unknown-linux-gnu rust_tests, snippets_cpython, miri Tier 1 with Host Tools
x86_64-pc-windows-msvc rust_tests, snippets_cpython Tier 1 with Host Tools
aarch64-linux-android cargo_check Tier 2 without Host Tools
i686-unknown-linux-gnu cargo_check (with gcc-multilib) Tier 1 with Host Tools
i686-unknown-linux-musl cargo_check (with musl-tools) Tier 2 without Host Tools
wasm32-wasip2 cargo_check Tier 2 without Host Tools
x86_64-unknown-freebsd cargo_check Tier 2 with Host Tools
aarch64-unknown-linux-gnu cargo_check (with gcc-aarch64-linux-gnu) Tier 1 with Host Tools
aarch64-apple-ios cargo_check Tier 2 without Host Tools
x86_64-apple-darwin cargo_check Tier 2 with Host Tools
wasm32-unknown-unknown wasm Tier 2 without Host Tools
wasm32-wasip1 wasm-wasi Tier 2 without Host Tools

Here's the list of targets listed as Tier 1 with Host Tools (which is everything in Tier 1):

  • aarch64-apple-darwin
  • aarch64-pc-windows-msvc
  • aarch64-unknown-linux-gnu
  • i686-pc-windows-msvc (may run into problems with float representation and u64/i64-alignment)
  • i686-unknown-linux-gnu (may run into problems with float representation)
  • x86_64-pc-windows-gnu (requires MinGW)
  • x86_64-pc-windows-msvc
  • x86_64-unknown-linux-gnu

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
.github/workflows/ci.yaml (1)

197-210: Consider adding a guard to prevent duplicate [env] sections when appending to .cargo/config.toml.

The current .cargo/config.toml does not contain an [env] section, so the first append succeeds. However, if the step runs multiple times (e.g., via job retry or matrix re-execution with artifact caching), appending a duplicate [env] header will violate TOML syntax. Check if [env] exists before adding it.

Suggested improvement
       - name: Append env conf to cargo
         if: ${{ matrix.target == 'aarch64-linux-android' }}
         env:
           NDK_PATH: ${{ steps.setup-ndk.outputs.ndk-path }}
         run: |
+          mkdir -p .cargo
+          touch .cargo/config.toml
+          if ! grep -q '^\[env\]$' .cargo/config.toml; then
+            echo "[env]" >> .cargo/config.toml
+          fi
           {
             echo "CC_aarch64_linux_android = \"${NDK_PATH}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang\""
             echo "AR_aarch64_linux_android = \"${NDK_PATH}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar\""
             echo "CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER = \"${NDK_PATH}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang\""
           } >> .cargo/config.toml
🤖 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 - 210, The append step that
writes the "[env]" block to .cargo/config.toml can create duplicate headers;
modify the run block that uses NDK_PATH (the "Append env conf to cargo" step) to
first check whether a line exactly matching "[env]" already exists in
.cargo/config.toml and only append the "[env]" header if missing, then append or
update the three entries (CC_aarch64_linux_android, AR_aarch64_linux_android,
CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER); implement this using a simple shell
conditional (e.g., grep/awk test) so repeated executions won't add a second
"[env]" section.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/workflows/ci.yaml:
- Around line 197-210: The append step that writes the "[env]" block to
.cargo/config.toml can create duplicate headers; modify the run block that uses
NDK_PATH (the "Append env conf to cargo" step) to first check whether a line
exactly matching "[env]" already exists in .cargo/config.toml and only append
the "[env]" header if missing, then append or update the three entries
(CC_aarch64_linux_android, AR_aarch64_linux_android,
CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER); implement this using a simple shell
conditional (e.g., grep/awk test) so repeated executions won't add a second
"[env]" section.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 8fa56ebe-a634-4661-b2f4-99e0d0dd3724

📥 Commits

Reviewing files that changed from the base of the PR and between 5c32c58 and 7f87077.

📒 Files selected for processing (1)
  • .github/workflows/ci.yaml

@youknowone youknowone merged commit 73b5b69 into RustPython:main May 1, 2026
20 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Jun 4, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants