ppraisethesun

ppraisethesun

Dialyzer in ElixirLS cannot access .beam files for core erlang code

For some reason dialyzer task in elixir-ls keeps crashing.

Macbook pro 13 m1 
Big Sur 11.2.2 (20D80)
VSCode      - February 2021 (version 1.54)
ElixirLS    - 0.6.5
elixir      - 1.11.3 (compiled with Erlang/OTP 23 from sources - ref:d30c5c0185607f08797441ab8af12636ad8dbd7e)
erlang      - 23.2.7
asdf        - v0.8.0-c6145d0
13:05:20.785 [error] Task #PID<0.122.0> started from #PID<0.121.0> terminating
** (stop) {:nocatch, {:dialyzer_error, 'Analysis failed with error:\nCould not scan the following file(s):\n  Could not get Core Erlang code for: /Users/roman/.asdf/installs/elixir/ref-d30c5c0185607f08797441ab8af12636ad8dbd7e/bin/../lib/mix/tmp/Mix.Tasks.ReleaseTest/test validates compile_env/_build/dev/rel/compile_env_config/lib/stdlib-3.13.2/ebin/zip.beam\n  Recompile with +debug_info or analyze starting from source code  Could not get Core Erlang code for: /Users/roman/.asdf/installs/elixir/ref-d30c5c0185607f08797441ab8af12636ad8dbd7e/bin/../lib/mix/tmp/Mix.Tasks.ReleaseTest/test validates compile_env/_build/dev/rel/compile_env_config/lib/stdlib-3.13.2/ebin/win32reg.beam\n  Recompile with +debug_info or analyze starting from source code  Could not get Core Erlang code for: /Users/roman/.asdf/installs/elixir/ref-d30c5c0185607f08797441ab8af12636ad8dbd7e/bin/../lib/mix/tmp/Mix.Tasks.ReleaseTest/test validates compile_env/_build/dev/rel/compile_env_config/lib/stdlib-3.13.2/ebin/uri_string.beam\n  Recompile with +debug_info or analyze starting from source code  Could not get Core Erlang code for: /Users/roman/.asdf/installs/elixir/ref-d30c5c0185607f08797441ab8af12636ad8dbd7e/bin/../lib/mix/tmp/Mix.Tasks.ReleaseTest/test validates compile_env/_build/dev/rel/compile_env_config/lib/stdlib-3.13.2/ebin/unicode_util.beam\n  Recompile with +debug_info or analyze starting from source code  Could not get Core Erlang code for: /Users/roman/.asdf/installs/elixir/ref-d30c5c0185607f08797441ab8af12636ad8dbd7e/bin/../lib/mix/tmp/Mix.Tasks.ReleaseTest/test validates compile_env/_build/dev/rel/compile_env_config/lib/stdlib-3.13.2/ebin/unicode.beam\n  Recompile with +debug_info or analyze starting from source code  Could not get Core Erlang code for: /Users/roman/.asdf/installs/elixir/ref-d30c5c0185607f08797441ab8af12636ad8dbd7e/bin/../lib/mix/tmp/Mix.Tasks.ReleaseTest/test validates compile_env/_build/dev/rel/compile_env_config/lib/stdlib-3.13.2/ebin/timer.beam\n  Recompile with +debug_info or analyze starting from source code  Could not get Core Erlang code for: /Users/roman/.asdf/installs/elixir/ref-d30c5c0185607f08797441ab8af12636ad8dbd7e/bin/../lib/mix/tmp/Mix.Tasks.ReleaseTest/test validates compile_env/_build/dev/rel/compile_env_config/lib/stdlib-3.13.2/ebin/sys.beam\n  Recompile with +debug_info or analyze starting from source code  Could not get Core Erlang code for: /Users/roman/.asdf/installs/elixir/ref-d30c5c0185607f08797441ab8af12636ad8dbd7e/bin/../lib/mix/tmp/Mix.Tasks.ReleaseTest/test validates compile_env/_build/dev/rel/compile_env_config/lib/stdlib-3.13.2/ebin/supervisor_bridge.beam\n  Recompile with +debug_info or analyze starting from source code  Could not get Core Erlang code for: /Users/roman/.asdf/installs/elixir/ref-d30c5c0185607f08797441ab8af12636ad8dbd7e/bin/../lib/mix/tmp/Mix.Tasks.ReleaseTest/test validates compile_env/_build/dev/rel/compile_env_config/lib/stdlib-3.13.2/ebin/supervisor.beam\n  Recompile with +debug_info or analyze starting from source code  Could not get Core Erlang code for: /Users/roman/.asdf/installs/elixir/ref-d30c5c0185607f08797441ab8af12636ad8dbd7e/bin/../lib/mix/tmp/Mix.Tasks.ReleaseTest/test validates compile_env/_build/dev/rel/compile_env_config/lib/stdlib-3.13.2/ebin/sofs.beam\n  Recompile with +debug_info or analyze starting from source code  Could not get Core Erlang code for: /Users/roman/.asdf/installs/elixir/ref-d30c5c0185607f08797441ab8af12636ad8dbd7e/bin/../lib/mix/tmp/Mix.Tasks.ReleaseTest/test validates compile_env/_build/dev/rel/compile_env_config/lib/stdlib-3.13.2/ebin/string.beam\n  Recompile with +debug_info or analyze starting from source code  Could not get Core Erlang code for: /Users/roman/.asdf/installs/elixir/ref-d30c5c0185607f08797441ab8af12636ad8dbd7e/bin/../lib/mix/tmp/Mix.Tasks.ReleaseTest/test validates compile_env/_build/dev/rel/compile_env_config/lib/stdlib-3.13.2/ebin/slave.beam\n  Recompile with +debug_info or analyze starting from source code  Could not get Core Erlang code for: /Users/roman/.asdf/installs/elixir/ref-d30c5c0185607f08797441ab8af12636ad8dbd7e/bin/../lib/mix/tmp/Mix.Tasks.ReleaseTest/test validate' ++ ...}}
    (dialyzer 4.3) dialyzer_cl.erl:699: :dialyzer_cl.cl_error/2
    (dialyzer 4.3) dialyzer_cl.erl:401: :dialyzer_cl.do_analysis/4
    (dialyzer 4.3) dialyzer.erl:160: :dialyzer.run/1
    (language_server 0.6.5) lib/language_server/dialyzer/manifest.ex:146: ElixirLS.LanguageServer.Dialyzer.Manifest.build_elixir_plt/0
    (language_server 0.6.5) lib/language_server/dialyzer/manifest.ex:14: anonymous fn/1 in ElixirLS.LanguageServer.Dialyzer.Manifest.build_new_manifest/0
    (elixir 1.11.3) lib/task/supervised.ex:90: Task.Supervised.invoke_mfa/2
    (stdlib 3.14) proc_lib.erl:226: :proc_lib.init_p_do_apply/3
