-
-
Notifications
You must be signed in to change notification settings - Fork 271
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
python -m maturin develop
doesn't have non-zero exit code on Windows
#2048
Comments
I'm unable to reproduce this on macOS. $ python -m maturin develop
Updating crates.io index
🔗 Found pyo3 bindings
🐍 Found CPython 3.12 at /Users/messense/.pyenv/versions/3.12.0/envs/test/bin/python
📡 Using build options features from pyproject.toml
Blocking waiting for file lock on package cache
Blocking waiting for file lock on package cache
Blocking waiting for file lock on package cache
Compiling target-lexicon v0.12.14
Compiling once_cell v1.19.0
Compiling autocfg v1.2.0
Compiling proc-macro2 v1.0.81
Compiling unicode-ident v1.0.12
Compiling libc v0.2.153
Compiling parking_lot_core v0.9.9
Compiling portable-atomic v1.6.0
Compiling heck v0.4.1
Compiling scopeguard v1.2.0
Compiling smallvec v1.13.2
Compiling cfg-if v1.0.0
Compiling unindent v0.2.3
Compiling indoc v2.0.5
Compiling lock_api v0.4.11
Compiling memoffset v0.9.1
Compiling pyo3-build-config v0.20.3
Compiling quote v1.0.36
Compiling syn v2.0.60
Compiling parking_lot v0.12.1
Compiling pyo3-ffi v0.20.3
Compiling pyo3 v0.20.3
Compiling pyo3-macros-backend v0.20.3
Compiling pyo3-macros v0.20.3
Compiling hello v0.1.0 (/Users/messense/Projects/maturin/hello)
error[E0308]: mismatched types
--> src/lib.rs:5:41
|
5 | fn sum_as_string(a: usize, b: usize) -> PyResult<String> {}
| ------------- ^^^^^^^^^^^^^^^^ expected `Result<String, PyErr>`, found `()`
| |
| implicitly returns `()` as its body has no tail or `return` expression
|
= note: expected enum `Result<String, PyErr>`
found unit type `()`
For more information about this error, try `rustc --explain E0308`.
error: could not compile `hello` (lib) due to 1 previous error
💥 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.12-64bit" PYO3_PYTHON="/Users/messense/.pyenv/versions/3.12.0/envs/test/bin/python" PYTHON_SYS_EXECUTABLE="/Users/messense/.pyenv/versions/3.12.0/envs/test/bin/python" "cargo" "rustc" "--features" "pyo3/extension-module" "--message-format" "json-render-diagnostics" "--manifest-path" "/Users/messense/Projects/maturin/hello/Cargo.toml" "--lib" "--" "-C" "link-arg=-undefined" "-C" "link-arg=dynamic_lookup" "-C" "link-args=-Wl,-install_name,@rpath/hello.cpython-312-darwin.so"`
$ echo $?
1 |
We are using os.execv to replace |
|
it's a cpython bug on windows |
I don't have a windows machine near me, so pull requests are welcome if you want to contribute a fix for Windows. |
python -m maturin develop
doesn't have non-zero exit codepython -m maturin develop
doesn't have non-zero exit code on Windows
I've changed the title to reflect the fact it's a Windows specific issue. |
Bug Description
I'm using
python -m maturin
to run maturin, but whenmaturin develop
exit with code 1,python -m maturin develop
always exit with code 0.Your maturin version (
maturin --version
)maturin 1.5.1
Your Python version (
python -V
)Python 3.11.9
Your pip version (
pip -V
)pip 24.0
What bindings you're using
None
Does
cargo build
work?If on windows, have you checked that you aren't accidentally using unix path (those with the forward slash
/
)?Steps to Reproduce
create repo
make repo unbuildable, for example syntax error in lib.rs
run `python -m
The text was updated successfully, but these errors were encountered: