Git Product home page Git Product logo

Comments (6)

messense avatar messense commented on July 28, 2024

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

from maturin.

messense avatar messense commented on July 28, 2024

We are using os.execv to replace python -m maturin process with maturin so it's unlikely the exit code will differ.

from maturin.

trim21 avatar trim21 commented on July 28, 2024
(.venv) ❯❯ ~\..\bencode2 git:(perf) python -m maturin q
(.venv) error: unrecognized subcommand 'q'

Usage: maturin <COMMAND>

For more information, try '--help'.
❯❯ ~\..\bencode2 git:(perf) echo $LastExitCode
0
(.venv) ❯❯ ~\..\bencode2 git:(perf) maturin q
error: unrecognized subcommand 'q'

Usage: maturin.exe <COMMAND>

For more information, try '--help'.
(.venv) ❯❯ ~\..\bencode2 git:(perf) echo $LastExitCode
2
(.venv) ❯❯ ~\..\bencode2 git:(perf)

from maturin.

trim21 avatar trim21 commented on July 28, 2024

We are using os.execv to replace python -m maturin process with maturin so it's unlikely the exit code will differ.

it's a cpython bug on windows

python/cpython#63323

from maturin.

messense avatar messense commented on July 28, 2024

I don't have a windows machine near me, so pull requests are welcome if you want to contribute a fix for Windows.

from maturin.

messense avatar messense commented on July 28, 2024

I've changed the title to reflect the fact it's a Windows specific issue.

from maturin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.