AdRoll / rebar3_format

Erlang Formatter for Rebar3
https://tech.nextroll.com/blog/dev/2020/02/25/erlang-rebar3-format.html
MIT License
108 stars 21 forks source link

Compilation error on Erlang/OTP 25.0.2 #314

Closed jj1bdx closed 2 years ago

jj1bdx commented 2 years ago

Describe the bug

Unable to build rebar3_format by rebar3 compile on Erlang/OTP 25.0.2 running on macOS 12.4.

To Reproduce

# clean up the build directory
/bin/rm -rf ./_build
# then build
rebar3 compile

Expected behavior

Successful compilation of rebar3_format.

Rebar3 Log

% DEBUG=1 rebar3 compile
===> 25.0.2 satisfies the requirement for minimum OTP version 23
===> Fetching rebar3_hex v7.0.2
===> Making request to get package rebar3_hex from repo hexpm (#{api_url => <<"https://hex.pm/api">>,name => <<"hexpm">>,
         repo_name => <<"hexpm">>,repo_organization => undefined,
         repo_url => <<"https://repo.hex.pm">>,repo_verify => true,
         repo_verify_origin => true})
===> Version cached at /Users/kenji/.cache/rebar3/hex/hexpm/packages/rebar3_hex-7.0.2.tar is up to date, reusing it
===> 25.0.2 satisfies the requirement for minimum OTP version 18
===> Fetching hex_core v0.8.4
===> Making request to get package hex_core from repo hexpm
===> Version cached at /Users/kenji/.cache/rebar3/hex/hexpm/packages/hex_core-0.8.4.tar is up to date, reusing it
===> Evaluating config script "/Users/kenji/src/rebar3_format/_build/default/plugins/hex_core/rebar.config.script"
===> Fetching verl v1.1.1
===> Making request to get package verl from repo hexpm
===> Version cached at /Users/kenji/.cache/rebar3/hex/hexpm/packages/verl-1.1.1.tar is up to date, reusing it
===> 25.0.2 satisfies the requirement for minimum OTP version 19.3
===> Compile (apps)
===> Running hooks for compile in app hex_core (/Users/kenji/src/rebar3_format/_build/default/plugins/hex_core) with configuration:
===>    {pre_hooks, []}.
===> Running hooks for compile in app verl (/Users/kenji/src/rebar3_format/_build/default/plugins/verl) with configuration:
===>    {pre_hooks, []}.
===> Running hooks for compile in app rebar3_hex (/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_hex) with configuration:
===>    {pre_hooks, []}.
===> Running hooks for erlc_compile in app hex_core (/Users/kenji/src/rebar3_format/_build/default/plugins/hex_core) with configuration:
===>    {pre_hooks, []}.
===> Running hooks for erlc_compile in app verl (/Users/kenji/src/rebar3_format/_build/default/plugins/verl) with configuration:
===>    {pre_hooks, []}.
===> Running hooks for erlc_compile in app rebar3_hex (/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_hex) with configuration:
===>    {pre_hooks, []}.
===> Analyzing applications...
===>      Compiled safe_erl_term.xrl
===> Compiling verl
===> compile options: {erl_opts, [debug_info,warn_missing_spec,
                                         warnings_as_errors]}.
===> files to analyze ["/Users/kenji/src/rebar3_format/_build/default/plugins/verl/src/verl.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/verl/src/verl_parser.erl"]
===>      Compiled verl.erl
===>      Compiled verl_parser.erl
===> Compiling hex_core
===> compile options: {erl_opts, [debug_info]}.
===> files to analyze ["/Users/kenji/src/rebar3_format/_build/default/plugins/hex_core/src/hex_api_package.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/hex_core/src/hex_http.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/hex_core/src/hex_http_httpc.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/hex_core/src/hex_api_organization_member.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/hex_core/src/hex_api_package_owner.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/hex_core/src/hex_pb_names.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/hex_core/src/hex_licenses.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/hex_core/src/hex_pb_package.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/hex_core/src/hex_api.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/hex_core/src/hex_tarball.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/hex_core/src/hex_erl_tar.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/hex_core/src/hex_repo.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/hex_core/src/hex_registry.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/hex_core/src/hex_api_auth.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/hex_core/src/hex_pb_signed.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/hex_core/src/hex_core.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/hex_core/src/hex_pb_versions.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/hex_core/src/hex_api_organization.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/hex_core/src/safe_erl_term.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/hex_core/src/hex_filename.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/hex_core/src/hex_api_key.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/hex_core/src/hex_api_user.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/hex_core/src/hex_api_release.erl"]
===>      Compiled hex_http.erl
===>      Compiled hex_core.erl
===>      Compiled hex_api_auth.erl
===>      Compiled hex_api_organization.erl
===>      Compiled hex_api_user.erl
===>      Compiled hex_api_package.erl
===>      Compiled hex_filename.erl
===>      Compiled hex_api_package_owner.erl
===>      Compiled hex_api_key.erl
===>      Compiled hex_api_organization_member.erl
===>      Compiled hex_api_release.erl
===>      Compiled hex_api.erl
===>      Compiled hex_repo.erl
===>      Compiled hex_registry.erl
===>      Compiled hex_http_httpc.erl
===>      Compiled hex_tarball.erl
===>      Compiled hex_pb_signed.erl
===>      Compiled safe_erl_term.erl
===>      Compiled hex_pb_versions.erl
===>      Compiled hex_licenses.erl
===>      Compiled hex_pb_names.erl
===>      Compiled hex_pb_package.erl
===>      Compiled hex_erl_tar.erl
===> Compiling rebar3_hex
===> compile options: {erl_opts, [debug_info,
                                         {d,'POST_OTP_22'},
                                         {d,'POST_OTP_18'}]}.
