Giter Site home page Giter Site logo

Comments (6)

davidhewitt avatar davidhewitt commented on July 3, 2024

Sorry for the slow reply. Would you be willing to push your project with instructions as a minimal repro? I just tested on my M1 Mac and don't get crashes with pip install -e.

from setuptools-rust.

drdavella avatar drdavella commented on July 3, 2024

@davidhewitt no problem at all. Here's a package that minimally reproduces for me: https://github.com/drdavella/rust-extension. I'm installing from within that directory using pip install -e ..

Oddly, changing the number of println statements in the print_hello function seems to change the behavior on import. If I delete one of the statements the import works fine. This is all very strange to me and it's possible that I've just done something silly.

from setuptools-rust.

davidhewitt avatar davidhewitt commented on July 3, 2024

Definitely working fine for me. Here's the instructions I'm running:

conda create -n str-326 python=3.10
conda activate str-326
pip install -e .
python -c "import mypackage.bindings._corelib; mypackage.bindings._corelib.print_hello()"

I just get the expected prints, and can edit the statements and recompile with pip install -e again fine. What rust compiler are you using? Sounds more like a miscompilation than anything else.

from setuptools-rust.

drdavella avatar drdavella commented on July 3, 2024

It looks like I was using an older version of nightly from October, but even when I updated to latest (rustc 1.70.0-nightly (9df3a39fb 2023-04-11)) I have the same problem. Just as a sanity check, is there a way to verify which version is getting picked up by setuptools-rust? I don't see it in the output with pip -vv install -e .

from setuptools-rust.

drdavella avatar drdavella commented on July 3, 2024

Alright after a bit more investigation, it looks like this is a problem with System Integrity Protection on M1 and not a problem with setuptools-rust itself. I found the following crash report related to this process:

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGKILL (Code Signature Invalid))
Exception Codes:       UNKNOWN_0x32 at 0x00000001033e4000
Exception Codes:       0x0000000000000032, 0x00000001033e4000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Reason:    Namespace CODESIGNING, Code 2 

VM Region Info: 0x1033e4000 is in 0x1033e4000-0x1034ec000;  bytes after start: 0  bytes before end: 1081343
      REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      VM_ALLOCATE                 1032e4000-1033e4000    [ 1024K] rw-/rwx SM=PRV  
--->  mapped file                 1033e4000-1034ec000    [ 1056K] r--/rwx SM=COW  ...t_id=ced2d11d
      GAP OF 0x4b14000 BYTES
      MALLOC_MEDIUM               108000000-108800000    [ 8192K] rw-/rwx SM=PRV  

I was able to resolve the issue with the following command:

$ codesign --sign - src/mypackage/bindings/_corelib.abi3.so

I found a similar issue here nodejs/node#40827.

Just adding documentation in case anyone else encounters this issue. I'm not sure whether there's a way to address this on your end, but please feel free to close. Thanks for your help.

from setuptools-rust.

davidhewitt avatar davidhewitt commented on July 3, 2024

Ah, that makes sense. Thanks for sharing the solution here!

from setuptools-rust.

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.