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?

First Post! Switch mode

heathen

heathen

Yes, I have the same 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?

Trending in Questions Top

jonnycharles
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
silverdr
Using Phoenix.LiveView.TagEngine as an EEx.Engine is deprecated! To compile HEEx, use Phoenix.LiveView.TagEngine.compile/2 instead. Sta...
New
saveman71
Hello ! We want new/edit form pages to POST/PUT to their own URL rather than the resources REST defaults (post /things, put /things/:id)...
New
dli
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app? Looking for hints regarding: Addi...
New
bottlenecked
Hi all, I wanted to ask how the community is dealing with post-release steps. Today we have Ecto migrations, which make sure that the db...
New
michallepicki
I am using Oban and occasionally, shortly after a deployment, a handful of jobs can fail because of dependency on other parts of the syst...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge &amp; Solve. They are GUI (Emerge) and State management (S...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
type1fool
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New
akoutmos
@hugobarauna and I (Alex Koutmos) have been hard at work on writing a book on Nerves that takes you from simply blinking LEDs to building...
New

We're in Beta

About us Mission Statement