josefs / Gradualizer

A Gradual type system for Erlang
MIT License
613 stars 35 forks source link

Gradualizer does not work with OTP 25 #426

Open aleklisi opened 2 years ago

aleklisi commented 2 years ago

Gradualizer fails with:

eneo4j$ rebar3 gradualizer
===> Verifying dependencies...
===> Analyzing applications...
===> Compiling eneo4j
===> Uncaught error in rebar_core. Run with DIAGNOSTIC=1 to see stacktrace or consult rebar3.crashdump
===> When submitting a bug report, please include the output of `rebar3 report "your command"`

Spotted at CI: https://github.com/aleklisi/eneo4j/runs/6830064598?check_suite_focus=true#step:7:17

More details:

eneo4j$ DIAGNOSTIC=1 DEBUG=1 rebar3 gradualizer
===> Load global config file /Users/aleksanderlisiecki/.config/rebar3/rebar.config
===> Setting paths to [deps]
===> Compile (apps)
===> Setting paths to [plugins]
===> Setting paths to [deps]
===> Setting paths to [plugins]
===> Setting paths to [plugins]
===> Evaluating config script "/Users/aleksanderlisiecki/.cache/rebar3/plugins/rebar3_erlydtl_plugin/rebar.config.script"
===> Evaluating config script "/Users/aleksanderlisiecki/.cache/rebar3/plugins/erlydtl/rebar.config.script"
===> Setting paths to [deps]
===> Compile (apps)
===> Setting paths to [plugins]
===> Setting paths to [deps]
===> Setting paths to [plugins]
===> Setting paths to [plugins]
===> Evaluating config script "/Users/aleksanderlisiecki/.cache/rebar3/plugins/erlydtl/rebar.config.script"
===> 25.0 satisfies the requirement for minimum OTP version 18
===> Evaluating config script "/Users/aleksanderlisiecki/.cache/rebar3/plugins/hex_core/rebar.config.script"
===> Setting paths to [deps]
===> Compile (apps)
===> Setting paths to [plugins]
===> Setting paths to [deps]
===> Setting paths to [plugins]
===> Setting paths to [plugins]
===> Setting paths to [deps]
===> Compile (apps)
===> Setting paths to [plugins]
===> Setting paths to [deps]
===> Setting paths to [plugins]
===> Setting paths to [plugins]
===> 25.0 satisfies the requirement for minimum OTP version 18
===> Evaluating config script "/Users/aleksanderlisiecki/.cache/rebar3/plugins/hex_core/rebar.config.script"
===> Setting paths to [deps]
===> Compile (apps)
===> Setting paths to [plugins]
===> Setting paths to [deps]
===> Setting paths to [plugins]
===> Setting paths to [plugins]
===> Not adding provider hex user from module rebar3_hex_user because it already exists from module rebar3_hex_user
===> Not adding provider hex cut from module rebar3_hex_cut because it already exists from module rebar3_hex_cut
===> Not adding provider hex key from module rebar3_hex_key because it already exists from module rebar3_hex_key
===> Not adding provider hex owner from module rebar3_hex_owner because it already exists from module rebar3_hex_owner
===> Not adding provider hex repo from module rebar3_hex_repo because it already exists from module rebar3_hex_repo
===> Not adding provider hex docs from module rebar3_hex_docs because it already exists from module rebar3_hex_docs
===> Not adding provider hex search from module rebar3_hex_search because it already exists from module rebar3_hex_search
===> Not adding provider hex revert from module rebar3_hex_revert because it already exists from module rebar3_hex_revert
===> Not adding provider hex retire from module rebar3_hex_retire because it already exists from module rebar3_hex_retire
===> Not adding provider hex publish from module rebar3_hex_publish because it already exists from module rebar3_hex_publish
===> Setting paths to [deps]
===> Compile (apps)
===> Setting paths to [plugins]
===> Setting paths to [deps]
===> Setting paths to [plugins]
===> Setting paths to [plugins]
===> 25.0 satisfies the requirement for minimum OTP version 21.2
===> 25.0 satisfies the requirement for minimum OTP version 21
===> Setting paths to [deps]
===> Compile (apps)
===> Setting paths to [plugins]
===> Setting paths to [deps]
===> Setting paths to [plugins]
===> Setting paths to [plugins]
===> 25.0 satisfies the requirement for minimum OTP version 18
===> Evaluating config script "/Users/aleksanderlisiecki/Documents/Erlang/eneo4j/_build/default/plugins/hex_core/rebar.config.script"
===> 25.0 satisfies the requirement for minimum OTP version 19.3
===> Setting paths to [deps]
===> Compile (apps)
===> Setting paths to [plugins]
===> Setting paths to [deps]
===> Setting paths to [plugins]
===> Setting paths to [plugins]
===> Not adding provider hex user from module rebar3_hex_user because it already exists from module rebar3_hex_user
===> Not adding provider hex cut from module rebar3_hex_cut because it already exists from module rebar3_hex_cut
===> Not adding provider hex owner from module rebar3_hex_owner because it already exists from module rebar3_hex_owner
===> Not adding provider hex search from module rebar3_hex_search because it already exists from module rebar3_hex_search
===> Not adding provider hex retire from module rebar3_hex_retire because it already exists from module rebar3_hex_retire
===> Not adding provider hex publish from module rebar3_hex_publish because it already exists from module rebar3_hex_publish
===> Setting paths to [deps]
===> Compile (apps)
===> Setting paths to [plugins]
===> Setting paths to [deps]
===> Setting paths to [plugins]
===> Setting paths to [plugins]
===> Evaluating config script "/Users/aleksanderlisiecki/Documents/Erlang/eneo4j/_build/default/plugins/jiffy/rebar.config.script"
===> Setting paths to [deps]
===> Compile (apps)
===> Setting paths to [plugins]
===> Setting paths to [deps]
===> Setting paths to [plugins]
===> Setting paths to [plugins]
===> Setting paths to [deps]
===> Compile (apps)
===> Setting paths to [plugins]
===> Setting paths to [deps]
===> Setting paths to [plugins]
===> Setting paths to [plugins]
===> 25.0 satisfies the requirement for minimum OTP version 18
===> Evaluating config script "/Users/aleksanderlisiecki/Documents/Erlang/eneo4j/_build/default/plugins/hex_core/rebar.config.script"
===> 25.0 satisfies the requirement for minimum OTP version 19.3
===> Setting paths to [deps]
===> Compile (apps)
===> Setting paths to [plugins]
===> Setting paths to [deps]
===> Setting paths to [plugins]
===> Setting paths to [plugins]
===> Not adding provider hex user from module rebar3_hex_user because it already exists from module rebar3_hex_user
===> Not adding provider hex build from module rebar3_hex_build because it already exists from module rebar3_hex_build
===> Not adding provider hex cut from module rebar3_hex_cut because it already exists from module rebar3_hex_cut
===> Not adding provider hex owner from module rebar3_hex_owner because it already exists from module rebar3_hex_owner
===> Not adding provider hex organization from module rebar3_hex_organization because it already exists from module rebar3_hex_organization
===> Not adding provider hex search from module rebar3_hex_search because it already exists from module rebar3_hex_search
===> Not adding provider hex retire from module rebar3_hex_retire because it already exists from module rebar3_hex_retire
===> Not adding provider hex publish from module rebar3_hex_publish because it already exists from module rebar3_hex_publish
===> Setting paths to [deps]
===> Compile (apps)
===> Setting paths to [plugins]
===> Setting paths to [deps]
===> Setting paths to [plugins]
===> Setting paths to [plugins]
===> Not adding provider default ex_doc from module rebar3_ex_doc because it already exists from module rebar3_ex_doc
===> Expanded command sequence to be run: [app_discovery,install_deps,lock,compile,gradualizer]
===> Running provider: app_discovery
===> Found top-level apps: [eneo4j]
    using config: [{src_dirs,["src"]},{lib_dirs,["apps/*","lib/*","."]}]