===> files to analyze ["/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_hex/src/rebar3_hex_build.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_hex/src/rebar3_hex_httpc_adapter.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_hex/src/rebar3_hex_cut.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_hex/src/rebar3_hex_owner.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_hex/src/rebar3_hex_search.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_hex/src/rebar3_hex_config.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_hex/src/rebar3_hex_results.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_hex/src/rebar3_hex_organization.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_hex/src/rebar3_hex.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_hex/src/rebar3_hex_key.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_hex/src/rebar3_hex_retire.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_hex/src/rebar3_hex_error.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_hex/src/rebar3_hex_app.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_hex/src/rebar3_hex_publish.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_hex/src/rebar3_hex_version.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_hex/src/rebar3_hex_client.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_hex/src/rebar3_hex_user.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_hex/src/rebar3_hex_io.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_hex/src/rebar3_hex_file.erl"]
===>      Compiled rebar3_hex_version.erl
===>      Compiled rebar3_hex_error.erl
===>      Compiled rebar3_hex.erl
===>      Compiled rebar3_hex_results.erl
===>      Compiled rebar3_hex_retire.erl
===>      Compiled rebar3_hex_search.erl
===>      Compiled rebar3_hex_httpc_adapter.erl
===>      Compiled rebar3_hex_key.erl
===>      Compiled rebar3_hex_owner.erl
===>      Compiled rebar3_hex_config.erl
===>      Compiled rebar3_hex_client.erl
===>      Compiled rebar3_hex_io.erl
===>      Compiled rebar3_hex_cut.erl
===>      Compiled rebar3_hex_file.erl
===>      Compiled rebar3_hex_organization.erl
===>      Compiled rebar3_hex_app.erl
===>      Compiled rebar3_hex_build.erl
===>      Compiled rebar3_hex_user.erl
===>      Compiled rebar3_hex_publish.erl
===> Running hooks for erlc_compile in app hex_core (/Users/kenji/src/rebar3_format/_build/default/plugins/hex_core) with configuration:
===>    {post_hooks, []}.
===> Running hooks for erlc_compile in app verl (/Users/kenji/src/rebar3_format/_build/default/plugins/verl) with configuration:
===>    {post_hooks, []}.
===> Running hooks for erlc_compile in app rebar3_hex (/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_hex) with configuration:
===>    {post_hooks, []}.
===> Running hooks for app_compile in app hex_core (/Users/kenji/src/rebar3_format/_build/default/plugins/hex_core) with configuration:
===>    {pre_hooks, []}.
===> Running hooks for app_compile in app verl (/Users/kenji/src/rebar3_format/_build/default/plugins/verl) with configuration:
===>    {pre_hooks, []}.
===> Running hooks for app_compile in app rebar3_hex (/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_hex) with configuration:
===>    {pre_hooks, []}.
===> Running hooks for app_compile in app hex_core (/Users/kenji/src/rebar3_format/_build/default/plugins/hex_core) with configuration:
===>    {post_hooks, []}.
===> Running hooks for app_compile in app verl (/Users/kenji/src/rebar3_format/_build/default/plugins/verl) with configuration:
===>    {post_hooks, []}.
===> Running hooks for app_compile in app rebar3_hex (/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_hex) with configuration:
===>    {post_hooks, []}.
===> Running hooks for compile in app hex_core (/Users/kenji/src/rebar3_format/_build/default/plugins/hex_core) with configuration:
===>    {post_hooks, []}.
===> Running hooks for compile in app verl (/Users/kenji/src/rebar3_format/_build/default/plugins/verl) with configuration:
===>    {post_hooks, []}.
===> Running hooks for compile in app rebar3_hex (/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_hex) with configuration:
===>    {post_hooks, []}.
===> Fetching rebar3_hank v1.3.0
===> Making request to get package rebar3_hank from repo hexpm
===> Version cached at /Users/kenji/.cache/rebar3/hex/hexpm/packages/rebar3_hank-1.3.0.tar is up to date, reusing it
===> 25.0.2 satisfies the requirement for minimum OTP version 21
===> Fetching katana_code v2.0.0
===> Making request to get package katana_code from repo hexpm
===> Version cached at /Users/kenji/.cache/rebar3/hex/hexpm/packages/katana_code-2.0.0.tar is up to date, reusing it
===> 25.0.2 satisfies the requirement for minimum OTP version 23
===> Compile (apps)
===> Running hooks for compile in app katana_code (/Users/kenji/src/rebar3_format/_build/default/plugins/katana_code) with configuration:
===>    {pre_hooks, []}.
===> Running hooks for compile in app rebar3_hank (/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_hank) with configuration:
===>    {pre_hooks, []}.
===> Running hooks for erlc_compile in app katana_code (/Users/kenji/src/rebar3_format/_build/default/plugins/katana_code) with configuration:
===>    {pre_hooks, []}.
===> Running hooks for erlc_compile in app rebar3_hank (/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_hank) with configuration:
===>    {pre_hooks, []}.
===> Analyzing applications...
===> Compiling katana_code
===> compile options: {erl_opts, [warn_unused_import,warn_export_vars,
                                         warnings_as_errors,verbose,report,
                                         debug_info,
                                         {feature,maybe_expr,enable}]}.
