paritytech / libsecp256k1

Pure Rust Implementation of secp256k1.
Apache License 2.0
172 stars 84 forks source link

The Compilation In Mac M1 is Failing because some missing config after updating rustler to 0.24 0r 0.25 #119

Open edwardcashmere opened 2 years ago

edwardcashmere commented 2 years ago

==> ex_secp256k1 Compiling 1 file (.ex) Compiling crate exsecp256k1 in release mode (native/exsecp256k1)

== Compilation error in file lib/ex_secp256k1.ex == ** (RuntimeError) Compiling on macOS requires special link args in order to compile correctly.

To remove this error, please create .cargo/config with the following content:

   [target.'cfg(target_os = "macos")']
   rustflags = [
       "-C", "link-arg=-undefined",
       "-C", "link-arg=dynamic_lookup",
   ]

See https://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/MachOTopics/1-Articles/executing_files.html for more details.

(rustler 0.25.0) lib/rustler/compiler.ex:100: Rustler.Compiler.ensure_platform_requirements!/3
(rustler 0.25.0) lib/rustler/compiler.ex:25: Rustler.Compiler.compile_crate/2