elixir-lang/elixir

Compile project using relative paths

Closed this issue · 3 comments

This will allow projects to be moved without recompiling it.

Did we find a solution to the fact that BEAM files contain absolute paths?

If I remember correctly, this was the reason for the recompilation: #12462

Or perhaps we should use a different mechanism to track module -> file relation, e.g. with a new __info__ clause?

I am thinking we will add relative paths to source info. Unless we have something that explicitly that forbids that, which I am not sure is the case. The difference is that escripts, archives, and Elixir itself will have to disable this option (or do a post-pass that expands them). Dependencies should be relative to the project cwd (and not to the dependency).

Unfortunately, there are too many complications for adopting this in general. I wanted to pursue this to support work trees better, but perhaps an option in said case is to simply pass a flag that disables the recompilation pointed out by @sabiwara, as in said cases the original source is still there.