Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to compile with "elixir 1.15.7" & "erlang 26.1.2" #30

Open
adrianbrink opened this issue Nov 10, 2023 · 0 comments
Open

Unable to compile with "elixir 1.15.7" & "erlang 26.1.2" #30

adrianbrink opened this issue Nov 10, 2023 · 0 comments

Comments

@adrianbrink
Copy link

OS: Darwin two 23.1.0 Darwin Kernel Version 23.1.0: Mon Oct 9 21:28:45 PDT 2023; root:xnu-10002.41.9~6/RELEASE_ARM64_T6020 arm64
Elixir: elixir 1.15.7
Erlang/OTP: 26.1.2

Command:

git clone https://github.com/discord/sorted_set_nif.git && cd sorted_set_nif
mix deps.get
mix compile

Actual Output:

warning: use Mix.Config is deprecated. Use the Config module instead
  config/config.exs:1

Compiling 3 files (.ex)
Compiling crate sorted_set_nif in debug mode (native/sorted_set_nif)

Compiling on macOS requires special link args in order to compile
correctly.

Rustler is currently working around this issue in the compiler task.
This will be removed in v1.0.0 in favor of a user supplied .cargo/config
file.

To remove this warning, please create /Users/xxx/sorted_set_nif/native/sorted_set_nif/.cargo/config
with the following content:

      [target.x86_64-apple-darwin]
      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.


   Compiling libc v0.2.150
   Compiling proc-macro2 v1.0.69
   Compiling proc-macro-hack v0.5.20+deprecated
   Compiling unicode-ident v1.0.12
   Compiling fs_extra v1.3.0
   Compiling syn v1.0.109
   Compiling void v1.0.2
   Compiling rustler_sys v2.1.1
   Compiling unicode-segmentation v1.10.1
   Compiling rustler v0.22.2
   Compiling lazy_static v1.4.0
   Compiling unreachable v1.0.0
   Compiling heck v0.3.3
   Compiling paste-impl v0.1.18
   Compiling quote v1.0.33
   Compiling cc v1.0.83
   Compiling paste v0.1.18
   Compiling jemalloc-sys v0.3.2
   Compiling rustler_codegen v0.22.2
error: failed to run custom build command for `rustler v0.22.2`

Caused by:
  process didn't exit successfully: `/User/xxx/sorted_set_nif/_build/dev/lib/sorted_set_nif/native/sorted_set_nif/debug/build/rustler-f511909f2d5940db/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at /Users/xxx/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rustler-0.22.2/build.rs:37:13:
  Erlang version 2.17 not handled, please file a a bug report.
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
Compiling lib/sorted_set/nif_bridge.ex (it's taking more than 10s)

== Compilation error in file lib/sorted_set/nif_bridge.ex ==
** (RuntimeError) Rust NIF compile error (rustc exit code 101)
    (rustler 0.22.0) lib/rustler/compiler.ex:36: Rustler.Compiler.compile_crate/2
    lib/sorted_set/nif_bridge.ex:13: (module)

Expected Output:

Compilation succeeds.

Thoughts:
It is probably linked to the supported version of Erlang as described here in the Rustler readme. However I don't know how to fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant