justinbarclay / parinfer-rust-mode

Simplifying how you write Lisp
https://shaunlebron.github.io/parinfer/
GNU General Public License v3.0
227 stars 16 forks source link

Refuses to load on M1 Mac #57

Closed jsmesami closed 2 years ago

jsmesami commented 2 years ago

With parinfer-rust-auto-download t I get this error: Error (use-package): clojure-mode/:catch: Symbol’s function definition is void: parinfer-rust-version I suspected it downloads wrong binary for M1 architecture, so I cloned the sources and built it myself -> moved target/libparinfer_rust.dylib to ~/.emacs.d/parinfer-rust/parinfer-rust-darwin.so Now I get this error: Error (use-package): clojure-mode/:catch: Module is not GPL compatible: "/Users/ondra/.emacs.d/parinfer-rust/parinfer-rust-darwin.so" What can I do to make it work?

justinbarclay commented 2 years ago

Hey, unfortunately I can't be of much help. I don't have an m1 and therefore I don't have any experience building or integrating with an m1 version of Emacs and Github Actions does not have an easy way to build for m1.

Emacs does require a declaration that the plugin is GPL compatible: https://www.gnu.org/software/emacs/manual/html_node/elisp/Module-Initialization.html#index-compatibility_002c-between-modules-and-Emacs

Which exists here: https://github.com/eraserhd/parinfer-rust/blob/master/src/emacs_wrapper.rs#L11 So when you're compiling it should work.

I have noticed that the parinfer-rust library has now made emacs optional, when you were compiling did you turn on the emacs feature flag? cargo build --release --features emacs

jsmesami commented 2 years ago

Oh, I see. I missed the new --features emacs part. Thank you very much for your help!

telotortium commented 2 years ago

Hi, were you able to load the library successfully in Emacs on M1? I just submitted https://github.com/eraserhd/parinfer-rust/issues/119 because I'm not able to load it in my Emacs on M1.

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

Ignore the above comment - as I stated in eraserhd/parinfer-rust#119, I was using the wrong installation of Rust.