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.
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,
Other additional info: Code.ensure_loaded(:dialyzer) resulting {:module, :dialyzer} on the first run, but return {:error, :nofile} later
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.
@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!
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.