===> files to analyze ["/Users/kenji/src/rebar3_format/_build/default/plugins/katana_code/src/ktn_io_string.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/katana_code/src/ktn_code.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/katana_code/src/ktn_dodger.erl"]
===>      Compiled ktn_io_string.erl
===>      Compiled ktn_code.erl
===>      Compiled ktn_dodger.erl
===> Compiling rebar3_hank
===> compile options: {erl_opts, [warn_unused_import,warn_export_vars,
                                         warnings_as_errors,verbose,report,
                                         debug_info]}.
===> files to analyze ["/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_hank/src/rules/unnecessary_function_arguments.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_hank/src/rules/unused_callbacks.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_hank/src/rules/unused_record_fields.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_hank/src/rules/unused_macros.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_hank/src/rules/single_use_hrl_attrs.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_hank/src/rules/unused_configuration_options.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_hank/src/rules/unused_hrls.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_hank/src/rules/single_use_hrls.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_hank/src/rebar3_hank.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_hank/src/hank_context.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_hank/src/rebar3_hank_prv.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_hank/src/hank_rule.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_hank/src/hank.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_hank/src/hank_utils.erl"]
===>      Compiled hank_rule.erl
===>      Compiled rebar3_hank.erl
===>      Compiled hank_context.erl
===>      Compiled single_use_hrls.erl
===>      Compiled unused_callbacks.erl
===>      Compiled unused_hrls.erl
===>      Compiled unused_macros.erl
===>      Compiled hank_utils.erl
===>      Compiled unused_configuration_options.erl
===>      Compiled single_use_hrl_attrs.erl
===>      Compiled unnecessary_function_arguments.erl
===>      Compiled rebar3_hank_prv.erl
===>      Compiled hank.erl
===>      Compiled unused_record_fields.erl
===> Running hooks for erlc_compile in app katana_code (/Users/kenji/src/rebar3_format/_build/default/plugins/katana_code) with configuration:
===>    {post_hooks, []}.
===> Running hooks for erlc_compile in app rebar3_hank (/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_hank) with configuration:
===>    {post_hooks, []}.
===> Running hooks for app_compile in app katana_code (/Users/kenji/src/rebar3_format/_build/default/plugins/katana_code) with configuration:
===>    {pre_hooks, []}.
===> Running hooks for app_compile in app rebar3_hank (/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_hank) with configuration:
===>    {pre_hooks, []}.
===> Running hooks for app_compile in app katana_code (/Users/kenji/src/rebar3_format/_build/default/plugins/katana_code) with configuration:
===>    {post_hooks, []}.
===> Running hooks for app_compile in app rebar3_hank (/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_hank) with configuration:
===>    {post_hooks, []}.
===> Running hooks for compile in app katana_code (/Users/kenji/src/rebar3_format/_build/default/plugins/katana_code) with configuration:
===>    {post_hooks, []}.
===> Running hooks for compile in app rebar3_hank (/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_hank) with configuration:
===>    {post_hooks, []}.
===> Fetching rebar3_lint v1.1.0
===> Making request to get package rebar3_lint from repo hexpm
===> Version cached at /Users/kenji/.cache/rebar3/hex/hexpm/packages/rebar3_lint-1.1.0.tar is up to date, reusing it
===> 25.0.2 satisfies the requirement for minimum OTP version 21
===> Fetching elvis_core v1.4.0
===> Making request to get package elvis_core from repo hexpm
===> Version cached at /Users/kenji/.cache/rebar3/hex/hexpm/packages/elvis_core-1.4.0.tar is up to date, reusing it
===> 25.0.2 satisfies the requirement for minimum OTP version 23
===> Fetching zipper v1.0.1
===> Making request to get package zipper from repo hexpm
===> Version cached at /Users/kenji/.cache/rebar3/hex/hexpm/packages/zipper-1.0.1.tar is up to date, reusing it
===> Compile (apps)
===> Running hooks for compile in app zipper (/Users/kenji/src/rebar3_format/_build/default/plugins/zipper) with configuration:
===>    {pre_hooks, []}.
===> Running hooks for compile in app katana_code (/Users/kenji/src/rebar3_format/_build/default/plugins/katana_code) with configuration:
===>    {pre_hooks, []}.
===> Running hooks for compile in app elvis_core (/Users/kenji/src/rebar3_format/_build/default/plugins/elvis_core) with configuration:
===>    {pre_hooks, []}.
===> Running hooks for compile in app rebar3_lint (/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_lint) with configuration:
===>    {pre_hooks, []}.
===> Running hooks for erlc_compile in app zipper (/Users/kenji/src/rebar3_format/_build/default/plugins/zipper) with configuration:
===>    {pre_hooks, []}.
===> Running hooks for erlc_compile in app katana_code (/Users/kenji/src/rebar3_format/_build/default/plugins/katana_code) with configuration:
===>    {pre_hooks, []}.
===> Running hooks for erlc_compile in app elvis_core (/Users/kenji/src/rebar3_format/_build/default/plugins/elvis_core) with configuration:
===>    {pre_hooks, []}.
===> Running hooks for erlc_compile in app rebar3_lint (/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_lint) with configuration:
===>    {pre_hooks, []}.
===> Analyzing applications...
===> Compiling zipper
===> compile options: {erl_opts, [warn_unused_vars,warn_export_all,
                                         warn_shadow_vars,warn_unused_import,
                                         warn_unused_function,warn_bif_clash,
                                         warn_unused_record,
                                         warn_deprecated_function,
                                         warn_obsolete_guard,
                                         strict_validation,warn_export_vars,
                                         warn_exported_vars,warn_missing_spec,
                                         warn_untyped_record,debug_info]}.
