Elixir v1.15.0-rc.0 released

It appears to not be planned for a particular release—per this discussion there are still kinks to work out in the implementation.

2 Likes

You will need to include them as dependencies. Maybe only in test or a specific environment you run Dialyzer on. We no longer allow unlisted dependencies because that has been historically a source of bugs in releases.

1 Like

That’s really sad. Now my code will be a mess of GenServer and :gen_server instead of one module :frowning:

1 Like

There is an on-going issue with compiling Rebar 3 dependencies on Erlang/OTP 26 on Windows: Both 1.14.5 and 1.15.0-rc0 with OTP-26 compilation hang on Windows · Issue #12589 · elixir-lang/elixir · GitHub

1 Like

Thanks José but I confess to being a bit confused now.

  • I think this means each consumer of a library will need to manually configure all optional transitive deps when they run dialyzer on their own code?
  • if that’s the correct understanding, I don’t think there is a way to introspect to know what those would be in advance? I think it would be helpful to have a function that can return a deps list for them.
  • As a library writer I don’t spend much time on releases. So I’m a bit confused about how requiring configuration of optional transitive deps for dialyzer is related to issues with releases. Can you explain a bit more? Is there something my libs should be doing to make this easier for consumers?
4 Likes

I think we need to flip the question around: why do you need the optional dependencies of a dependency in order to run Dialyzer? Dialyzing dependency “foo” should work even if “foo” is missing its optional dependencies.

Actually, as I was typing this response, I have just realized that the mistake can be elsewhere. Erlang/OTP 24 introduces a field called optional_applications to the .app file. Elixir v1.15 starts using this field. Imagine you have this dependency tree:

  • foo
    • gettext (optional)

In earlier Elixir versions, foo.app would look like this if gettext was not added as dependency somewhere:

{applications, []}

But now it looks like this:

{optional_applications, [gettext]}
{applications, [gettext]}

In other words, gettext is now always included as a dependency but you are not supposed to require it if it is listed as an optional application. Reading back your messages, it seems either Dialyzer or Dialyxir is requiring optional applications to be defined.

Yes, so this is a dialyxir “bug”:

When they traverse dependencies, they need to include the parent’s optional applications and not log an error if the dependency you cannot load is optional. But, from looking at the code, the warning causes no harm either.

5 Likes

José, thanks for saving my sanity. I will open an issue on dialyxir (if there isn’t one already).

Update: Issue opened.

3 Likes

Yeah, that was partially my fault, sorry. :slight_smile: I thought it was related to the code paths change but it took a while for me to realize it wasn’t. Have a great weekend!

2 Likes

I have hit this issue with ssl_verify_fun and as it’s a dependency in
Hackney.

#3 worked for me in terms of resolving it however I don’t fully understand the issue and that bothers me. I don’t code in elixir day in day out and thankfully the prune_code_paths was an option as it is not a production system. Can you help me understand and maybe some signposting about what needs to happen to resolve this issue so I can maybe look at contributing.

Thanks for any help.

For ssl_verify_fun you can also add this to your mix.exs:

{:ssl_verify_fun, ">= 0.0.0", manager: :rebar3}

to compile it with rebar3. I already sent a PR for this case, so nothing to do besides wait for it to be merged and released: Include application specification for mix.exs by josevalim · Pull Request #27 · deadtrickster/ssl_verify_fun.erl · GitHub

2 Likes

sorry, posted to old thread… moving it.

Thanks for that, after upgrade to Elixir 1.15 with erlang 26.0.1 we got same errors.

There is already v1.15.1 and v1.15.2 (with fix for Windows issue). Erlang team also released version 26.0.2.

Its a dialyixir issue, not an Elixir or erlang one.

2 Likes