bitwalker / distillery

Simplify deployments in Elixir with OTP releases!
MIT License
2.96k stars 396 forks source link

when set config with '/', release error #710

Closed ZXYCir closed 4 years ago

ZXYCir commented 4 years ago

Steps to reproduce

  1. set config with "/".
    config :maius, ExOauth2Provider, ... password_auth: &Maius.ProviderPwd.authenticate/2 ...
  2. release

Verbose Logs

Generated maius app
==> Assembling release..
==> Building release maius:0.2.0 using environment prod
==> Including ERTS 10.4 from /usr/lib/erlang/erts-10.4
==> Packaging release..
==> Release packaging failed due to errors:
    Cannot add file sys.config to tar file - [{error,{40,erl_parse,["syntax error before: ","'.'"]}}]

Description of issue

I use ExOauth2Provider to build a project. There is a config requiring that to fill with a function. And the function is contains "/" part. Then appears ~~

OvermindDL1 commented 4 years ago

That's not valid syntax for a config file. Something like &Blah.bloop/2 will create a function pointer, but that can't be represented in pure AST, which is what happens when a config file is lowered to an actual configuration file. There is nothing distillery can do about this and no library should be asking for such a format (if they are, report a bug). What they should be using is MFA.

ZXYCir commented 4 years ago

Thanks very much. That you've said is reasonable,I'm convinced.

OvermindDL1 commented 4 years ago

I opened an issue on the library causing the issue for you: https://github.com/danschultzer/ex_oauth2_provider/issues/65

It looks like they added support for that as a 'feature' a month ago, which of course breaks releases.

danschultzer commented 4 years ago

Oh, I'm taking a look at it. @ZXYCir it should work if you use password_auth: {Maius.ProviderPwd, :authenticate} in config file.

danschultzer commented 4 years ago

Fixed upstream. FYI this code wasn't released on hex so the configuration wouldn't have worked unless you were using the master branch.

ZXYCir commented 4 years ago

Oh, I'm taking a look at it. @ZXYCir it should work if you use password_auth: {Maius.ProviderPwd, :authenticate} in config file.

Thanks so much