===> files to analyze ["/Users/kenji/src/rebar3_format/_build/default/plugins/zipper/src/zipper.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/zipper/src/zipper_default.erl"]
===>      Compiled zipper_default.erl
===>      Compiled zipper.erl
===> Compiling katana_code
===> compile options: {erl_opts, [warn_unused_import,warn_export_vars,
                                         warnings_as_errors,verbose,report,
                                         debug_info,
                                         {feature,maybe_expr,enable}]}.
===> files to analyze ["/Users/kenji/src/rebar3_format/_build/default/plugins/katana_code/src/ktn_io_string.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/katana_code/src/ktn_code.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/katana_code/src/ktn_dodger.erl"]
===> Compiling elvis_core
===> compile options: {erl_opts, [warn_unused_vars,warn_export_all,
                                         warn_shadow_vars,warn_unused_import,
                                         warn_unused_function,warn_bif_clash,
                                         warn_unused_record,
                                         warn_deprecated_function,
                                         warn_obsolete_guard,
                                         strict_validation,warn_export_vars,
                                         warn_exported_vars,warn_missing_spec,
                                         warn_untyped_record,debug_info]}.
===> files to analyze ["/Users/kenji/src/rebar3_format/_build/default/plugins/elvis_core/src/elvis_core.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/elvis_core/src/elvis_project.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/elvis_core/src/elvis_config.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/elvis_core/src/elvis_result.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/elvis_core/src/elvis_task.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/elvis_core/src/elvis_style.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/elvis_core/src/elvis_file.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/elvis_core/src/elvis_utils.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/elvis_core/src/elvis_rulesets.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/elvis_core/src/elvis_text_style.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/elvis_core/src/elvis_code.erl"]
===>      Compiled elvis_rulesets.erl
===>      Compiled elvis_result.erl
===>      Compiled elvis_text_style.erl
===>      Compiled elvis_code.erl
===>      Compiled elvis_file.erl
===>      Compiled elvis_utils.erl
===>      Compiled elvis_config.erl
===>      Compiled elvis_core.erl
===>      Compiled elvis_project.erl
===>      Compiled elvis_task.erl
===>      Compiled elvis_style.erl
===> Compiling rebar3_lint
===> compile options: {erl_opts, [debug_info]}.
===> files to analyze ["/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_lint/src/rebar3_lint.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_lint/src/rebar3_lint_prv.erl"]
===>      Compiled rebar3_lint.erl
===>      Compiled rebar3_lint_prv.erl
===> Running hooks for erlc_compile in app zipper (/Users/kenji/src/rebar3_format/_build/default/plugins/zipper) with configuration:
===>    {post_hooks, []}.
===> Running hooks for erlc_compile in app katana_code (/Users/kenji/src/rebar3_format/_build/default/plugins/katana_code) with configuration:
===>    {post_hooks, []}.
===> Running hooks for erlc_compile in app elvis_core (/Users/kenji/src/rebar3_format/_build/default/plugins/elvis_core) with configuration:
===>    {post_hooks, []}.
===> Running hooks for erlc_compile in app rebar3_lint (/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_lint) with configuration:
===>    {post_hooks, []}.
===> Running hooks for app_compile in app zipper (/Users/kenji/src/rebar3_format/_build/default/plugins/zipper) with configuration:
===>    {pre_hooks, []}.
===> Running hooks for app_compile in app katana_code (/Users/kenji/src/rebar3_format/_build/default/plugins/katana_code) with configuration:
===>    {pre_hooks, []}.
===> Running hooks for app_compile in app elvis_core (/Users/kenji/src/rebar3_format/_build/default/plugins/elvis_core) with configuration:
===>    {pre_hooks, []}.
===> Running hooks for app_compile in app rebar3_lint (/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_lint) with configuration:
===>    {pre_hooks, []}.
===> Running hooks for app_compile in app zipper (/Users/kenji/src/rebar3_format/_build/default/plugins/zipper) with configuration:
===>    {post_hooks, []}.
===> Running hooks for app_compile in app katana_code (/Users/kenji/src/rebar3_format/_build/default/plugins/katana_code) with configuration:
===>    {post_hooks, []}.
===> Running hooks for app_compile in app elvis_core (/Users/kenji/src/rebar3_format/_build/default/plugins/elvis_core) with configuration:
===>    {post_hooks, []}.
===> Running hooks for app_compile in app rebar3_lint (/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_lint) with configuration:
===>    {post_hooks, []}.
===> Running hooks for compile in app zipper (/Users/kenji/src/rebar3_format/_build/default/plugins/zipper) with configuration:
===>    {post_hooks, []}.
===> Running hooks for compile in app katana_code (/Users/kenji/src/rebar3_format/_build/default/plugins/katana_code) with configuration:
===>    {post_hooks, []}.
===> Running hooks for compile in app elvis_core (/Users/kenji/src/rebar3_format/_build/default/plugins/elvis_core) with configuration:
===>    {post_hooks, []}.
===> Running hooks for compile in app rebar3_lint (/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_lint) with configuration:
===>    {post_hooks, []}.
===> Fetching rebar3_sheldon v0.4.2
===> Making request to get package rebar3_sheldon from repo hexpm
===> Version cached at /Users/kenji/.cache/rebar3/hex/hexpm/packages/rebar3_sheldon-0.4.2.tar is up to date, reusing it
===> 25.0.2 satisfies the requirement for minimum OTP version 21
===> Fetching sheldon v0.4.1
===> Making request to get package sheldon from repo hexpm
===> Version cached at /Users/kenji/.cache/rebar3/hex/hexpm/packages/sheldon-0.4.1.tar is up to date, reusing it
===> 25.0.2 satisfies the requirement for minimum OTP version 21
===> Fetching worker_pool v5.1.0
===> Making request to get package worker_pool from repo hexpm
===> Version cached at /Users/kenji/.cache/rebar3/hex/hexpm/packages/worker_pool-5.1.0.tar is up to date, reusing it
===> 25.0.2 satisfies the requirement for minimum OTP version 21
===> Compile (apps)
===> Running hooks for compile in app worker_pool (/Users/kenji/src/rebar3_format/_build/default/plugins/worker_pool) with configuration:
===>    {pre_hooks, []}.
===> Running hooks for compile in app sheldon (/Users/kenji/src/rebar3_format/_build/default/plugins/sheldon) with configuration:
===>    {pre_hooks, []}.
===> Running hooks for compile in app rebar3_sheldon (/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_sheldon) with configuration:
===>    {pre_hooks, []}.
===> Running hooks for erlc_compile in app worker_pool (/Users/kenji/src/rebar3_format/_build/default/plugins/worker_pool) with configuration:
===>    {pre_hooks, []}.
===> Running hooks for erlc_compile in app sheldon (/Users/kenji/src/rebar3_format/_build/default/plugins/sheldon) with configuration:
===>    {pre_hooks, []}.
===> Running hooks for erlc_compile in app rebar3_sheldon (/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_sheldon) with configuration:
===>    {pre_hooks, []}.
===> Analyzing applications...
===> Compiling worker_pool
===> compile options: {erl_opts, [warn_unused_vars,ewarn_export_all,
                                         warn_shadow_vars,warn_unused_import,
                                         warn_unused_function,warn_bif_clash,
                                         warn_unused_record,
                                         warn_deprecated_function,
                                         warn_obsolete_guard,
                                         strict_validation,warn_export_vars,
                                         warn_exported_vars,warn_missing_spec,
                                         warn_untyped_record,debug_info]}.
