Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

build-backend - build-wheel - interpreter path - when cross-compiling, got path to interpreter #1985

Closed
1 of 2 tasks
justai-net opened this issue Mar 8, 2024 · 1 comment

Comments

@justai-net
Copy link

justai-net commented Mar 8, 2024

Bug Description

Hey all,
Attempting to use the build-backend to build wheels with cross-compile.

The command here, seems to pass sys.executable,

sys.executable,

which passes the full path of the executable here

if std::path::Path::new(&python).is_file() {

#pyproject.toml
[build-system]
requires = ["maturin==1.5"]
build-backend = "maturin"
CARGO_BUILD_TARGET=x86_64-pc-windows-msvc maturin pep517 build-wheel -i ~/.pyenv/versions/pypy3.9-7.3.15/bin/pypy3.9
🔗 Found pyo3 bindings
💥 maturin failed
  Caused by: Python interpreter should be a kind of interpreter (e.g. 'python3.8' or 'pypy3.9') when cross-compiling, got path to interpreter: /home/user/.pyenv/versions/pypy3.9-7.3.15/bin/pypy3.9

I'm able to run the following, without any issues, though would like to be able to build with build-backend.

CARGO_BUILD_TARGET=x86_64-pc-windows-msvc maturin pep517 build-wheel -i pypy3.9

Are there any other options available?

Your maturin version (maturin --version)

1.5.0

Your Python version (python -V)

python 3.9.18

Your pip version (pip -V)

pip 23.0.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

❯ RUST_LOG=maturin=debug CARGO_BUILD_TARGET=x86_64-pc-windows-msvc maturin pep517 build-wheel -i ~/.pyenv/versions/pypy3.9-7.3.15/bin/pypy3.9
2024-03-07T23:43:06.149143Z DEBUG maturin::project_layout: Found pyproject.toml in working directory at "/home/user8/projects/svcs.com/group99/repo_beta/lib/my_lib/pyproject.toml"
2024-03-07T23:43:06.149265Z DEBUG maturin::project_layout: Using cargo manifest path from working directory: "/home/user8/projects/svcs.com/group99/repo_beta/lib/my_lib/Cargo.toml"
2024-03-07T23:43:06.149378Z DEBUG maturin::project_layout: Resolving cargo metadata from "/home/user8/projects/svcs.com/group99/repo_beta/lib/my_lib/Cargo.toml"
2024-03-07T23:43:06.243227Z DEBUG maturin::project_layout: Project layout resolved project_root=/home/user8/projects/svcs.com/group99/repo_beta/lib/my_lib python_dir=/home/user8/projects/svcs.com/group99/repo_beta/lib/my_lib rust_module=/home/user8/projects/svcs.com/group99/repo_beta/lib/my_lib/my_lib python_module=/home/user8/projects/svcs.com/group99/repo_beta/lib/my_lib/my_lib extension_name=my_lib module_name=my_lib
🔗 Found pyo3 bindings
2024-03-07T23:43:06.324216Z DEBUG maturin::python_interpreter: Found PyPy interpreter at /home/user8/.pyenv/versions/pypy3.9-7.3.15/bin/pypy3.9
💥 maturin failed
  Caused by: Python interpreter should be a kind of interpreter (e.g. 'python3.8' or 'pypy3.9') when cross-public_html_generating, got path to interpreter: /home/user8/.pyenv/versions/pypy3.9-7.3.15/bin/pypy3.9
@justai-net justai-net added the bug Something isn't working label Mar 8, 2024
@messense
Copy link
Member

messense commented Mar 8, 2024

maturin pep517 build-wheel is not intended to be used outside of pip install, use maturin build instead.

For cross compilation, refer to the docs:

@messense messense closed this as completed Mar 8, 2024
@messense messense removed the bug Something isn't working label Mar 8, 2024
@PyO3 PyO3 locked and limited conversation to collaborators Mar 8, 2024
@messense messense converted this issue into discussion #1986 Mar 8, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants