eraserhd / parinfer-rust

A Rust port of parinfer.
ISC License
546 stars 42 forks source link

Emacs crashes when .so loaded on M1 #119

Closed telotortium closed 2 years ago

telotortium commented 2 years ago

There seems to be no release version for M1 macOS, so I attempted to compile the library using cargo build --release --features emacs. However, when I copy it to the location of parinfer-rust-library (basename parinfer-rust-darwin.so) from parinfer-rust-mode and run M-x parinfer-rust-mode, Emacs segfaults, presumably as it's loading the .so.

Encountered at commit 211f72e32cccbc728a8346f665c0a0b52c01c1e4 (current master) .

Tagging @nwjsmith because he submitted #95 to enable the support in the first place (although maybe not for Emacs).

M-x emacs-version: GNU Emacs 29.0.50 (build 1, aarch64-apple-darwin21.2.0, NS appkit-2113.20 Version 12.1 (Build 21C52)) of 2022-01-12

telotortium commented 2 years ago

I have nativecomp, which requires gcc, but Rust uses LLVM, maybe that's the issue? On the other hand, on my Intel x86_64 Mac, I'm able to load the released library from Github, even though I use nativecomp there too.

telotortium commented 2 years ago

This happened because I tried to use the cargo and rustc installed by Macports. Once I used Rustup to install a toolchain, I was able to build a copy that worked in Emacs.

jesse-c commented 2 years ago

I'm having a similar issue. Which toolchain did you use from within rustup? I'm currently on stable-aarch64-apple-darwin.

telotortium commented 2 years ago

@jesse-c I think I used that toolchain too