-
Notifications
You must be signed in to change notification settings - Fork 3.5k
purge erlang modules on recompilation #4453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
purge erlang modules on recompilation #4453
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can call this (and above) fun
instead of fn
? Just not to mess with Elixir's keywords 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fun
is an Erlang keyword.
I suggest my_fun
as we usually do my_
prefixing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is Erlang code, so your reasoning is in fact why I called it fn :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh ahah, right 😄 Let's go with my_fun
or my_fn
then :)
Other extreme nitpick: can we use capital letters in the commit message as well? |
Sure, once you're done reviewing, I'll change the history and force push. |
And nitpicks apart, great job @sasa1977 💟 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test could be easier if you simply define an Elixir module before calling Compile.Erlang. Something like:
defmodule :purge_test do
def version, do: :v1
end
This way you don't need to write to disk and compile multiple times.
9864708
to
2def8da
Compare
OK, I think I addressed it all, squashed and force pushed. |
Merged and backported to v1.2 (new release coming this or next week). |
…ilation purge erlang modules on recompilation Signed-off-by: José Valim <jose.valim@plataformatec.com.br>
The issue is described here
tl;dr of it is that a situation can happen that a mix task works with an older version of the module written in Erlang. This can occur if some previous task, (e.g. Phoenix compiler) loaded the module before the Erlang compiler recompiled the code. The agreed solution is to make the Erlang compiler purge the module if it is about to be compiled.