===> Evaluating config script "/Users/aleksanderlisiecki/Documents/Erlang/eneo4j/_build/default/lib/jiffy/rebar.config.script"
===> 25.0 satisfies the requirement for minimum OTP version 21.2
===> 25.0 satisfies the requirement for minimum OTP version 21
===> Setting paths to [deps]
===> Compile (apps)
===> Setting paths to [plugins]
===> Setting paths to [deps]
===> Setting paths to [plugins]
===> Setting paths to [plugins]
===> Not adding provider default fmt from module rebar3_fmt_prv because it already exists from module rebar3_fmt_prv
===> Setting paths to [deps]
===> Compile (apps)
===> Setting paths to [plugins]
===> Setting paths to [deps]
===> Setting paths to [plugins]
===> Setting paths to [plugins]
===> Not adding provider default gradualizer from module rebar_prv_gradualizer because it already exists from module rebar_prv_gradualizer
===> Evaluating config script "/Users/aleksanderlisiecki/Documents/Erlang/eneo4j/_build/default/plugins/jiffy/rebar.config.script"
===> Setting paths to [deps]
===> Compile (apps)
===> Setting paths to [plugins]
===> Setting paths to [deps]
===> Setting paths to [plugins]
===> Setting paths to [plugins]
===> Not adding provider codecov analyze from module rebar3_codecov_prv because it already exists from module rebar3_codecov_prv
===> 25.0 satisfies the requirement for minimum OTP version 18
===> Evaluating config script "/Users/aleksanderlisiecki/Documents/Erlang/eneo4j/_build/default/plugins/hex_core/rebar.config.script"
===> 25.0 satisfies the requirement for minimum OTP version 19.3
===> Setting paths to [deps]
===> Compile (apps)
===> Setting paths to [plugins]
===> Setting paths to [deps]
===> Setting paths to [plugins]
===> Setting paths to [plugins]
===> Not adding provider hex user from module rebar3_hex_user because it already exists from module rebar3_hex_user
===> Not adding provider hex build from module rebar3_hex_build because it already exists from module rebar3_hex_build
===> Not adding provider hex cut from module rebar3_hex_cut because it already exists from module rebar3_hex_cut
===> Not adding provider hex owner from module rebar3_hex_owner because it already exists from module rebar3_hex_owner
===> Not adding provider hex organization from module rebar3_hex_organization because it already exists from module rebar3_hex_organization
===> Not adding provider hex search from module rebar3_hex_search because it already exists from module rebar3_hex_search
===> Not adding provider hex retire from module rebar3_hex_retire because it already exists from module rebar3_hex_retire
===> Not adding provider hex publish from module rebar3_hex_publish because it already exists from module rebar3_hex_publish
===> Setting paths to [deps]
===> Compile (apps)
===> Setting paths to [plugins]
===> Setting paths to [deps]
===> Setting paths to [plugins]
===> Setting paths to [plugins]
===> Not adding provider default ex_doc from module rebar3_ex_doc because it already exists from module rebar3_ex_doc
===> Running provider: install_deps
===> Verifying dependencies...
===> 25.0 satisfies the requirement for minimum OTP version 21.0
===> Evaluating config script "/Users/aleksanderlisiecki/Documents/Erlang/eneo4j/_build/default/plugins/coveralls/rebar.config.script"
===> Evaluating config script "/Users/aleksanderlisiecki/Documents/Erlang/eneo4j/_build/default/plugins/jsx/rebar.config.script"
===> Setting paths to [deps]
===> Compile (apps)
===> Setting paths to [plugins]
===> Setting paths to [deps]
===> Setting paths to [plugins]
===> Setting paths to [plugins]
===> Running provider: lock
===> Running provider: compile
===> Setting paths to [deps]
===> Compile (apps)
===> Setting paths to [plugins]
===> Setting paths to [deps]
===> Running hooks for compile with configuration:
===>    {pre_hooks, []}.
===> run_hooks("/Users/aleksanderlisiecki/Documents/Erlang/eneo4j", pre_hooks, compile) -> no hooks defined

