Comments (6)
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.
@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.
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.
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.
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.
Ah, that makes sense. Thanks for sharing the solution here!
from setuptools-rust.
Related Issues (20)
- 1.5.x sdist no longer contains examples, docs, and tests HOT 5
- build fails with "error: Rust build failed; unable to find any build artifacts" HOT 6
- Is there a way to trigger `release` target build for `build_ext --inplace` command? HOT 3
- setuptools-rust fails to cross-compile cryptography using crossenv HOT 10
- Failed to build on MacOs 13.0.1,setuptools_rust HOT 1
- can I build an `.so` without the target between the module name and the extension? HOT 2
- Setuptools deprecation warning with setuptools-rust HOT 4
- Facing an issue while trying to build setuptools-rust HOT 3
- Compilation in setuptools_rust fails with `1.70.0-nightly` toolchain HOT 3
- Unable to control `--debug` / `--release` via PEP517 backend HOT 7
- No module named 'setuptools.command.build' HOT 2
- Document how to use setuptools-rust with a workspace HOT 2
- Scaling PyO3 down with single-file Python extensions HOT 7
- DeprecationWarning: pkg_resources is deprecated as an API
- Allow offline mode via environment variable HOT 7
- `install_extension` crashes due to attempt to mkdir an empty path (v1.8.0)
- With latest nightly rust, builds failing due to changes in cargo output HOT 6
- Trouble using pyproject.toml for limited api HOT 8
- Please update PyO3 to 0.20.3 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from setuptools-rust.