PyO3 / PyO3/pyo3

Bump to Rust 1.85, edition 2024

Open
#6,418 1 comment 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
16.2k
Forks
1k
Avg merge
2d 6h
Merged PRs (30d)
66

Description

Our last MSRV bump was to 1.83, nearly a year ago, in #5531

I have been experimenting recently in #6386 to see what performance gain we could get from merged doctests. I'd previously looked briefly but missed that trivially bumping the edition and running doctests was insufficient; the merged build was failing so it was falling back to unmerged doctests with no material gain.

In #6386 I've run through the whole edition bump and successfully proven merged doctests are running. It's made quite a substantial difference to CI.

I got local AI to write me a script to compare a recent merge to main which ran pyo3-ffi-check to the latest run #6386. Table below for jobs with greater than 10% move.

Total compute time for CI went from 11h 30m to 9h 51m πŸŽ‰

I think based on this, we should proceed with bumping MSRV up to 1.85. The discussion leading to #5531 noted that Linux distros we track all have 1.85 and up.

Hopefully cryptography would be ok with this change? cc @alex

I'd like to land this in 0.30 given it looks like it'll unlock quite a significant CI boost for us.


Job 34718265503 34963409993 Ξ” last βˆ’ first Change
wasm32-wasip1 16m43s 7m30s βˆ’9m13s -55.1%
valgrind 32m11s 15m56s βˆ’16m15s -50.5%
test-introspection (macos-latest, arm64, aarch64-apple-darwin) 1m06s 0m42s βˆ’0m24s -36.4%
python3.14-x64 windows-latest rust-stable / build 21m30s 13m50s βˆ’7m40s -35.7%
python3.15-dev-x64 windows-latest rust-stable / build 25m07s 16m53s βˆ’8m14s -32.8%
test-cross-compilation windows-latest -> aarch64-pc-windows-msvc 2m37s 1m47s βˆ’0m50s -31.8%
python3.10-x64 windows-latest rust-stable / build 19m07s 13m35s βˆ’5m32s -28.9%
test-version-limits 1m03s 0m46s βˆ’0m17s -27.0%
python3.15t-dev-x64 ubuntu-latest rust-stable / build 7m11s 5m15s βˆ’1m56s -26.9%
python3.11-x64 ubuntu-latest rust-stable / build 8m13s 6m03s βˆ’2m10s -26.4%
python3.11-x64 windows-latest rust-stable / build 20m54s 15m28s βˆ’5m26s -26.0%
python3.13-x64 ubuntu-latest rust-stable / build 8m09s 6m05s βˆ’2m04s -25.4%
python3.14-x64 ubuntu-latest rust-stable / build 8m49s 6m41s βˆ’2m08s -24.2%
python3.14-x64 ubuntu-latest rust-nightly / build 5m37s 4m16s βˆ’1m21s -24.0%
python3.13-x64 windows-latest rust-stable / build 20m01s 15m14s βˆ’4m47s -23.9%
pytests-type-checking (pyrefly) 0m34s 0m26s βˆ’0m08s -23.5%
python3.14-arm64 ubuntu-24.04-arm rust-stable / build 9m34s 7m24s βˆ’2m10s -22.6%
python3.14t-arm64 ubuntu-24.04-arm rust-stable / build 6m38s 5m10s βˆ’1m28s -22.1%
pythongraalpy25.0-arm64 macos-latest rust-stable / build 8m45s 6m50s βˆ’1m55s -21.9%
python3.14t-x64 windows-latest rust-stable / build 15m05s 11m50s βˆ’3m15s -21.5%
python3.9-x64 macos-15-intel rust-stable / build 18m44s 14m46s βˆ’3m58s -21.2%
python3.9-x64 windows-latest rust-stable / build 17m02s 13m34s βˆ’3m28s -20.4%
python3.14-arm64 macos-latest rust-stable / build 10m37s 8m41s βˆ’1m56s -18.2%
python3.14-x86 windows-latest rust-stable / build 22m54s 19m00s βˆ’3m54s -17.0%
python3.14t-arm64 windows-11-arm rust-stable / build 14m04s 11m45s βˆ’2m19s -16.5%
python3.14-arm64 windows-11-arm rust-stable / build 17m49s 14m57s βˆ’2m52s -16.1%
careful 5m25s 4m33s βˆ’0m52s -16.0%
python3.14-x64 ubuntu-latest rust-beta / build 7m12s 6m04s βˆ’1m08s -15.7%
python3.15-dev-arm64 macos-latest rust-stable / build 12m58s 10m56s βˆ’2m02s -15.7%
python3.15t-dev-x64 windows-latest rust-stable / build 18m11s 15m26s βˆ’2m45s -15.1%
test-debug-min-version 11m19s 9m39s βˆ’1m40s -14.7%
test-introspection (windows-latest, x64, x86_64-pc-windows-msvc) 1m44s 1m29s βˆ’0m15s -14.4%
python3.12-x64 ubuntu-latest rust-stable / build 8m20s 7m10s βˆ’1m10s -14.0%
no_std (clippy) 2m24s 2m04s βˆ’0m20s -13.9%
python3.15-dev-x64 ubuntu-latest rust-stable / build 9m52s 8m42s βˆ’1m10s -11.8%
python3.14t-x64 ubuntu-latest rust-stable / build 4m47s 5m30s +0m43s +15.0%
test-cross-compilation ubuntu-latest -> aarch64-unknown-linux-gnu 2m13s 2m33s +0m20s +15.0%
python3.13-arm64 macos-latest rust-stable / build 7m37s 9m27s +1m50s +24.1%
pythonpypy3.11-arm64 macos-latest rust-stable / build 4m43s 5m56s +1m13s +25.8%
test-cross-compilation-windows 1m09s 1m27s +0m18s +26.1%
python3.11-arm64 macos-latest rust-stable / build 8m39s 10m55s +2m16s +26.2%
pytests-type-checking (mypy) 0m27s 0m37s +0m10s +37.0%
emscripten 6m33s 10m19s +3m46s +57.5%

(Don't worry about emscripten - the apparent slowdown is because the build cache was bust by the changes so the branch includes a rebuild of CPython.)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up β€” it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the completed edition-bump work in #6386 and the previous MSRV change in #5531, then locate the current MSRV and edition declarations and related CI configuration. Done means Rust 1.85 and edition 2024 are adopted, merged doctests run successfully, CI passes across supported targets, and compatibility with cryptography is confirmed.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system, ci-cd
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.