===> Compile (project_apps)
===> Running hooks for compile in app eneo4j (/Users/aleksanderlisiecki/Documents/Erlang/eneo4j) with configuration:
===>    {pre_hooks, []}.
===> run_hooks("/Users/aleksanderlisiecki/Documents/Erlang/eneo4j", pre_hooks, compile) -> no hooks defined

===> Running hooks for erlc_compile in app eneo4j (/Users/aleksanderlisiecki/Documents/Erlang/eneo4j) with configuration:
===>    {pre_hooks, []}.
===> run_hooks("/Users/aleksanderlisiecki/Documents/Erlang/eneo4j", pre_hooks, erlc_compile) -> no hooks defined

===> Setting paths to [deps]
===> Analyzing applications...
===> Compiling eneo4j
===> compile options: {erl_opts, [debug_info]}.
===> files to analyze ["/Users/aleksanderlisiecki/Documents/Erlang/eneo4j/src/eneo4j_sup.erl",
                              "/Users/aleksanderlisiecki/Documents/Erlang/eneo4j/src/eneo4j_response.erl",
                              "/Users/aleksanderlisiecki/Documents/Erlang/eneo4j/src/eneo4j_worker.erl",
                              "/Users/aleksanderlisiecki/Documents/Erlang/eneo4j/src/eneo4j_app.erl",
                              "/Users/aleksanderlisiecki/Documents/Erlang/eneo4j/src/eneo4j.erl"]
