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

Support for Erlang 22 #227

Closed
spkane31 opened this issue Jul 12, 2019 · 8 comments
Closed

Support for Erlang 22 #227

spkane31 opened this issue Jul 12, 2019 · 8 comments

Comments

@spkane31
Copy link

There was an issue closed about this but I am having similar issues. I added rustler to my dependencies, added the module in my lib/ folder, added the compiler, and added the rustler_crates, but when I try to test the add function from an interactive session I have errors.

For reference here is my latest commit with my rust additions:
https://github.com/spkane31/cc-rankings/compare/rustler

And here is what I did for the interactive session:

iex(1)> alias Rankings.RustNif
Rankings.RustNif
iex(2)> Rankings.RustNif.add(1,2)
[warn] The on_load function for module Elixir.Rankings.RustNif returned:
{:error, {:load_failed, 'Failed to load NIF library: \'/home/sean/github/cc-rankings/rankings/_build/dev/lib/rankings/priv/native/librustnif.so: cannot open shared object file: No such file or directory\''}}

** (UndefinedFunctionError) function Rankings.RustNif.add/2 is undefined (module Rankings.RustNif is not available)
    (rankings) Rankings.RustNif.add(1, 2)
[warn] The on_load function for module Elixir.Rankings.RustNif returned:
{:error, {:load_failed, 'Failed to load NIF library: \'/home/sean/github/cc-rankings/rankings/_build/dev/lib/rankings/priv/native/librustnif.so: cannot open shared object file: No such file or directory\''}}

@NobbZ
Copy link
Contributor

NobbZ commented Jul 13, 2019

0.16.0 is from february 2018, this version will never be able to support this years OTP version.

Please update to a more recent version of rustler.

@spkane31
Copy link
Author

@NobbZ I changed to rustler 0.20.0 (silly mistake on my part) but it still will not run properly. Now I can't get the interactive terminal to load because of the error.
Link to the branch I'm working on:
https://github.com/spkane31/cc-rankings/compare/rustler

Error I get:

16:13:52.619 [error] Process #PID<0.202.0> raised an exception
** (Protocol.UndefinedError) protocol String.Chars not implemented for {:error, :bad_name}
    (elixir) lib/string/chars.ex:3: String.Chars.impl_for!/1
    (elixir) lib/string/chars.ex:22: String.Chars.to_string/1
    lib/rustler.ex:80: Rustler.compile_config/2
    lib/rankings/rustler.ex:2: Nifty.__init__/0
    (kernel) code_server.erl:1340: anonymous fn/1 in :code_server.handle_on_load/5
 
16:13:52.624 [warn]  The on_load function for module Elixir.Nifty returned: 
{%Protocol.UndefinedError{description: "", protocol: String.Chars, value: {:error, :bad_name}}, [{String.Chars, :impl_for!, 1, [file: 'lib/string/chars.ex', line: 3]}, {String.Chars, :to_string, 1, [file: 'lib/string/chars.ex', line: 22]}, {Rustler, :compile_config, 2, [file: 'lib/rustler.ex', ...]}, {Nifty, :__init__, 0, [...]}, {:code_server, :"-handle_on_load/5-fun-0-", 1, ...}]}

Compiling NIF crate :niftest (native/niftest)...
   Compiling erlang_nif-sys v0.6.4
   Compiling backtrace-sys v0.1.30
   Compiling quote v0.6.13
error: failed to run custom build command for `erlang_nif-sys v0.6.4`

Caused by:
  process didn't exit successfully: `/home/sean/github/cc-rankings/rankings/_build/dev/rustler_crates/niftest/debug/build/erlang_nif-sys-ec04123539aeff43/build-script-build` (exit code: 101)
--- stdout
Unsupported Erlang version.

Is the erlang_nif-sys version up to date in the Cargo.toml?
Does 'cargo update' fix it?
If not please report at https://github.com/goertzenator/erlang_nif-sys.```

@NobbZ
Copy link
Contributor

NobbZ commented Jul 14, 2019

Yeah, now your rustler is up to date, but its dependency is not yet able to talk with current OTP, see:

rusterlium/erlang_nif-sys#37 and rusterlium/erlang_nif-sys#38

@filmor
Copy link
Member

filmor commented Jul 17, 2019

The support for Erlang 22 was merged into master, try to reference that instead until a release has been cut.

@ericlathrop
Copy link
Contributor

ericlathrop commented Jul 24, 2019

Is there an ETA of when a version with Erlang 22 support will be released? A library I use doesn't want to have a dependency pointed at master.

@nyo16
Copy link

nyo16 commented Aug 23, 2019

Hi, any estimate for the new release?

@mischov
Copy link
Contributor

mischov commented Sep 2, 2019

@hansihe @scrogson Is there a checklist of things that need to be taken care of before a new release? Is there any way people can help?

@hansihe
Copy link
Member

hansihe commented Sep 7, 2019

Rustler 0.21.0 has been released. This release includes support for OTP-22.

@hansihe hansihe closed this as completed Sep 7, 2019
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

7 participants