i create .erlang.crypt like this
[{debug_info, des3_cbc, [], "12345"}].
run with this
ERL_COMPILER_OPTIONS='[encrypt_debug_info]' mix compile
iex -S mix
then
{:ok, {_, [{:abstract_code, {_, ac}}]}} = :beam_lib.chunks(:code.which(Elixir.Demo), [:abstract_code])
:io.fwrite("~s~n", [:erl_prettypr.format(:erl_syntax.form_list(ac))])
i can get the correct output.
but using distillery, i can not, here are the steps
method1:
i change the rel/config.exs to set erl_opts,
environment :prod do
set erl_opts: "encrypt_debug_info"
# set strip_debug_info: false
set include_erts: true
set include_src: false
set cookie: :"[&J)D@ss/1:xNY3zm[&![fWf!{xt6y}F>QQdIqRjvV*RoNHLT10ILC}~Wwf6.vo6"
set vm_args: "rel/vm.args"
end
but not working, when i input MIX_ENV=prod mix distillery.release --verbose
, erl_opts
is empty.
so i try to use method2
method2:
export ERL_COMPILER_OPTIONS='[encrypt_debug_info]'
MIX_ENV=prod mix distillery.release --verbose
_build/prod/rel/demo/bin/demo console
:beam_lib.chunks(:code.which(Elixir.Demo), [:abstract_code])
{:error, :beam_lib,
{:key_missing_or_invalid,
'/home/mmc/projects/elixir/demo/_build/prod/rel/demo/lib/demo-0.1.0/ebin/Elixir.Demo.beam',
:abstract_code}}
but my .erlang.crypt is ok, and if i do not use distillery, it is working fine, so is there any solution that i can fix it?