Skip to content

Ubuntu aarch64/arm7 fail to import sync::GILProtected #2471

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 of 2 tasks
nrposner opened this issue Feb 5, 2025 · 1 comment
Closed
1 of 2 tasks

Ubuntu aarch64/arm7 fail to import sync::GILProtected #2471

nrposner opened this issue Feb 5, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@nrposner
Copy link

nrposner commented Feb 5, 2025

Bug Description

Similar to #2385, maturin fails automated checks for some Ubuntu platforms , linux (ubuntu-22.04, aarch64), musllinux (ubuntu-22.04, arm7), due to unresolved import of pyo3::sync::GILProtected.

   Compiling numpy v0.23.0
error[E0432]: unresolved import `pyo3::sync::GILProtected`
  --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/numpy-0.23.0/src/datetime.rs:63:12
   |
63 | use pyo3::{sync::GILProtected, Bound, Py, Python};
   |            ^^^^^^^^^^^^^^^^^^ no `GILProtected` in `sync`
   |

As yet unable to locally replicate error with Docker. Local machine is a Mac, for which all automated tests pass without error.

Failed runs with detailed errors linked above.

Your maturin version (maturin --version)

1.8.1

Your Python version (python -V)

3.13.1

Your pip version (pip -V)

24.3.1

What bindings you're using

pyo3

Does cargo build work?

  • Yes, it works

If on windows, have you checked that you aren't accidentally using unix path (those with the forward slash /)?

  • Yes

Steps to Reproduce

  1. Import both pyo3 = 0.23.3 and numpy = 0.23.0
  2. Create a pyfunction that forces the numpy dependency to compile (does not actually have to use numpy in any capacity).
  3. Add this pyfunction to a pymodule.
  4. Push to github. Automated checks for certain ubuntu versions will fail to import pyo3::sync::GILProtected. See runs linked above for full errors. The minimal repo that replicates this bug is located at https://github.com/nrposner/pyo3_bug
📦 Built wheel for CPython 3.13 to dist/pyo3_bug-0.1.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
   Compiling pyo3-build-config v0.23.4
   Compiling pyo3-macros-backend v0.23.4
   Compiling pyo3-ffi v0.23.4
   Compiling pyo3 v0.23.4
   Compiling pyo3-macros v0.23.4
   Compiling numpy v0.23.0
error[E0432]: unresolved import `pyo3::sync::GILProtected`
  --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/numpy-0.23.0/src/datetime.rs:63:12
   |
63 | use pyo3::{sync::GILProtected, Bound, Py, Python};
   |            ^^^^^^^^^^^^^^^^^^ no `GILProtected` in `sync`
   |
note: found an item that was configured out
  --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pyo3-0.23.4/src/sync.rs:47:12
   |
47 | pub struct GILProtected<T> {
   |            ^^^^^^^^^^^^
note: the item is gated here
  --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pyo3-0.23.4/src/sync.rs:46:1
   |
46 | #[cfg(not(Py_GIL_DISABLED))]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0432]: unresolved import `pyo3::sync::GILProtected`
  --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/numpy-0.23.0/src/strings.rs:15:5
   |
15 |     sync::GILProtected,
   |     ^^^^^^^^^^^^^^^^^^ no `GILProtected` in `sync`
   |
   = note: unresolved item `crate::datetime::units::GILProtected` exists but is inaccessible
note: found an item that was configured out
  --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pyo3-0.23.4/src/sync.rs:47:12
   |
47 | pub struct GILProtected<T> {
   |            ^^^^^^^^^^^^
note: the item is gated here
  --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pyo3-0.23.4/src/sync.rs:46:1
   |
46 | #[cfg(not(Py_GIL_DISABLED))]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

For more information about this error, try `rustc --explain E0432`.
error: could not compile `numpy` (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 status: 101": `env -u CARGO PYO3_CONFIG_FILE="/home/runner/work/pyo3_bug/pyo3_bug/target/maturin/pyo3-config-aarch64-unknown-linux-gnu-3.13.txt" "cargo" "rustc" "--features" "pyo3/extension-module" "--target" "aarch64-unknown-linux-gnu" "--message-format" "json-render-diagnostics" "--manifest-path" "/home/runner/work/pyo3_bug/pyo3_bug/Cargo.toml" "--release" "--lib"`
Error: The process '/usr/bin/docker' failed with exit code 1
    at ExecState._setResult (/home/runner/work/_actions/PyO3/maturin-action/v1/dist/index.js:1702:25)
    at ExecState.CheckComplete (/home/runner/work/_actions/PyO3/maturin-action/v1/dist/index.js:1685:18)
    at ChildProcess.<anonymous> (/home/runner/work/_actions/PyO3/maturin-action/v1/dist/index.js:1579:27)
    at ChildProcess.emit (node:events:519:28)
    at maybeClose (node:internal/child_process:1105:16)
    at ChildProcess._handle.onexit (node:internal/child_process:305:5)
Error: The process '/usr/bin/docker' failed with exit code 1
  1. Attempts to replicate the error locally by replicating the Ubuntu 22.04 aarch64/arm7 environment in Docker have not yet been successful.
@nrposner nrposner added the bug Something isn't working label Feb 5, 2025
@messense
Copy link
Member

messense commented Feb 6, 2025

PyO3/rust-numpy#476

@messense messense closed this as not planned Won't fix, can't repro, duplicate, stale Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants