Description
Elixir and Erlang/OTP versions
erlang 25.2
elixir 1.14.3-otp-25
Operating system
MacOS - Ventura 13.1 - Apple M1 Max
Current behavior
As an engineer, when I switch between branches to provide peer review to other engineers, if dependencies changed across branches, I need to re-fetch and re-compile those dependencies. On larger projects this process can take 5-20 minutes, which can lead to slowdowns in pair programming and getting new pull requests tested, especially if I keep switching back to a local branch that I'm working on where dependencies have changed.
Reproduction steps:
- Start on a project that is branched off
main
- On that branch change dependencies in
mix.exs
(either add dependencies, remove dependencies, or upgrade dependencies) - Run
mix deps.get
- Run
iex -S mix phx.server
to compile dependencies and the project - Run
git checkout main
on that project - Run
iex -S mix phx.server
and observe an error saying the lockfile doesn't match the compiled dependencies and to runmix deps.get
- Run
mix deps.get
- Run
iex -S mix phx.server
and observe dependencies are re-compiled
Expected behavior
Here is a proposal for deps
and _build
that would be a breaking change to how the project is compiled and starts up, but would speed up development by caching the compiled versions of each dependency at the cost of more disk space (which is likely an acceptable tradeoff for most).
Sample filesystem structure:
project
deps
name_of_dependency
1.13.0
1.29.3
_build
lib
name_of_dependency
1.13.0
1.29.3
The expected outcome of this change would be when I switch between a branch that has dependency changes and a branch where I already compiled dependencies with different versions, there is no time-cost associated with compiling dependencies when I switch between those two branches after they've been compiled once each