adoptoposs / mjml_nif

Elixir NIF bindings for the MJML Rust implementation (mrml)
https://hexdocs.pm/mjml
MIT License
122 stars 17 forks source link

Segmentation fault while compiling mjml #88

Closed alejandrodevs closed 1 year ago

alejandrodevs commented 1 year ago

I am receiving the following error while mjml is compiling:

==> mjml
Compiling 3 files (.ex)

16:35:16.938 [debug] Copying NIF from cache and extracting to /APP_PATH/_build/dev/lib/mjml/priv/native/libmjml_nif-v1.5.0-nif-2.15-x86_64-apple-darwin.so
zsh: segmentation fault  mix phx.server

I'm using a Mac with M1 (Arm64). Elixir 1.14.3 Erlang 23.3.4.11

Do you know how can I tackle this? Maybe a missing package/dependency in my computer?

paulgoetze commented 1 year ago

Hey @alejandrodevs, thanks for opening the issue.

I'm not entrirely sure what might cause this segmentation fault - I found this issue for Rustler: https://github.com/rusterlium/rustler/issues/93, where the compiler order was crucial. But I guess this might not apply for you, unless you explicitly have :rustler in your list of compilers config.

Another problem might be the Erlang/OTP version. I recently removed OTP 23 from the GitHub action test matrix for this project (https://github.com/adoptoposs/mjml_nif/commit/b173314283ac6a6643f97b62eee149b8d8c14ed7), so I'm not sure if it the Elixir/OTP you use should work without any issues.

Is it possible for you to update to Erlang/OTP 24 or 25 and see of that would solve the problem for you?

alejandrodevs commented 1 year ago

I reseted my Mac to get a fresh OS installation and it works correctly. Possibly because I was using Rosetta in the terminal when I set up my computer because of some incompatibilities at that time.

Thanks for you quickly response @paulgoetze

paulgoetze commented 1 year ago

I reseted my Mac to get a fresh OS installation and it works correctly. Possibly because I was using Rosetta in the terminal when I set up my computer because of some incompatibilities at that time.

Thanks for you quickly response @paulgoetze

:+1: Alright, thanks for checking. Glad that it works now.