tsloughter / rebar3_erlydtl_plugin

Rebar3 Erlydtl Plugin
Other
11 stars 33 forks source link

Compile error with OTP 27.0.1 #22

Closed benbro closed 4 months ago

benbro commented 4 months ago

I'm getting the following error when trying to compile a project with otp 27.0.1. I'm not sure if the error is in the erlydtl app or this plugin. Line 75 in erlydtl_beam_compiler.erl is "-include("erlydtl_ext.hrl")." default/plugins/erlydtl/include/erlydtl_ext.hrl exists so I'm not sure what causes the error. No error with otp 26.2.5.2 and same rebar3 version.

rebar3 --version
rebar 3.23.0 on Erlang/OTP 27 Erts 15.0.1
===> Fetching rebar3_erlydtl_plugin (from {git,"https://github.com/tsloughter/rebar3_erlydtl_plugin.git",
                                 {branch,"master"}})
===> Fetching erlydtl (from {git,"https://github.com/erlydtl/erlydtl.git",{branch,"master"}})
===> Analyzing applications...
===> Compiling erlydtl
===> Compiling _build/default/plugins/erlydtl/src/erlydtl_beam_compiler.erl failed
_build/default/plugins/erlydtl/src/erlydtl_beam_compiler.erl:75:10: can't find include file "erlydtl_ext.hrl"
_build/default/plugins/erlydtl/src/erlydtl_beam_compiler.erl:152:73: undefined macro 'ERR/2'
_build/default/plugins/erlydtl/src/erlydtl_beam_compiler.erl:190:77: undefined macro 'ERR/2'
_build/default/plugins/erlydtl/src/erlydtl_beam_compiler.erl:221:33: undefined macro 'ERR/2'
_build/default/plugins/erlydtl/src/erlydtl_beam_compiler.erl:247:14: undefined macro 'ERR/2'
_build/default/plugins/erlydtl/src/erlydtl_beam_compiler.erl:256:14: undefined macro 'WARN/2'
...many more errors...
tsloughter commented 4 months ago

What version of erlydtl is that using? I get no error building on OTP-27.

benbro commented 4 months ago

I'll try to create a simple app to reproduce. I also got an error with rebar3_appup_plugin https://github.com/lrascao/rebar3_appup_plugin/issues/71. I'll try to create a project without it. This is the relevant part in my rebar.config:

{plugins, [
    rebar3_appup_plugin,
    {rebar3_erlydtl_plugin, ".*",
     {git, "https://github.com/tsloughter/rebar3_erlydtl_plugin.git", {branch, "master"}}}
]}.

{provider_hooks, [
    {pre, [
        {tar, {appup, tar}},
        {compile, {erlydtl, compile}}
    ]},
    {post, [
        {compile, {appup, compile}},
        {clean, {appup, clean}}
    ]}
]}.

{erlydtl_opts, [{doc_root, "templates"}]}.
tsloughter commented 4 months ago

Does ./_build/default/plugins/erlydtl/include/erlydtl_ext.hrl exist?

tsloughter commented 4 months ago

Ok, so this is wild. I have now reproduced... What changed is instead of how i was testing, which was:

{plugins, [
    {rebar3_erlydtl_plugin, ".*",
     {git, "https://github.com/tsloughter/rebar3_erlydtl_plugin.git", {branch, "master"}}}
]}.

I instead used exactly your config of:

{plugins, [
    rebar3_appup_plugin,
    {rebar3_erlydtl_plugin, ".*",
     {git, "https://github.com/tsloughter/rebar3_erlydtl_plugin.git", {branch, "master"}}}
]}.

Makes no sense.

benbro commented 4 months ago

After upgrading bbmustache to 1.12.2 in rebar3_appup_plugin I get no error. https://github.com/lrascao/rebar3_appup_plugin/pull/72 You can test it here:

{plugins, [
    {rebar3_appup_plugin, ".*",
     {git, "https://github.com/benbro/rebar3_appup_plugin.git", {branch, "bbmustache"}}},
    {rebar3_erlydtl_plugin, ".*",
     {git, "https://github.com/tsloughter/rebar3_erlydtl_plugin.git", {branch, "master"}}}
]}.

Thanks

tsloughter commented 3 months ago

Interesting.