===> files to analyze ["/Users/kenji/src/rebar3_format/_build/default/plugins/worker_pool/src/wpool_process_callbacks.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/worker_pool/src/wpool_process_sup.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/worker_pool/src/wpool_process.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/worker_pool/src/wpool_queue_manager.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/worker_pool/src/wpool.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/worker_pool/src/wpool_time_checker.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/worker_pool/src/wpool_sup.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/worker_pool/src/wpool_utils.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/worker_pool/src/wpool_worker.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/worker_pool/src/wpool_pool.erl"]
===>      Compiled wpool_sup.erl
===>      Compiled wpool_utils.erl
===>      Compiled wpool_worker.erl
===>      Compiled wpool_process_sup.erl
===>      Compiled wpool_process_callbacks.erl
===>      Compiled wpool.erl
===>      Compiled wpool_time_checker.erl
===>      Compiled wpool_queue_manager.erl
===>      Compiled wpool_pool.erl
===>      Compiled wpool_process.erl
===> Compiling sheldon
===> compile options: {erl_opts, [warn_unused_vars,warn_export_all,
                                         warn_shadow_vars,warn_unused_import,
                                         warn_unused_function,warn_bif_clash,
                                         warn_unused_record,
                                         warn_deprecated_function,
                                         warn_obsolete_guard,
                                         strict_validation,warn_export_vars,
                                         warn_exported_vars,warn_missing_spec,
                                         warn_untyped_record,debug_info]}.
