Reputation: 1
Rust project(PyO3) was built successfully on my Mac, but error on CentOS6.
Cargo.toml
[package]
name = "pyutils"
version = "0.1.0"
edition = "2021"
[lib]
name = "pyutils"
crate-type = ["cdylib"]
[dependencies]
pyo3 = "0.20.0"
pyproject.toml
[build-system]
requires = ["maturin>=1.7,<2.0"]
build-backend = "maturin"
[project]
name = "pyutils"
requires-python = ">=3.8"
classifiers = [
"Programming Language :: Rust",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
dynamic = ["version"]
[tool.maturin]
features = ["pyo3/extension-module"]
CentOS release 6.10 (Final)
Linux version 3.10.0.514.26.2.el7.x86_64 ([email protected]) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC) ) #4 SMP Wed Aug 16 17:09:53 CST 2017
Linux 3.10.0.514.26.2.el7.x86_64 #4 SMP Wed Aug 16 17:09:53 CST 2017 x86_64 x86_64 x86_64 GNU/Linux
(py311) \[bae@test pyutils-rs\]$ maturin build -i python3.11
š Found pyo3 bindings
š Found CPython 3.11 at /home/bae/anaconda3/envs/py311/bin/python3.11
š” Using build options features from pyproject.toml
Compiling target-lexicon v0.12.16
Compiling ...
Compiling pyo3-ffi v0.20.3
Compiling pyo3 v0.20.3
Compiling pyo3-macros-backend v0.20.3
Compiling pyo3-macros v0.20.3
error\[E0463\]: can't find crate for `pyo3_macros`
\--\> /home/bae/.cargo/registry/src/rsproxy.cn-0dccff568467c15b/pyo3-0.20.3/src/prelude.rs:20:9
|
20 | pub use pyo3_macros::{pyclass, pyfunction, pymethods, pymodule, FromPyObject};
| ^^^^^^^^^^^ can't find crate
error\[E0463\]: can't find crate for `pyo3_macros`
\--\> /home/bae/.cargo/registry/src/rsproxy.cn-0dccff568467c15b/pyo3-0.20.3/src/lib.rs:444:9
|
444 | pub use pyo3_macros::{pyfunction, pymethods, pymodule, FromPyObject};
| ^^^^^^^^^^^ can't find crate
error\[E0463\]: can't find crate for `pyo3_macros`
\--\> /home/bae/.cargo/registry/src/rsproxy.cn-0dccff568467c15b/pyo3-0.20.3/src/lib.rs:455:9
|
455 | pub use pyo3_macros::pyclass;
| ^^^^^^^^^^^ can't find crate
error\[E0463\]: can't find crate for `indoc`
\--\> /home/bae/.cargo/registry/src/rsproxy.cn-0dccff568467c15b/pyo3-0.20.3/src/lib.rs:385:5
|
385 | indoc, // Re-exported for py_run
| ^^^^^ can't find crate
error\[E0432\]: unresolved imports `crate::FromPyObject`, `crate::FromPyObject`,
`crate::FromPyObject`, `crate::FromPyObject`, `crate::FromPyObject`, `crate::FromPyObject`, `crate::FromPyObject`, `crate::FromPyObject`, `crate::FromPyObject`, `crate::FromPyObject`, `crate::FromPyObject`, `crate::FromPyObject`, `crate::FromPyObject`, `crate::FromPyObject`, `crate::FromPyObject`, `crate::FromPyObject`, `crate::FromPyObject`, `crate::FromPyObject`
\--\> /home/bae/.cargo/registry/src/rsproxy.cn-0dccff568467c15b/pyo3-0.20.3/src/buffer.rs:21:50
|
21 | use crate::{err, exceptions::PyBufferError, ffi, FromPyObject, PyAny, PyResult, Python};
| ^^^^^^^^^^^^
|
::: /home/bae/.cargo/registry/src/rsproxy.cn-0dccff568467c15b/pyo3-0.20.3/src/conversions/std/array.rs:4:10
|
4 | ffi, FromPyObject, IntoPy, Py, PyAny, PyDowncastError, PyObject, PyResult, Python, ToPyObject,
| ^^^^^^^^^^^^
Some errors have detailed explanations: E0432, E0463.
For more information about an error, try `rustc --explain E0432`.
error: could not compile `pyo3` (lib) due to 5 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_ENVIRONMENT_SIGNATURE="cpython-3.11-64bit" PYO3_PYTHON="/home/bae/anaconda3/envs/py311/bin/python3.11" PYTHON_SYS_EXECUTABLE="/home/bae/anaconda3/envs/py311/bin/python3.11" "cargo" "rustc" "--features" "pyo3/extension-module" "--message-format" "json-render-diagnostics" "--manifest-path" "/home/bae/rust/baidu/personal-code/pyutils-rs/Cargo.toml" "--lib"`
I just created a new project use maturin new pyutils
, also build failed on CentOS6, success on my Mac
Upvotes: 0
Views: 114