Elixir v1.15.0 released

I’m seeing this error when running dialyzer with Dialyzer v5.1 Elixir 1.15 OTP 26

** (UndefinedFunctionError) function Dialyxir.Output.info/1 is undefined (module Dialyxir.Output is not available)
    (dialyxir 1.3.0) Dialyxir.Output.info("Finding suitable PLTs")
    (dialyxir 1.3.0) lib/mix/tasks/dialyzer.ex:172: Mix.Tasks.Dialyzer.run/1
    (mix 1.15.0) lib/mix/task.ex:447: anonymous fn/3 in Mix.Task.run_task/5
    (mix 1.15.0) lib/mix/cli.ex:92: Mix.CLI.run_task/2

I guess that means Dialyxir isn’t fully loaded? This was working with Elixir v1.14.

1 Like

I also have issue with Dialyxir/Dialyzer.
It is that mix dialyzer will only successful on the first run after clean build.
If I run for the second time and later, it will resulting “DEPENDENCY MISSING” error.
The only chance it’ll suceed if I delete _build/#{ENV}/lib/dialyxir folder

I’ve checked Dialyxir source code on this line seems to be the source of the error. It was failed when calling Code.ensure_loaded?(:dialyzer)

I’ve tried to find workaround with adding Application.ensure_loaded/1, Application.ensure_started/1, and Code.ensure_compiled/1 on the beginning of the mix task run, none of them works.

EDIT: It works with adding the new Mix.ensure_application!/1. I’m not sure if it is correct solution since it’s new function introduced in 1.15.0, we need to check system/Elixir version first.

How are you folks defining dialyxir as a dependency in your mix.exs and how are you running it? I cannot reproduce this in a sample project.

on mix.exs

   {:dialyxir, "~> 1.3", only: [:dev, :test], runtime: false},

on mix.lock

  "dialyxir": {:hex, :dialyxir, "1.3.0", "fd1672f0922b7648ff9ce7b1b26fcf0ef56dda964a459892ad15f6b4410b5284", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "00b2a4bcd6aa8db9dcb0b38c1225b7277dca9bc370b6438715667071a304696f"},

run with mix dialyzer

For additional info, the project where dialyxir was failed is quite big. I tried on my small projects, it is not reproducible, mix dialyzer works perfectly, :sweat:

Other additional info:
Code.ensure_loaded(:dialyzer) resulting {:module, :dialyzer} on the first run, but return {:error, :nofile} later

Is it an umbrella project or a regular one?

regular one

while my small project will print out Adding 596 modules to dialyxir_erlang... this one prints Adding 2914 modules to dialyxir_erlang-

I think the issue is on the OTP side, since it’s evaluated :code.ensure_loaded(:dialyzer)

I’m running it in an umbrella project.

mix.exs:

{:dialyxir, "~> 1.0", only: [:dev, :test], runtime: false},

mix.lock

"dialyxir": {:hex, :dialyxir, "1.3.0" ... }

We run dialyzer in a variety of ways and they all produce the same error but the primary way we call it is mix dialyzer.build and then mix dialyzer --format dialyxir.

I first thought it was just something wrong with versions on my machine because of this GH thread but then the exact same error appeared on CI so it makes me think something else is going on.

[app] start_iex no longer works for releases under OTP 26, as werl.ex is no more

C:\Paperless\pca\bin
λ pca start_iex
The system cannot find the file C:\Paperless\pca\releases\0.2.0\\..\..\erts-14.0.1\bin\werl.exe.

@CharlesO can you please access the .bat files on the bin directory and simply remove all “–werl” instances and let me know if it works? You don’t need to do anything else, just remove those 6 characters whenever they appear. Thanks!

1 Like

this works

1 Like

Thank you, it will be fixed in the next release then!

1 Like

Please Note: I was testing Elixir 1.14.5, not 1.15.0

Hi!

First of all, thanks for the release.

I tried to use the module observer with the Elixir 1.15.0-otp-26 and Erlang 26.0.1 but I received the error below:

Erlang/OTP 25 [erts-13.2.2.1] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1] [jit]

Compiling 6 files (.ex)
Generated todo app
Interactive Elixir (1.15.0) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> :observer.start()
** (UndefinedFunctionError) function :observer.start/0 is undefined (module :observer is not available)
    :observer.start()
    iex:1: (file)

When I changed to Elixir version 1.14.5-otp-26 and the same version, it worked

What could it be?

Thanks again!

You must either:

  1. List :observer under extra_applications in your mix.exs
  2. Tell Mix to make the application available to you by calling Mix.ensure_application!(:observer)

Sorry, but I forgot to mention that I tried this approach.

I received the error below:

iex(1)> :observer.start()
** (UndefinedFunctionError) function :wx_object.start/3 is undefined (module :wx_object is not available)
    :wx_object.start(:observer_wx, [], [])
    (observer 2.15) observer_wx.erl:70: :observer_wx.start/0
    iex:1: (file)

I’m using a macbook m1 pro. I’ll share the my ASDF env values.

export KERL_CONFIGURE_OPTIONS="--without-javac --with-ssl=$(brew --prefix openssl@1.1)"
export KERL_BUILD_DOCS=yes
export KERL_INSTALL_HTMLDOCS=no
export KERL_INSTALL_MANPAGES=no
export ELIXIR_ERL_OPTIONS="-kernel shell_history enabled"
export PATH=$PATH:/Users/lucas/.asdf/shims
export LDFLAGS="-L/opt/homebrew/opt/libxslt/lib"
export CPPFLAGS="-I/opt/homebrew/opt/libxslt/include"

Good catch. Apparently Observer does not declare its dependencies on wx and runtime_tools, so they need to be added manually:

Mix.ensure_application!(:runtime_tools)
Mix.ensure_application!(:wx)

I will inquire the Erlang/OTP team why that’s the case.

3 Likes

It worked. Thanks a lot!

First off, thanks for another version of Elixir. Good job everyone involved!

I am seeing a strange problem since I started using Elixir 1.15. Once in a while, compilations fails with the following error:

** (File.Error) could not read file "native/csv_exporter/src": illegal operation on a directory
    (elixir 1.15.0) lib/file.ex:358: File.read!/1
    (mix 1.15.0) lib/mix/compilers/elixir.ex:441: Mix.Compilers.Elixir.digest_file!/1
    (mix 1.15.0) lib/mix/compilers/elixir.ex:426: Mix.Compilers.Elixir.stale_external?/3
    (elixir 1.15.0) lib/enum.ex:4190: Enum.predicate_list/3
    (mix 1.15.0) lib/mix/compilers/elixir.ex:394: anonymous fn/6 in Mix.Compilers.Elixir.compiler_info_from_updated/9
    (elixir 1.15.0) lib/enum.ex:2510: Enum."-reduce/3-lists^foldl/2-0-"/3
    (mix 1.15.0) lib/mix/compilers/elixir.ex:385: Mix.Compilers.Elixir.compiler_info_from_updated/9
    (mix 1.15.0) lib/mix/compilers/elixir.ex:134: Mix.Compilers.Elixir.compile/7

I really have no clue how to reproduce it, but I have a suspicion of what the problem is: We use Rustler to build csv_exporter. As far as I can see, Rustler will include directories as external resources. I guess this causes some issues with the digest calculation. What I don’t understand is why it doesn’t fail every time.
Currently, I am using a custom version of Rustler, where directories are removed from the external resources. Seems to be working, but it would be good to verify that this is the likely root-cause.

It seems to be a race condition. We check those files exist before but they are being deleted after milliseconds of checked for their existence. I pushed a fix to Elixir to not assume the external resource and also a PR to Rustler.

1 Like