===> files to analyze ["/Users/kenji/src/rebar3_format/_build/default/plugins/sheldon/src/sheldon_sup.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/sheldon/src/sheldon_dictionary.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/sheldon/src/sheldon_app.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/sheldon/src/sheldon_suggestions_server.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/sheldon/src/sheldon.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/sheldon/src/sheldon_utils.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/sheldon/src/adapter/markdown_adapter.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/sheldon/src/adapter/html_adapter.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/sheldon/src/adapter/sheldon_adapter.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/sheldon/src/sheldon_config.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/sheldon/src/sheldon_result.erl"]
===>      Compiled sheldon_adapter.erl
===>      Compiled sheldon_result.erl
===>      Compiled sheldon_app.erl
===>      Compiled sheldon_sup.erl
===>      Compiled sheldon_utils.erl
===>      Compiled sheldon_config.erl
===>      Compiled sheldon_suggestions_server.erl
===>      Compiled markdown_adapter.erl
===>      Compiled html_adapter.erl
===>      Compiled sheldon_dictionary.erl
===>      Compiled sheldon.erl
===> Compiling rebar3_sheldon
===> compile options: {erl_opts, [debug_info,warn_export_vars,
                                         warn_missing_spec_all,
                                         warn_unused_import,
                                         warnings_as_errors,
                                         {i,"src"}]}.
===> files to analyze ["/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_sheldon/src/rebar3_sheldon_prv.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_sheldon/src/rebar3_sheldon.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_sheldon/src/rebar3_sheldon_ast.erl"]
===>      Compiled rebar3_sheldon.erl
===>      Compiled rebar3_sheldon_ast.erl
===>      Compiled rebar3_sheldon_prv.erl
===> Running hooks for erlc_compile in app worker_pool (/Users/kenji/src/rebar3_format/_build/default/plugins/worker_pool) with configuration:
===>    {post_hooks, []}.
===> Running hooks for erlc_compile in app sheldon (/Users/kenji/src/rebar3_format/_build/default/plugins/sheldon) with configuration:
===>    {post_hooks, []}.
===> Running hooks for erlc_compile in app rebar3_sheldon (/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_sheldon) with configuration:
===>    {post_hooks, []}.
===> Running hooks for app_compile in app worker_pool (/Users/kenji/src/rebar3_format/_build/default/plugins/worker_pool) with configuration:
===>    {pre_hooks, []}.
===> Running hooks for app_compile in app sheldon (/Users/kenji/src/rebar3_format/_build/default/plugins/sheldon) with configuration:
===>    {pre_hooks, []}.
===> Running hooks for app_compile in app rebar3_sheldon (/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_sheldon) with configuration:
===>    {pre_hooks, []}.
===> Running hooks for app_compile in app worker_pool (/Users/kenji/src/rebar3_format/_build/default/plugins/worker_pool) with configuration:
===>    {post_hooks, []}.
===> Running hooks for app_compile in app sheldon (/Users/kenji/src/rebar3_format/_build/default/plugins/sheldon) with configuration:
===>    {post_hooks, []}.
===> Running hooks for app_compile in app rebar3_sheldon (/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_sheldon) with configuration:
===>    {post_hooks, []}.
===> Running hooks for compile in app worker_pool (/Users/kenji/src/rebar3_format/_build/default/plugins/worker_pool) with configuration:
===>    {post_hooks, []}.
===> Running hooks for compile in app sheldon (/Users/kenji/src/rebar3_format/_build/default/plugins/sheldon) with configuration:
===>    {post_hooks, []}.
===> Running hooks for compile in app rebar3_sheldon (/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_sheldon) with configuration:
===>    {post_hooks, []}.
===> Fetching rebar3_ex_doc v0.2.12
===> Making request to get package rebar3_ex_doc from repo hexpm
===> Version cached at /Users/kenji/.cache/rebar3/hex/hexpm/packages/rebar3_ex_doc-0.2.12.tar is up to date, reusing it
===> Compile (apps)
===> Running hooks for compile in app rebar3_ex_doc (/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_ex_doc) with configuration:
===>    {pre_hooks, []}.
===> Running hooks for erlc_compile in app rebar3_ex_doc (/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_ex_doc) with configuration:
===>    {pre_hooks, []}.
===> Analyzing applications...
===> Compiling rebar3_ex_doc
===> compile options: {erl_opts, [debug_info]}.
===> files to analyze ["/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_ex_doc/src/rebar3_ex_doc.erl"]
===>      Compiled rebar3_ex_doc.erl
===> Running hooks for erlc_compile in app rebar3_ex_doc (/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_ex_doc) with configuration:
===>    {post_hooks, []}.
===> Running hooks for app_compile in app rebar3_ex_doc (/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_ex_doc) with configuration:
===>    {pre_hooks, []}.
===> Running hooks for app_compile in app rebar3_ex_doc (/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_ex_doc) with configuration:
===>    {post_hooks, []}.
===> Running hooks for compile in app rebar3_ex_doc (/Users/kenji/src/rebar3_format/_build/default/plugins/rebar3_ex_doc) with configuration:
===>    {post_hooks, []}.
===> Expanded command sequence to be run: [app_discovery,install_deps,lock,compile]
===> Running provider: app_discovery
===> Found top-level apps: [rebar3_format]
    using config: [{src_dirs,["src"]},{lib_dirs,["apps/*","lib/*","."]}]
===> 25.0.2 satisfies the requirement for minimum OTP version 23
===> Running provider: install_deps
===> Verifying dependencies...
===> Fetching katana_code v2.0.0
===> Making request to get package katana_code from repo hexpm
===> Version cached at /Users/kenji/.cache/rebar3/hex/hexpm/packages/katana_code-2.0.0.tar is up to date, reusing it
===> 25.0.2 satisfies the requirement for minimum OTP version 23
===> Running provider: lock
===> Running provider: compile
===> Compile (apps)
===> Running hooks for compile in app katana_code (/Users/kenji/src/rebar3_format/_build/default/lib/katana_code) with configuration:
===>    {pre_hooks, []}.
===> Running hooks for erlc_compile in app katana_code (/Users/kenji/src/rebar3_format/_build/default/lib/katana_code) with configuration:
===>    {pre_hooks, []}.
===> Analyzing applications...
===> Compiling katana_code
===> compile options: {erl_opts, [warn_unused_import,warn_export_vars,
                                         warnings_as_errors,verbose,report,
                                         debug_info,
                                         {feature,maybe_expr,enable}]}.
===> files to analyze ["/Users/kenji/src/rebar3_format/_build/default/lib/katana_code/src/ktn_io_string.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/lib/katana_code/src/ktn_code.erl",
                              "/Users/kenji/src/rebar3_format/_build/default/lib/katana_code/src/ktn_dodger.erl"]
===>      Compiled ktn_io_string.erl
===>      Compiled ktn_code.erl
===>      Compiled ktn_dodger.erl
===> Running hooks for erlc_compile in app katana_code (/Users/kenji/src/rebar3_format/_build/default/lib/katana_code) with configuration:
===>    {post_hooks, []}.
===> Running hooks for app_compile in app katana_code (/Users/kenji/src/rebar3_format/_build/default/lib/katana_code) with configuration:
===>    {pre_hooks, []}.
===> Running hooks for app_compile in app katana_code (/Users/kenji/src/rebar3_format/_build/default/lib/katana_code) with configuration:
===>    {post_hooks, []}.
===> Running hooks for compile in app katana_code (/Users/kenji/src/rebar3_format/_build/default/lib/katana_code) with configuration:
===>    {post_hooks, []}.
===> Running hooks for compile with configuration:
===>    {pre_hooks, []}.
===> Compile (project_apps)
===> Running hooks for compile in app rebar3_format (/Users/kenji/src/rebar3_format) with configuration:
===>    {pre_hooks, []}.
===> Running hooks for erlc_compile in app rebar3_format (/Users/kenji/src/rebar3_format) with configuration:
===>    {pre_hooks, []}.
===> Analyzing applications...
===> Compiling rebar3_format
===> compile options: {erl_opts, [warn_unused_import,warn_export_vars,
                                         verbose,report,debug_info]}.
===> files to analyze ["/Users/kenji/src/rebar3_format/src/formatters/sr_formatter.erl",
                              "/Users/kenji/src/rebar3_format/src/formatters/default_formatter.erl",
                              "/Users/kenji/src/rebar3_format/src/formatters/erlfmt_formatter.erl",
                              "/Users/kenji/src/rebar3_format/src/formatters/otp_formatter.erl",
                              "/Users/kenji/src/rebar3_format/src/rebar3_formatter.erl",
                              "/Users/kenji/src/rebar3_format/src/rebar3_format_prv.erl",
                              "/Users/kenji/src/rebar3_format/src/rebar3_format.erl",
                              "/Users/kenji/src/rebar3_format/src/rebar3_ast_formatter.erl"]
===>      Compiled rebar3_formatter.erl
===>      Compiled rebar3_ast_formatter.erl
===>      Compiled rebar3_format.erl
===>      Compiled sr_formatter.erl
===>      Compiled erlfmt_formatter.erl
===>      Compiled rebar3_format_prv.erl
===>      Compiled otp_formatter.erl
===>      Compiled default_formatter.erl
===> Running hooks for erlc_compile in app rebar3_format (/Users/kenji/src/rebar3_format) with configuration:
===>    {post_hooks, []}.
===> Running hooks for app_compile in app rebar3_format (/Users/kenji/src/rebar3_format) with configuration:
===>    {pre_hooks, []}.
===> Running hooks for app_compile in app rebar3_format (/Users/kenji/src/rebar3_format) with configuration:
===>    {post_hooks, []}.
===> Running hooks for compile in app rebar3_format (/Users/kenji/src/rebar3_format) with configuration:
===>    {post_hooks, [{compile,"escript priv/scripts/format"}]}.
escript: exception error: undefined function ktn_dodger:parse_file/2
  in function  rebar3_ast_formatter:format/3 (/Users/kenji/src/rebar3_format/src/rebar3_ast_formatter.erl, line 17)
  in call from lists:foreach_1/2 (lists.erl, line 1442)
  in call from erl_eval:local_func/8 (erl_eval.erl, line 644)
  in call from escript:interpret/4 (escript.erl, line 780)
  in call from escript:start/1 (escript.erl, line 277)
  in call from init:start_em/1
  in call from init:do_boot/3
===> Hook for compile failed!

Additional context

This is possibly an issue of https://github.com/inaka/katana-code.

elbrujohalcon commented 2 years ago

Yeah… You need to enable the new features. This is what we do on CI:

      ERL_FLAGS="-enable-feature all"
jj1bdx commented 2 years ago

@elbrujohalcon Thanks. So do I always have to add the execution option ERL_FLAGS="-enable-feature all" to run the rebar3_format?

elbrujohalcon commented 2 years ago

I'm afraid so… but keep in mind that this will start happening more and more often with other libraries as well. Everybody that uses maybe in a lib will require you to have that flag on every time you want to use their lib. You'll eventually have to have that flag on by default for all your Erlang projects. 🤷🏻

jj1bdx commented 2 years ago

OK Brujo thanks for the comment. I have no complaint nor objection against the maybe feature either (in fact I like it!), so I guess we need to establish a good practice to acquire these newer pieces of code. :smile: