2

I have erlang 17.5 installed in /usr/local/lib. evm considers that my "system" install. After installing evm, I downloaded erlang 19.2, and I can switch back and forth between my two versions of erlang using:

$ evm system (erlang 17.5)

$ evm use 19.2  (erlang 19.2)

I was able to set up dialyzer with erlang 17.5, but when I switch to erlang 19.2 and try to setup dialyzer, here is what happens :

~/erlang_programs$ evm use 19.2

~/erlang_programs$ dialyzer
  Checking whether the PLT /Users/7stud/.dialyzer_plt is up-to-date... no
    (the PLT /Users/7stud/.dialyzer_plt was built with an old version of Dialyzer)
  Compiling some key modules to native code... done in 0m0.24s
  Rebuilding the information in /Users/7stud/.dialyzer_plt...
dialyzer: Analysis failed with error:
Could not scan the following file(s):
Could not get core Erlang code for: /usr/local/lib/erlang/lib/stdlib-2.4/ebin/timer.beam    
Could not get core Erlang code for: /usr/local/lib/erlang/lib/stdlib-2.4/ebin/sys.beam  
Could not get core Erlang code for: /usr/local/lib/erlang/lib/stdlib-2.4/ebin/supervisor_bridge.beam  
Could not get core Erlang code for: /usr/local/lib/erlang/lib/stdlib-2.4/ebin/supervisor.beam  
Could not get core Erlang code for: /usr/local/lib/erlang/lib/stdlib-2.4/ebin/lists.beam  
Could not get core Erlang code for: /usr/local/lib/erlang/lib/stdlib-2.4/ebin/proc_lib.beam  
Could not get core Erlang code for: /usr/local/lib/erlang/lib/stdlib-2.4/ebin/gen_event.beam 
Could not get core Erlang code for: /usr/local/lib/erlang/lib/stdlib-2.4/ebin/gen_server.beam  
Could not get core Erlang code for: /usr/local/lib/erlang/lib/stdlib-2.4/ebin/array.beam  
Could not get core Erlang code for: /usr/local/lib/erlang/lib/kernel-3.2/ebin/seq_trace.beam  
Could not get core Erlang code for: /usr/local/lib/erlang/lib/kernel-3.2/ebin/rpc.beam  
Could not get core Erlang code for: /usr/local/lib/erlang/lib/kernel-3.2/ebin/gen_udp.beam  
Could not get core Erlang code for: /usr/local/lib/erlang/lib/kernel-3.2/ebin/gen_tcp.beam  
Could not get core Erlang code for: /usr/local/lib/erlang/lib/kernel-3.2/ebin/file.beam  
Could not get core Erlang code for: /usr/local/lib/erlang/lib/kernel-3.2/ebin/disk_log.beam  
Could not get core Erlang code for: /usr/local/lib/erlang/lib/kernel-3.2/ebin/code.beam  
Could not get core Erlang code for: /usr/local/lib/erlang/lib/kernel-3.2/ebin/application.beam  
Could not get core Erlang code for: /usr/local/lib/erlang/lib/erts-6.4/ebin/erlang.beam
        Last messages in the log cache:
          Reading files and computing callgraph... 
7stud
  • 46,922
  • 14
  • 101
  • 127
  • Could you add the output of `which dialyzer`? I am wondering why dialyzer searches for code in `/usr/local/lib/erlang`. I would expect that `evm` places Erlang somewhere else, as it has to distinguish between versions. I have been using https://github.com/kerl/kerl to manage different OTP versions and never ran into a problem like this. – evnu Mar 23 '17 at 07:12
  • @evnu, 17.5: `$ which dialyzer /usr/local/bin/dialyzer`, 19.2: `$ which dialyzer /Users/7stud/.evm/erlang_versions/otp_src_19.2/bin/dialyzer` – 7stud Mar 23 '17 at 15:38
  • @7stud I suspect there was a `.dialyzer_plt` already created with OTP 17.5 before you switched to 19.2, and `dialyzer` tried to update that one. – juan.facorro Mar 23 '17 at 17:03
  • @juan.facorro, As I said in my question, I got dialyzer working with 17.5, then I switched to 19.2 and tried the same. The error message even says: *the PLT /Users/7stud/.dialyzer_plt was built with an old version of Dialyzer*. But what's the solution? Delete the .dialyzer_plt file? That seems like a pain because then won't I have to rebuild the plt every time I switch elrang versions? Or, I guess I could rename the file to .dialyzer17.5_plt before switching versions. – 7stud Mar 23 '17 at 18:33
  • Yes, deleting the files is the way to go. The simplest work around would be to build one `.plt` per Erlang version and name it appropriately, e.g. `.dialyzer.otp-17.2.plt`. Then pass that file into dialyzer. – evnu Mar 24 '17 at 12:54

0 Answers0