【问题标题】:Which version of elixir-otp-erlang can we use with dialyzer?我们可以在透析器中使用哪个版本的 elixir-otp-erlang?
【发布时间】:2019-04-24 22:57:06
【问题描述】:

背景

最新版本的 Elixir (1.7.X) 有一个bug that prevents the usage of dialyzer 16

现在,我知道以前的一些版本没有这个问题,但我不知道哪些版本。

我尝试了什么

我已经测试了以下版本:

1.7.2-otp-21
1.7.3-otp-21
1.7.4-otp-21

所有都无法正常工作。

可以使用 MWE 重现该错误:

问题

不受此 bug 影响的最新版本的 elixir-otp-erlang 是什么?

【问题讨论】:

    标签: elixir erlang-otp dialyzer


    【解决方案1】:

    我编写了一个脚本(使用官方 docker 镜像)来测试所有 1.7 版本,但都失败了。

    有效的最新版本似乎是1.6.6

    root@0697cad23f07:/data# mix dialyzer
    Finding suitable PLTs
    Checking PLT...
    [:accept, :compiler, :crypto, :elixir, :kernel, :logger, :mime, :plug, :plug_crypto, :prometheus, :prometheus_ex, :prometheus_plugs, :stdlib]
    PLT is up to date!
    Starting Dialyzer
    [
      check_plt: false,
      init_plt: '/data/_build/dev/dialyxir_erlang-20.3.8.14_elixir-1.6.6_deps-dev.plt',
      files_rec: ['/data/_build/dev/lib/myapp/ebin'],
      warnings: [:unknown]
    ]
    Total errors: 0, Skipped: 0
    done in 0m2.83s
    done (passed successfully)
    

    【讨论】:

    【解决方案2】:

    我不确定您的其他设置是什么,但正如我之前提到的,对我来说,它适用于以下设置:

    $ mix dialyzer
    Finding suitable PLTs
    Checking PLT...
    [:asn1, :bamboo, :bcrypt_elixir, :cache_server, :certifi, :compiler, :connection, :core, :cors_plug, :cowboy, :cowlib, :crypto, :database, :db_connection, :decimal, :ecto, :eex, :elixir, :elixir_make, :gettext, :hackney, :idna, :jason, :kernel, :logger, :metrics, :mime, :mimerl, :parse_trans, :phoenix, :phoenix_html, :phoenix_pubsub, :plug, :poison, :poolboy, :postgrex, :public_key, :ranch, :runtime_tools, :ssl, :ssl_verify_fun, :stdlib, :unicode_util_compat]
    PLT is up to date!
    Starting Dialyzer
    [
      check_plt: false,
      init_plt: '/______/code/aetherwars_umbrella/_build/dev/dialyxir_erlang-21.0_elixir-1.7.2_deps-dev.plt',
      files_rec: ['/______/code/aetherwars_umbrella/_build/dev/lib/web/ebin',
       '/______/code/aetherwars_umbrella/_build/dev/lib/cache_server/ebin',
       '/______/code/aetherwars_umbrella/_build/dev/lib/database/ebin',
       '/______/code/aetherwars_umbrella/_build/dev/lib/core/ebin'],
      warnings: [:unknown]
    ]
    Total errors: 70, Skipped: 0
    done in 2m2.05s
    

    伞mix.exs:

    # ...
    def project do
        [
          apps_path: "apps",
          start_permanent: Mix.env() == :prod,
          deps: deps(),
          dialyzer: [plt_add_deps: :transitive],
          aliases: aliases()
        ]
      end
    
    #....
    
    defp deps do
        [
          {:dialyxir, "~> 1.0.0-rc.3", only: [:dev], runtime: false},
          {:benchee, "~> 0.11", only: :dev}
        ]
    end
    

    【讨论】:

      猜你喜欢
      • 2014-03-19
      • 1970-01-01
      • 1970-01-01
      • 2014-09-05
      • 2016-05-26
      • 2020-03-13
      • 2021-12-31
      • 2023-04-02
      • 2011-12-23
      相关资源
      最近更新 更多