{"action":"created","comment":{"url":"https://api.github.com/repos/elixir-lang/elixir/pulls/comments/57916692","id":57916692,"diff_hunk":"@@ -59,4 +59,30 @@ defmodule Mix.Tasks.Compile.ErlangTest do\n       refute File.regular?(\"_build/dev/lib/sample/ebin/b.beam\")\n     end\n   end\n+\n+  test \"compilation purges the module\" do\n+    in_fixture \"compile_erlang\", fn ->\n+      File.write! \"src/purge_test.erl\", \"\"\"\n+      -module(purge_test).\n+      -compile(export_all).\n+      fn() -> v1.\n+      \"\"\"\n+      assert Mix.Tasks.Compile.Erlang.run([]) == :ok\n+      # make sure the older version of the module is loaded\n+      assert :v1 == :purge_test.fn\n+\n+      # change the source code\n+      File.write! \"src/purge_test.erl\", \"\"\"\n+      -module(purge_test).\n+      -compile(export_all).\n+      fn() -> v2.\n+      \"\"\"\n+\n+      # force recompile\n+      assert Mix.Tasks.Compile.Erlang.run([\"--force\"]) == :ok\n+\n+      # if the module was not purged on recompilation, this would fail","path":"lib/mix/test/mix/tasks/compile.erlang_test.exs","position":26,"original_position":26,"commit_id":"98647084137b70726fa0ebf964993a8b4b228775","original_commit_id":"98647084137b70726fa0ebf964993a8b4b228775","user":{"login":"whatyouhide","id":3890250,"avatar_url":"https://avatars.githubusercontent.com/u/3890250?v=3","gravatar_id":"","url":"https://api.github.com/users/whatyouhide","html_url":"https://github.com/whatyouhide","followers_url":"https://api.github.com/users/whatyouhide/followers","following_url":"https://api.github.com/users/whatyouhide/following{/other_user}","gists_url":"https://api.github.com/users/whatyouhide/gists{/gist_id}","starred_url":"https://api.github.com/users/whatyouhide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whatyouhide/subscriptions","organizations_url":"https://api.github.com/users/whatyouhide/orgs","repos_url":"https://api.github.com/users/whatyouhide/repos","events_url":"https://api.github.com/users/whatyouhide/events{/privacy}","received_events_url":"https://api.github.com/users/whatyouhide/received_events","type":"User","site_admin":false},"body":"Extremely small nitpick: what if we use capital letters as the first letter in comments, and a trailing period? That seems to be the most common style in the codebase :)","created_at":"2016-03-30T16:11:08Z","updated_at":"2016-03-30T16:11:08Z","html_url":"https://github.com/elixir-lang/elixir/pull/4453#discussion_r57916692","pull_request_url":"https://api.github.com/repos/elixir-lang/elixir/pulls/4453","_links":{"self":{"href":"https://api.github.com/repos/elixir-lang/elixir/pulls/comments/57916692"},"html":{"href":"https://github.com/elixir-lang/elixir/pull/4453#discussion_r57916692"},"pull_request":{"href":"https://api.github.com/repos/elixir-lang/elixir/pulls/4453"}}},"pull_request":{"url":"https://api.github.com/repos/elixir-lang/elixir/pulls/4453","id":64652711,"html_url":"https://github.com/elixir-lang/elixir/pull/4453","diff_url":"https://github.com/elixir-lang/elixir/pull/4453.diff","patch_url":"https://github.com/elixir-lang/elixir/pull/4453.patch","issue_url":"https://api.github.com/repos/elixir-lang/elixir/issues/4453","number":4453,"state":"open","locked":false,"title":"purge erlang modules on recompilation","user":{"login":"sasa1977","id":202498,"avatar_url":"https://avatars.githubusercontent.com/u/202498?v=3","gravatar_id":"","url":"https://api.github.com/users/sasa1977","html_url":"https://github.com/sasa1977","followers_url":"https://api.github.com/users/sasa1977/followers","following_url":"https://api.github.com/users/sasa1977/following{/other_user}","gists_url":"https://api.github.com/users/sasa1977/gists{/gist_id}","starred_url":"https://api.github.com/users/sasa1977/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sasa1977/subscriptions","organizations_url":"https://api.github.com/users/sasa1977/orgs","repos_url":"https://api.github.com/users/sasa1977/repos","events_url":"https://api.github.com/users/sasa1977/events{/privacy}","received_events_url":"https://api.github.com/users/sasa1977/received_events","type":"User","site_admin":false},"body":"The issue is described [here](https://groups.google.com/forum/#!topic/elixir-lang-talk/2qvsQ9A2-6g)\r\n\r\ntl;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.\r\n","created_at":"2016-03-30T16:00:48Z","updated_at":"2016-03-30T16:11:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"075553f1bcd7d1c04b1a76257c20ecdae16da42c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/elixir-lang/elixir/pulls/4453/commits","review_comments_url":"https://api.github.com/repos/elixir-lang/elixir/pulls/4453/comments","review_comment_url":"https://api.github.com/repos/elixir-lang/elixir/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elixir-lang/elixir/issues/4453/comments","statuses_url":"https://api.github.com/repos/elixir-lang/elixir/statuses/98647084137b70726fa0ebf964993a8b4b228775","head":{"label":"sasa1977:purge-erlang-modules-on-recompilation","ref":"purge-erlang-modules-on-recompilation","sha":"98647084137b70726fa0ebf964993a8b4b228775","user":{"login":"sasa1977","id":202498,"avatar_url":"https://avatars.githubusercontent.com/u/202498?v=3","gravatar_id":"","url":"https://api.github.com/users/sasa1977","html_url":"https://github.com/sasa1977","followers_url":"https://api.github.com/users/sasa1977/followers","following_url":"https://api.github.com/users/sasa1977/following{/other_user}","gists_url":"https://api.github.com/users/sasa1977/gists{/gist_id}","starred_url":"https://api.github.com/users/sasa1977/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sasa1977/subscriptions","organizations_url":"https://api.github.com/users/sasa1977/orgs","repos_url":"https://api.github.com/users/sasa1977/repos","events_url":"https://api.github.com/users/sasa1977/events{/privacy}","received_events_url":"https://api.github.com/users/sasa1977/received_events","type":"User","site_admin":false},"repo":{"id":10401889,"name":"elixir","full_name":"sasa1977/elixir","owner":{"login":"sasa1977","id":202498,"avatar_url":"https://avatars.githubusercontent.com/u/202498?v=3","gravatar_id":"","url":"https://api.github.com/users/sasa1977","html_url":"https://github.com/sasa1977","followers_url":"https://api.github.com/users/sasa1977/followers","following_url":"https://api.github.com/users/sasa1977/following{/other_user}","gists_url":"https://api.github.com/users/sasa1977/gists{/gist_id}","starred_url":"https://api.github.com/users/sasa1977/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sasa1977/subscriptions","organizations_url":"https://api.github.com/users/sasa1977/orgs","repos_url":"https://api.github.com/users/sasa1977/repos","events_url":"https://api.github.com/users/sasa1977/events{/privacy}","received_events_url":"https://api.github.com/users/sasa1977/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sasa1977/elixir","description":"Elixir is a metaprogrammable, functional language built atop the Erlang VM. It is a dynamic language with hygenic macros that leverages Erlang's ability to build concurrent, distributed, and fault-tolerant applications with hot code upgrades.","fork":true,"url":"https://api.github.com/repos/sasa1977/elixir","forks_url":"https://api.github.com/repos/sasa1977/elixir/forks","keys_url":"https://api.github.com/repos/sasa1977/elixir/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sasa1977/elixir/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sasa1977/elixir/teams","hooks_url":"https://api.github.com/repos/sasa1977/elixir/hooks","issue_events_url":"https://api.github.com/repos/sasa1977/elixir/issues/events{/number}","events_url":"https://api.github.com/repos/sasa1977/elixir/events","assignees_url":"https://api.github.com/repos/sasa1977/elixir/assignees{/user}","branches_url":"https://api.github.com/repos/sasa1977/elixir/branches{/branch}","tags_url":"https://api.github.com/repos/sasa1977/elixir/tags","blobs_url":"https://api.github.com/repos/sasa1977/elixir/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sasa1977/elixir/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sasa1977/elixir/git/refs{/sha}","trees_url":"https://api.github.com/repos/sasa1977/elixir/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sasa1977/elixir/statuses/{sha}","languages_url":"https://api.github.com/repos/sasa1977/elixir/languages","stargazers_url":"https://api.github.com/repos/sasa1977/elixir/stargazers","contributors_url":"https://api.github.com/repos/sasa1977/elixir/contributors","subscribers_url":"https://api.github.com/repos/sasa1977/elixir/subscribers","subscription_url":"https://api.github.com/repos/sasa1977/elixir/subscription","commits_url":"https://api.github.com/repos/sasa1977/elixir/commits{/sha}","git_commits_url":"https://api.github.com/repos/sasa1977/elixir/git/commits{/sha}","comments_url":"https://api.github.com/repos/sasa1977/elixir/comments{/number}","issue_comment_url":"https://api.github.com/repos/sasa1977/elixir/issues/comments{/number}","contents_url":"https://api.github.com/repos/sasa1977/elixir/contents/{+path}","compare_url":"https://api.github.com/repos/sasa1977/elixir/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sasa1977/elixir/merges","archive_url":"https://api.github.com/repos/sasa1977/elixir/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sasa1977/elixir/downloads","issues_url":"https://api.github.com/repos/sasa1977/elixir/issues{/number}","pulls_url":"https://api.github.com/repos/sasa1977/elixir/pulls{/number}","milestones_url":"https://api.github.com/repos/sasa1977/elixir/milestones{/number}","notifications_url":"https://api.github.com/repos/sasa1977/elixir/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sasa1977/elixir/labels{/name}","releases_url":"https://api.github.com/repos/sasa1977/elixir/releases{/id}","deployments_url":"https://api.github.com/repos/sasa1977/elixir/deployments","created_at":"2013-05-31T09:30:33Z","updated_at":"2015-03-07T21:35:47Z","pushed_at":"2016-03-30T15:57:23Z","git_url":"git://github.com/sasa1977/elixir.git","ssh_url":"git@github.com:sasa1977/elixir.git","clone_url":"https://github.com/sasa1977/elixir.git","svn_url":"https://github.com/sasa1977/elixir","homepage":"http://elixir-lang.org/","size":33741,"stargazers_count":0,"watchers_count":0,"language":"Elixir","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"elixir-lang:master","ref":"master","sha":"2cc72abf9d6786128c8906e37cf4cc63617a2787","user":{"login":"elixir-lang","id":1481354,"avatar_url":"https://avatars.githubusercontent.com/u/1481354?v=3","gravatar_id":"","url":"https://api.github.com/users/elixir-lang","html_url":"https://github.com/elixir-lang","followers_url":"https://api.github.com/users/elixir-lang/followers","following_url":"https://api.github.com/users/elixir-lang/following{/other_user}","gists_url":"https://api.github.com/users/elixir-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/elixir-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elixir-lang/subscriptions","organizations_url":"https://api.github.com/users/elixir-lang/orgs","repos_url":"https://api.github.com/users/elixir-lang/repos","events_url":"https://api.github.com/users/elixir-lang/events{/privacy}","received_events_url":"https://api.github.com/users/elixir-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":1234714,"name":"elixir","full_name":"elixir-lang/elixir","owner":{"login":"elixir-lang","id":1481354,"avatar_url":"https://avatars.githubusercontent.com/u/1481354?v=3","gravatar_id":"","url":"https://api.github.com/users/elixir-lang","html_url":"https://github.com/elixir-lang","followers_url":"https://api.github.com/users/elixir-lang/followers","following_url":"https://api.github.com/users/elixir-lang/following{/other_user}","gists_url":"https://api.github.com/users/elixir-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/elixir-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elixir-lang/subscriptions","organizations_url":"https://api.github.com/users/elixir-lang/orgs","repos_url":"https://api.github.com/users/elixir-lang/repos","events_url":"https://api.github.com/users/elixir-lang/events{/privacy}","received_events_url":"https://api.github.com/users/elixir-lang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elixir-lang/elixir","description":"Elixir is a dynamic, functional language designed for building scalable and maintainable applications","fork":false,"url":"https://api.github.com/repos/elixir-lang/elixir","forks_url":"https://api.github.com/repos/elixir-lang/elixir/forks","keys_url":"https://api.github.com/repos/elixir-lang/elixir/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elixir-lang/elixir/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elixir-lang/elixir/teams","hooks_url":"https://api.github.com/repos/elixir-lang/elixir/hooks","issue_events_url":"https://api.github.com/repos/elixir-lang/elixir/issues/events{/number}","events_url":"https://api.github.com/repos/elixir-lang/elixir/events","assignees_url":"https://api.github.com/repos/elixir-lang/elixir/assignees{/user}","branches_url":"https://api.github.com/repos/elixir-lang/elixir/branches{/branch}","tags_url":"https://api.github.com/repos/elixir-lang/elixir/tags","blobs_url":"https://api.github.com/repos/elixir-lang/elixir/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elixir-lang/elixir/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elixir-lang/elixir/git/refs{/sha}","trees_url":"https://api.github.com/repos/elixir-lang/elixir/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elixir-lang/elixir/statuses/{sha}","languages_url":"https://api.github.com/repos/elixir-lang/elixir/languages","stargazers_url":"https://api.github.com/repos/elixir-lang/elixir/stargazers","contributors_url":"https://api.github.com/repos/elixir-lang/elixir/contributors","subscribers_url":"https://api.github.com/repos/elixir-lang/elixir/subscribers","subscription_url":"https://api.github.com/repos/elixir-lang/elixir/subscription","commits_url":"https://api.github.com/repos/elixir-lang/elixir/commits{/sha}","git_commits_url":"https://api.github.com/repos/elixir-lang/elixir/git/commits{/sha}","comments_url":"https://api.github.com/repos/elixir-lang/elixir/comments{/number}","issue_comment_url":"https://api.github.com/repos/elixir-lang/elixir/issues/comments{/number}","contents_url":"https://api.github.com/repos/elixir-lang/elixir/contents/{+path}","compare_url":"https://api.github.com/repos/elixir-lang/elixir/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elixir-lang/elixir/merges","archive_url":"https://api.github.com/repos/elixir-lang/elixir/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elixir-lang/elixir/downloads","issues_url":"https://api.github.com/repos/elixir-lang/elixir/issues{/number}","pulls_url":"https://api.github.com/repos/elixir-lang/elixir/pulls{/number}","milestones_url":"https://api.github.com/repos/elixir-lang/elixir/milestones{/number}","notifications_url":"https://api.github.com/repos/elixir-lang/elixir/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elixir-lang/elixir/labels{/name}","releases_url":"https://api.github.com/repos/elixir-lang/elixir/releases{/id}","deployments_url":"https://api.github.com/repos/elixir-lang/elixir/deployments","created_at":"2011-01-09T08:43:57Z","updated_at":"2016-03-30T13:35:43Z","pushed_at":"2016-03-30T16:00:49Z","git_url":"git://github.com/elixir-lang/elixir.git","ssh_url":"git@github.com:elixir-lang/elixir.git","clone_url":"https://github.com/elixir-lang/elixir.git","svn_url":"https://github.com/elixir-lang/elixir","homepage":"http://elixir-lang.org/","size":42291,"stargazers_count":6604,"watchers_count":6604,"language":"Elixir","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":895,"mirror_url":null,"open_issues_count":44,"forks":895,"open_issues":44,"watchers":6604,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elixir-lang/elixir/pulls/4453"},"html":{"href":"https://github.com/elixir-lang/elixir/pull/4453"},"issue":{"href":"https://api.github.com/repos/elixir-lang/elixir/issues/4453"},"comments":{"href":"https://api.github.com/repos/elixir-lang/elixir/issues/4453/comments"},"review_comments":{"href":"https://api.github.com/repos/elixir-lang/elixir/pulls/4453/comments"},"review_comment":{"href":"https://api.github.com/repos/elixir-lang/elixir/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elixir-lang/elixir/pulls/4453/commits"},"statuses":{"href":"https://api.github.com/repos/elixir-lang/elixir/statuses/98647084137b70726fa0ebf964993a8b4b228775"}}}}