Function: #Function<2.129723316/0 in ElixirLS.LanguageServer.Dialyzer.Manifest.build_new_manifest/0>
    Args: []

Deleting _build, deps, .elixir_ls directories did not help.
I tried compiling elixir with different erlang versions down to 23.0, but it did not seem to help.
If I run dialyzer manually it succeeds both in dev and test environments.
Switching to precompiled elixir 1.11.3 helps, but I lose the ability to go to the sources.

Does anyone else have this problem?

Most Liked

jsm

jsm

This issue seems to be related to temporary files created when building elixir from source. I’ve made a PR for asdf’s elixir plugin to fix this issue for elixir versions installed from source using asdf: Install from-sources elixir with `make DESTDIR=... install` by juulSme · Pull Request #99 · asdf-vm/asdf-elixir · GitHub.

heathen

heathen

Seems that I finally got it working: it works with Erlang 24.0-rc1 (installed via asdf install but effectively built from sources), Elixir 1.11.4-OTP-23 (asdf install precompiled) and vscode-elixir-ls rebuilt from sources. I also changed elixir-ls language server dialyxir dependency from “~> 1.0.0” to “~> 1.1.0” (elixir-ls/apps/language_server/mix.exs).

Started ElixirLS v0.6.5
Elixir version: "1.11.4 (compiled with Erlang/OTP 23)"
Erlang version: "24"
ElixirLS compiled with Elixir 1.11.4 and erlang 24
 ~/P/v/elixir-ls > elixir -v                                                                                                  
Erlang/OTP 24 [RELEASE CANDIDATE 1] [erts-12.0] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [jit]

Elixir 1.11.4 (compiled with Erlang/OTP 23)
 ~/P/v/elixir-ls >

Where Next?

Popular in Questions Top

pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
LegitStack
I’m hoping you guys can give me some general advice and perhaps code examples if you’re feeling up to it. I’m very interested in Elixir,...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
logicmason
Hi there, I'm working through my first release with elixir/phoenix. I've built a release with distillery and found that it crashes when I...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
makeitrein
Hey all, just started picking up Elixir last week and am writing a scraper as a learning project. Baby step #1 is extracting the number ...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID&lt;0.412.0&gt; terminating ** (Postgrex.Error) FATAL...
New
hpopp
To simplify some tasks at work, I wrote and published this package yesterday. It’s a simple macro that enables Access behaviour on struct...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers' Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New

Other popular topics Top

shahryarjb
Hello, I get Persian date from my client and convert it to normal calendar like this: def jalali_string_to_miladi_english_number(persi...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
Tee
can someone please explain to me how Enum.reduce works with maps
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod -- where is this set? Thanks.
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list....
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 42633 214
New
josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New

We're in Beta

About us Mission Statement