Skip to content

fix: compile with PyPy when nightly feature is enabled#6146

Merged
davidhewitt merged 4 commits into
PyO3:mainfrom
chirizxc:pypy-nightly
Jun 21, 2026
Merged

fix: compile with PyPy when nightly feature is enabled#6146
davidhewitt merged 4 commits into
PyO3:mainfrom
chirizxc:pypy-nightly

Conversation

@chirizxc

@chirizxc chirizxc commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

From lava-sh/yaml-rs CI

[21](https://github.com/lava-sh/yaml-rs/actions/runs/27904060735/job/82569415590?pr=146#step:7:122)
   Compiling pyo3-macros v0.29.0
error[E0425]: cannot find type `PyWeakReference` in module `crate::ffi`
   --> C:\Users\runneradmin\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\pyo3-0.29.0\src\marker.rs:289:37
    |
289 |         impl !Ungil for crate::ffi::PyWeakReference {}
    |                                     ^^^^^^^^^^^^^^^ not found in `crate::ffi`

error[E0425]: cannot find type `PyDictKeysObject` in module `crate::ffi`
   --> C:\Users\runneradmin\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\pyo3-0.29.0\src\marker.rs:293:37
    |
293 |         impl !Ungil for crate::ffi::PyDictKeysObject {}
    |                                     ^^^^^^^^^^^^^^^^
    |
   ::: C:\Users\runneradmin\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\pyo3-ffi-0.29.0\src\cpython\dictobject.rs:42:1
    |
 42 | pub struct PyDictObject {
    | ----------------------- similarly named struct `PyDictObject` defined here
    |
help: a struct with a similar name exists
    |
293 -         impl !Ungil for crate::ffi::PyDictKeysObject {}
293 +         impl !Ungil for crate::ffi::PyDictObject {}
    |

For more information about this error, try `rustc --explain E0425`.
error: could not compile `pyo3` (lib) due to 2 previous errors
💥 maturin failed
  Caused by: Failed to build a native library through cargo
  Caused by: Cargo build finished with "exit code: 101": `"cargo" "rustc" "--features" "mimalloc" "--message-format" "json-render-diagnostics" "--manifest-path" "D:\\a\\yaml-rs\\yaml-rs\\Cargo.toml" "--lib"`
Error: Process completed with exit code 1.

@chirizxc chirizxc closed this Jun 21, 2026
@chirizxc chirizxc reopened this Jun 21, 2026

@davidhewitt davidhewitt left a comment

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.

Thanks! Can you please add a test for this, probably by adding a check-nightly job which runs uvx nox -s check-all but is otherwise the same as the existing clippy jobs (in ci.yml)

(I confirmed that locally running RUSTUP_TOOLCHAIN=nightly uvx nox -s check-all is already good enough to reproduce the issue.)

@davidhewitt davidhewitt left a comment

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.

Thanks, will tweak one line and send to merge

Comment thread .github/workflows/ci.yml Outdated
@davidhewitt davidhewitt enabled auto-merge June 21, 2026 20:54
@davidhewitt davidhewitt mentioned this pull request Jun 21, 2026
3 tasks
@davidhewitt davidhewitt added this pull request to the merge queue Jun 21, 2026
Merged via the queue into PyO3:main with commit e8f7a5d Jun 21, 2026
50 checks passed
@chirizxc chirizxc deleted the pypy-nightly branch June 21, 2026 23:48
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.

2 participants