Skip to content

Conversation

@sabiwara
Copy link
Contributor

Without this, moving or copying a directory would not recompile beam files despite the fact their :source absolute path is obsolete. This could create issues with ex_doc when generating links.

Without this, moving or copying a directory would not recompile
beam files despite the fact their :source absolute path is
obsolete. This could create issues with ex_doc.

File.touch!("_build/dev/lib/sample/.mix/compile.elixir", @old_time)

Code.put_compiler_option(:ignore_module_conflict, true)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I struggled to test this, I have no clear idea if my strategy is good.

Without this I would be getting:

warning: redefining module A (current version loaded from /Users/sabiwara/.../elixir/lib/mix/tmp/Mix.Tasks.Compile.ElixirTest/test recompiles project if working directory changed/_build/dev/lib/sample/ebin/Elixir.A.beam)
  lib/a.ex:1: A

Even using purge([A, B]) didn't remove this warning, my mix / :code knowledge is not enough here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly, I don’t think a test is necessary. We already test the cache and recompilation elsewhere, which are the important bits.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, will remove the test.
At least it got me confident that the fix was working as expected 🙂

@josevalim josevalim merged commit 3699d94 into elixir-lang:main Mar 12, 2023
@josevalim
Copy link
Member

💚 💙 💜 💛 ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants