-
Notifications
You must be signed in to change notification settings - Fork 196
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
ElixirLS not consistently recompiling dependencies #688
Comments
@TheFirstAvenger do you have a reliable way of reproducing it? I hit similar errors with mix but they are difficult to reproduce. |
@lukaszsamson the last paragraph has steps to reproduce. Check out that repo and swap between the tags |
We're also getting this consistently. As @TheFirstAvenger said it usually happens when switching branches or pulling down an updated mix file. We've tried recompiling deps (with and without --force) and it doesn't help -- the only thing that helps is to remove the |
I cannot reproduce the original problem on current master. 031bd0a fixed mix state handling. Now the behavior is different.
Restarting the server fixes build I think we need to detect changes to deps and force unload all modules from changed deps. |
Environment
Current behavior
ElixirLS is, in some cases, not recompiling dependencies after they are updated, forcing manual deletion of dependency in .elixir_ls/build directory. The dependencies have been downloaded correctly to the deps folder, and regular mix compile runs fine at the command prompt, as it has correctly determined the deps need to be recompiled. The issue seems to be that ElixirLS is only trying to recompile the project app and not consistently checking if the deps also need recompiling.
ElixirLS will report that dependencies are not up to date:
When I got this error message, I verified for
erlex
that thedeps
folder did have the correct0.2.6
version, as did the lock file, however.elixir_ls/build/_test/lib/erlex/ebin/erlex.app
listed0.2.5
.When it is in this state, restarting VSCode does not fix the problem. The only fix is to delete the build folder for the erroring dependencies or the entire .elixir_ls/build directory. For example, I resolved the above error by manually deleting the erlex, dialyxir, and excoveralls directories in
.elixir_ls/build/_test/lib
.This issue has been pretty common among projects when getting an updated mix file from git, e.g. swapping between branches that have different mix dependency versions. On my machine, was just able to reproduce this by simply checking out an older version of a project which had these dependencies changed, in my case it was ETS, and swapping between
master
,v0.8.0
andv0.7.0
.The text was updated successfully, but these errors were encountered: