tsloughter / rebar3_erlydtl_plugin

Rebar3 Erlydtl Plugin
Other
11 stars 33 forks source link

Rebar3 release with Erlang 20 doesn't include the plugin correctly #19

Open marjaimate opened 6 years ago

marjaimate commented 6 years ago

I have a Rebar3 release generated, using this plugin. I was generating the release using Erlang 18.3 and never had a problem. Recently upgraded to 20.1 and kept getting an error on release generation:

$ rebar3 as prod release
===> Verifying dependencies...
===> Compiling tp_api
===> Running erlydtl...
===> Starting relx build process ...
===> Resolving OTP Applications from directories:
          /srv/www/tp_api/releases/20171011220543/_build/prod/lib
          /srv/www/tp_api/releases/20171011220543/ebin
          /usr/lib/erlang/lib

===> Failed to solve release:
 Dependency erlydtl is specified as a dependency but is not reachable by the system.

I had erlydtl declared as an application dependency in the app.src file. Now, after getting this, I've removed it from the app.src file, and got the release done. But inside the application, every time I tried to use the generated functions, got an undef error:

(node@127.0.0.1)2> my_template_dtl:render([{}]).
** exception error: undefined function erlydtl_runtime:init_translation/1
     in function  my_template_dtl:render_internal/2 (, line 534)
     in call from my_template_dtl:render/2 (, line 515)

Note - this only happens inside a release, when you compile and run it with rebar3, it works fine.

bullno1 commented 6 years ago

I have this problem too. It seems it's because the plugin depends on git master while the application depends on a certain tag or hex version and some confusion happened between rebar3 and relx.

Using overrides doesn't seem to help either.