===> Starting 0 worker(s)
===> Running hooks for erlc_compile in app eneo4j (/Users/aleksanderlisiecki/Documents/Erlang/eneo4j) with configuration:
===>    {post_hooks, []}.
===> run_hooks("/Users/aleksanderlisiecki/Documents/Erlang/eneo4j", post_hooks, erlc_compile) -> no hooks defined

===> Running hooks for app_compile in app eneo4j (/Users/aleksanderlisiecki/Documents/Erlang/eneo4j) with configuration:
===>    {pre_hooks, []}.
===> run_hooks("/Users/aleksanderlisiecki/Documents/Erlang/eneo4j", pre_hooks, app_compile) -> no hooks defined

===> Setting paths to [plugins]
===> Setting paths to [deps]
===> Running hooks for app_compile in app eneo4j (/Users/aleksanderlisiecki/Documents/Erlang/eneo4j) with configuration:
===>    {post_hooks, []}.
===> run_hooks("/Users/aleksanderlisiecki/Documents/Erlang/eneo4j", post_hooks, app_compile) -> no hooks defined

===> Running hooks for compile in app eneo4j (/Users/aleksanderlisiecki/Documents/Erlang/eneo4j) with configuration:
===>    {post_hooks, []}.
===> run_hooks("/Users/aleksanderlisiecki/Documents/Erlang/eneo4j", post_hooks, compile) -> no hooks defined

===> Running hooks for compile with configuration:
===>    {post_hooks, []}.
===> run_hooks("/Users/aleksanderlisiecki/Documents/Erlang/eneo4j", post_hooks, compile) -> no hooks defined

===> Setting paths to [plugins]
===> Running provider: gradualizer
===> Uncaught error in rebar_core. Run with DIAGNOSTIC=1 to see stacktrace or consult rebar3.crashdump
===> Uncaught error: undef
===> Stack trace to the error location:
[{epp,open,
      ["/Users/aleksanderlisiecki/Documents/Erlang/eneo4j/src/eneo4j.erl",
       <0.1258.0>,
       {1,1},
       [],[]],
      []},
 {gradualizer_file_utils,epp_parse_file,2,
                         [{file,"/Users/aleksanderlisiecki/Documents/Erlang/eneo4j/_build/default/plugins/gradualizer/src/gradualizer_file_utils.erl"},
                          {line,40}]},
 {gradualizer_file_utils,get_forms_from_erl,2,
                         [{file,"/Users/aleksanderlisiecki/Documents/Erlang/eneo4j/_build/default/plugins/gradualizer/src/gradualizer_file_utils.erl"},
                          {line,25}]},
 {gradualizer,type_check_file,2,
              [{file,"/Users/aleksanderlisiecki/Documents/Erlang/eneo4j/_build/default/plugins/gradualizer/src/gradualizer.erl"},
               {line,61}]},
 {gradualizer,'-type_check_files/2-fun-1-',4,
              [{file,"/Users/aleksanderlisiecki/Documents/Erlang/eneo4j/_build/default/plugins/gradualizer/src/gradualizer.erl"},
               {line,133}]},
 {lists,foldl,3,[{file,"lists.erl"},{line,1350}]},
 {lists,map,2,[{file,"lists.erl"},{line,1315}]},
 {rebar_prv_gradualizer,do,1,
                        [{file,"/Users/aleksanderlisiecki/Documents/Erlang/eneo4j/_build/default/plugins/gradualizer/src/rebar_prv_gradualizer.erl"},
                         {line,27}]}]
===> When submitting a bug report, please include the output of `rebar3 report "your command"`
eneo4j$ rebar3 report
Rebar3 report
 version 3.18.0
 generated at 2022-06-10T11:34:21+00:00
=================
Please submit this along with your issue at https://github.com/erlang/rebar3/issues (and feel free to edit out private information, if any)
-----------------
Task:
Entered as:

-----------------
Operating System: x86_64-apple-darwin20.6.0
ERTS: Erlang/OTP 25 [erts-13.0] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit:ns] [dtrace]
Root Directory: /usr/local/Cellar/erlang/25.0_1/lib/erlang
Library directory: /usr/local/Cellar/erlang/25.0_1/lib/erlang/lib
-----------------
Loaded Applications:
bbmustache: 1.12.2
certifi: 2.9.0
cf: 0.3.1
common_test: 1.23
compiler: 8.2
crypto: 5.1
cth_readable: 1.5.1
dialyzer: 5.0
edoc: 1.2
erlware_commons: 1.5.0
eunit: 2.7.1
eunit_formatters: 0.5.0
getopt: 1.0.1
inets: 8.0
kernel: 8.4
providers: 1.9.0
public_key: 1.13
relx: 4.6.0
sasl: 4.2
snmp: 5.13
ssl_verify_fun: 1.1.6
stdlib: 4.0
syntax_tools: 3.0
tools: 3.5.3

-----------------
Escript path: /usr/local/bin/rebar3
Providers:
  analyze app_discovery as build build clean clean compile compile compile compile cover ct cut deploy deps dialyzer do docs edoc escriptize eunit ex_doc fmt get-deps gradualizer help help install install_deps key list lock new organization owner package path pkgs publish release relup repo report repos retire revert routes search serve shell state tar tree unlock update upgrade upgrade upgrade user version version xref
eneo4j$ rebar3 report "rebar3 gradualizer"
Rebar3 report
 version 3.18.0
 generated at 2022-06-10T11:38:32+00:00
=================
Please submit this along with your issue at https://github.com/erlang/rebar3/issues (and feel free to edit out private information, if any)
-----------------
Task: rebar3
Entered as:
  rebar3 gradualizer
-----------------
Operating System: x86_64-apple-darwin20.6.0
ERTS: Erlang/OTP 25 [erts-13.0] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit:ns] [dtrace]
Root Directory: /usr/local/Cellar/erlang/25.0_1/lib/erlang
Library directory: /usr/local/Cellar/erlang/25.0_1/lib/erlang/lib
-----------------
Loaded Applications:
bbmustache: 1.12.2
certifi: 2.9.0
cf: 0.3.1
common_test: 1.23
compiler: 8.2
crypto: 5.1
cth_readable: 1.5.1
dialyzer: 5.0
edoc: 1.2
erlware_commons: 1.5.0
eunit: 2.7.1
eunit_formatters: 0.5.0
getopt: 1.0.1
inets: 8.0
kernel: 8.4
providers: 1.9.0
public_key: 1.13
relx: 4.6.0
sasl: 4.2
snmp: 5.13
ssl_verify_fun: 1.1.6
stdlib: 4.0
syntax_tools: 3.0
tools: 3.5.3

-----------------
Escript path: /usr/local/bin/rebar3
Providers:
  analyze app_discovery as build build clean clean compile compile compile compile cover ct cut deploy deps dialyzer do docs edoc escriptize eunit ex_doc fmt get-deps gradualizer help help install install_deps key list lock new organization owner package path pkgs publish release relup repo report repos retire revert routes search serve shell state tar tree unlock update upgrade upgrade upgrade user version version xref
aleklisi commented 2 years ago

rebar3.crashdump file:

Error: undef
[{epp,open,
      ["/Users/aleksanderlisiecki/Documents/Erlang/eneo4j/src/eneo4j.erl",
       <0.1258.0>,
       {1,1},
       [],[]],
      []},
 {gradualizer_file_utils,epp_parse_file,2,
                         [{file,"/Users/aleksanderlisiecki/Documents/Erlang/eneo4j/_build/default/plugins/gradualizer/src/gradualizer_file_utils.erl"},
                          {line,40}]},
 {gradualizer_file_utils,get_forms_from_erl,2,
                         [{file,"/Users/aleksanderlisiecki/Documents/Erlang/eneo4j/_build/default/plugins/gradualizer/src/gradualizer_file_utils.erl"},
                          {line,25}]},
 {gradualizer,type_check_file,2,
              [{file,"/Users/aleksanderlisiecki/Documents/Erlang/eneo4j/_build/default/plugins/gradualizer/src/gradualizer.erl"},
               {line,61}]},
 {gradualizer,'-type_check_files/2-fun-1-',4,
              [{file,"/Users/aleksanderlisiecki/Documents/Erlang/eneo4j/_build/default/plugins/gradualizer/src/gradualizer.erl"},
               {line,133}]},
 {lists,foldl,3,[{file,"lists.erl"},{line,1350}]},
 {lists,map,2,[{file,"lists.erl"},{line,1315}]},
 {rebar_prv_gradualizer,do,1,
                        [{file,"/Users/aleksanderlisiecki/Documents/Erlang/eneo4j/_build/default/plugins/gradualizer/src/rebar_prv_gradualizer.erl"},
                         {line,27}]}]
zuiderkwast commented 2 years ago

Yeah, I think we are relying on an undocumented eep:open/5 which might have been removed. I think @gomoripeti has been involved in this part both in Gradualizer and in OTP. Is that right?

gomoripeti commented 2 years ago

wow Viktor, you have better memory then I have. Indeed gradualizer was using this undocumented epp function to have column numbers on the parsed abstract format. I wonder if the compiler API could be used instead with modern OTP versions something like compile:file("module", [binary, 'P', return]). I think there was a change in attitude of Gradualizer that back then it was expected to handle source code with compiler errors but now it is assumed that source code must compile. Or epp:open/1 now supports location option since OTP 24. https://www.erlang.org/doc/man/epp.html#open-1

I think the PR that removed epp:open/5 enabled column numbers in epp https://github.com/erlang/otp/pull/3006/files#diff-580a349c49b1d9b5415166e18f5279728d934efe0cebc4ee5a87823055ec3413?

zuiderkwast commented 2 years ago

Thx Peti. Interestingly, we already conditionally use eep:open/5 or eep:open/1. See https://github.com/josefs/Gradualizer/blob/master/src/gradualizer_file_utils.erl#L60

@aleklisi which version of Gradualizer are you using?

aleklisi commented 2 years ago

@zuiderkwast I use gradualizer (0.1.3) according to rebar3.

eneo4j$ rebar3 plugins list
--- Global plugins ---
rebar3_nova (0.3.3)
rebar3_hex (6.11.3)
rebar3_grisp (2.2.2)

--- Local plugins ---
erlfmt (1.0.0)
gradualizer (0.1.3)
rebar3_codecov (0.3.0)
rebar3_hex (7.0.2)
rebar3_ex_doc (0.2.11)

And this is how I defined it in the rebar.config file: https://github.com/aleklisi/eneo4j/blob/master/rebar.config#L17

zuiderkwast commented 2 years ago

OK, 0.1.3 doesn't have this logic. (See https://github.com/josefs/Gradualizer/blob/0.1.3/src/gradualizer_file_utils.erl#L35)

aleklisi commented 2 years ago

I tried updating to use the current gradualizer's master:

eneo4j$ rebar3 plugins list
--- Global plugins ---
rebar3_nova (0.3.3)
rebar3_hex (6.11.3)
rebar3_grisp (2.2.2)

--- Local plugins ---
erlfmt (1.0.0)
gradualizer (0.1.3+build.1112.ref6fe5a67)
rebar3_codecov (0.3.0)
rebar3_hex (7.0.2)
rebar3_ex_doc (0.2.11)

but I get another issue and the issue now is that:

eneo4j$ rebar3 gradualizer
===> Verifying dependencies...
===> Analyzing applications...
===> Compiling eneo4j
/Users/aleksanderlisiecki/Documents/Erlang/eneo4j/src/eneo4j_worker.erl: Timeout checking function send_request_and_process_response/4 on line 148 at column 1
This is most likely a bug in Gradualizer.
Please report it at https://github.com/josefs/Gradualizer/issues
===> Gradualizer found errors.

And here are more details:

eneo4j$ DEBUG=1 rebar3 gradualizer
===> Load global config file /Users/aleksanderlisiecki/.config/rebar3/rebar.config
===> Compile (apps)
===> Evaluating config script "/Users/aleksanderlisiecki/.cache/rebar3/plugins/rebar3_erlydtl_plugin/rebar.config.script"
===> Evaluating config script "/Users/aleksanderlisiecki/.cache/rebar3/plugins/erlydtl/rebar.config.script"
===> Compile (apps)
===> Evaluating config script "/Users/aleksanderlisiecki/.cache/rebar3/plugins/erlydtl/rebar.config.script"
===> 25.0 satisfies the requirement for minimum OTP version 18
===> Evaluating config script "/Users/aleksanderlisiecki/.cache/rebar3/plugins/hex_core/rebar.config.script"
===> Compile (apps)
===> Compile (apps)
===> 25.0 satisfies the requirement for minimum OTP version 18
===> Evaluating config script "/Users/aleksanderlisiecki/.cache/rebar3/plugins/hex_core/rebar.config.script"
===> Compile (apps)
===> Not adding provider hex user from module rebar3_hex_user because it already exists from module rebar3_hex_user
===> Not adding provider hex cut from module rebar3_hex_cut because it already exists from module rebar3_hex_cut
===> Not adding provider hex key from module rebar3_hex_key because it already exists from module rebar3_hex_key
===> Not adding provider hex owner from module rebar3_hex_owner because it already exists from module rebar3_hex_owner
===> Not adding provider hex repo from module rebar3_hex_repo because it already exists from module rebar3_hex_repo
===> Not adding provider hex docs from module rebar3_hex_docs because it already exists from module rebar3_hex_docs
===> Not adding provider hex search from module rebar3_hex_search because it already exists from module rebar3_hex_search
===> Not adding provider hex revert from module rebar3_hex_revert because it already exists from module rebar3_hex_revert
===> Not adding provider hex retire from module rebar3_hex_retire because it already exists from module rebar3_hex_retire
===> Not adding provider hex publish from module rebar3_hex_publish because it already exists from module rebar3_hex_publish
===> Compile (apps)
===> 25.0 satisfies the requirement for minimum OTP version 21.2
===> 25.0 satisfies the requirement for minimum OTP version 21
===> Compile (apps)
===> Compile (apps)
===> Evaluating config script "/Users/aleksanderlisiecki/Documents/Erlang/eneo4j/_build/default/plugins/jiffy/rebar.config.script"
===> Compile (apps)
===> Compile (apps)
===> 25.0 satisfies the requirement for minimum OTP version 18
===> Evaluating config script "/Users/aleksanderlisiecki/Documents/Erlang/eneo4j/_build/default/plugins/hex_core/rebar.config.script"
===> 25.0 satisfies the requirement for minimum OTP version 19.3
===> Compile (apps)
===> Not adding provider hex user from module rebar3_hex_user because it already exists from module rebar3_hex_user
===> Not adding provider hex cut from module rebar3_hex_cut because it already exists from module rebar3_hex_cut
===> Not adding provider hex owner from module rebar3_hex_owner because it already exists from module rebar3_hex_owner
===> Not adding provider hex search from module rebar3_hex_search because it already exists from module rebar3_hex_search
===> Not adding provider hex retire from module rebar3_hex_retire because it already exists from module rebar3_hex_retire
===> Not adding provider hex publish from module rebar3_hex_publish because it already exists from module rebar3_hex_publish
===> Compile (apps)
===> Not adding provider default ex_doc from module rebar3_ex_doc because it already exists from module rebar3_ex_doc
===> Expanded command sequence to be run: [app_discovery,install_deps,lock,compile,gradualizer]
===> Running provider: app_discovery
===> Found top-level apps: [eneo4j]
    using config: [{src_dirs,["src"]},{lib_dirs,["apps/*","lib/*","."]}]
===> Evaluating config script "/Users/aleksanderlisiecki/Documents/Erlang/eneo4j/_build/default/lib/jiffy/rebar.config.script"
===> 25.0 satisfies the requirement for minimum OTP version 21.2
===> 25.0 satisfies the requirement for minimum OTP version 21
===> Compile (apps)
===> Not adding provider default fmt from module rebar3_fmt_prv because it already exists from module rebar3_fmt_prv
===> Compile (apps)
===> Not adding provider default gradualizer from module rebar_prv_gradualizer because it already exists from module rebar_prv_gradualizer
===> Evaluating config script "/Users/aleksanderlisiecki/Documents/Erlang/eneo4j/_build/default/plugins/jiffy/rebar.config.script"
===> Compile (apps)
===> Not adding provider codecov analyze from module rebar3_codecov_prv because it already exists from module rebar3_codecov_prv
===> 25.0 satisfies the requirement for minimum OTP version 18
===> Evaluating config script "/Users/aleksanderlisiecki/Documents/Erlang/eneo4j/_build/default/plugins/hex_core/rebar.config.script"
===> 25.0 satisfies the requirement for minimum OTP version 19.3
===> Compile (apps)
===> Not adding provider hex user from module rebar3_hex_user because it already exists from module rebar3_hex_user
===> Not adding provider hex build from module rebar3_hex_build because it already exists from module rebar3_hex_build
===> Not adding provider hex cut from module rebar3_hex_cut because it already exists from module rebar3_hex_cut
===> Not adding provider hex owner from module rebar3_hex_owner because it already exists from module rebar3_hex_owner
===> Not adding provider hex organization from module rebar3_hex_organization because it already exists from module rebar3_hex_organization
===> Not adding provider hex search from module rebar3_hex_search because it already exists from module rebar3_hex_search
===> Not adding provider hex retire from module rebar3_hex_retire because it already exists from module rebar3_hex_retire
===> Not adding provider hex publish from module rebar3_hex_publish because it already exists from module rebar3_hex_publish
===> Compile (apps)
===> Not adding provider default ex_doc from module rebar3_ex_doc because it already exists from module rebar3_ex_doc
===> Running provider: install_deps
===> Verifying dependencies...
===> 25.0 satisfies the requirement for minimum OTP version 21.0
===> Evaluating config script "/Users/aleksanderlisiecki/Documents/Erlang/eneo4j/_build/default/plugins/coveralls/rebar.config.script"
===> Evaluating config script "/Users/aleksanderlisiecki/Documents/Erlang/eneo4j/_build/default/plugins/jsx/rebar.config.script"
===> Compile (apps)
===> Running provider: lock
===> Running provider: compile
===> Compile (apps)
===> Running hooks for compile with configuration:
===>    {pre_hooks, []}.
===> Compile (project_apps)
===> Running hooks for compile in app eneo4j (/Users/aleksanderlisiecki/Documents/Erlang/eneo4j) with configuration:
===>    {pre_hooks, []}.
===> Running hooks for erlc_compile in app eneo4j (/Users/aleksanderlisiecki/Documents/Erlang/eneo4j) with configuration:
===>    {pre_hooks, []}.
===> Analyzing applications...
===> Compiling eneo4j
===> compile options: {erl_opts, [debug_info]}.
===> files to analyze ["/Users/aleksanderlisiecki/Documents/Erlang/eneo4j/src/eneo4j_sup.erl",
                              "/Users/aleksanderlisiecki/Documents/Erlang/eneo4j/src/eneo4j_response.erl",
                              "/Users/aleksanderlisiecki/Documents/Erlang/eneo4j/src/eneo4j_worker.erl",
                              "/Users/aleksanderlisiecki/Documents/Erlang/eneo4j/src/eneo4j_app.erl",
                              "/Users/aleksanderlisiecki/Documents/Erlang/eneo4j/src/eneo4j.erl"]
===> Running hooks for erlc_compile in app eneo4j (/Users/aleksanderlisiecki/Documents/Erlang/eneo4j) with configuration:
===>    {post_hooks, []}.
===> Running hooks for app_compile in app eneo4j (/Users/aleksanderlisiecki/Documents/Erlang/eneo4j) with configuration:
===>    {pre_hooks, []}.
===> Running hooks for app_compile in app eneo4j (/Users/aleksanderlisiecki/Documents/Erlang/eneo4j) with configuration:
===>    {post_hooks, []}.
===> Running hooks for compile in app eneo4j (/Users/aleksanderlisiecki/Documents/Erlang/eneo4j) with configuration:
===>    {post_hooks, []}.
===> Running hooks for compile with configuration:
===>    {post_hooks, []}.
===> Running provider: gradualizer
/Users/aleksanderlisiecki/Documents/Erlang/eneo4j/src/eneo4j_worker.erl: Timeout checking function send_request_and_process_response/4 on line 148 at column 1
This is most likely a bug in Gradualizer.
Please report it at https://github.com/josefs/Gradualizer/issues
===> Gradualizer found errors.
aleklisi commented 2 years ago

Steps to reproduce:

git clone git@github.com:aleklisi/eneo4j.git
cd eneo4j
rebar3 gradualizer
zuiderkwast commented 2 years ago

So you found another bug. Thanks for the report. Timeout looks like there is an infinite loop somewhere.

berbiche commented 2 years ago

The infinite loop is caused by the recursive type returned by jiffy:decode.

The workaround is ?assert_type(jiffy:decode(Thing), any()).

erszcz commented 2 years ago

Interestingly, we already conditionally use eep:open/5 or eep:open/1.

When we're at it we could also change the dynamic check to a preprocessor ifdef. It would fix the need for https://github.com/josefs/Gradualizer/blob/51a8029e32415da66293b01611633e662673c619/gradualize-ignore.lst#L1

erszcz commented 2 years ago

@aleklisi Did you have a chance to try the workaround proposed by @berbiche?

aleklisi commented 2 years ago

@erszcz not yet, I did not figure out where to paste this asset_type snippet yet. I will let you know if it works for me.