changelog.com
changelog.com copied to clipboard
Docker: Get ElixirLS fully working in dev
Running the project on Docker has some inconsistencies. I'll try to note them as I go. This is one where we should make sure ElixirLS can run fully during development.
Gotta polish up the Docker way of running this stuff so Jerod can start using it ;)
{
"resource": "/root/changelog.com/mix.exs",
"owner": "_generated_diagnostic_collection_name_#0",
"severity": 8,
"message": "an exception was raised:\n ** (Mix.Error) Could not run `make`.\n Please check if `make` and either `clang` or `gcc` are installed\n\n /root/changelog.com/deps/cmark/mix.exs:88: Mix.Tasks.Compile.Cmark.run/1\n (mix 1.10.3) lib/mix/task.ex:330: Mix.Task.run_task/3\n (mix 1.10.3) lib/mix/tasks/compile.all.ex:76: Mix.Tasks.Compile.All.run_compiler/2\n (mix 1.10.3) lib/mix/tasks/compile.all.ex:56: Mix.Tasks.Compile.All.do_compile/4\n (mix 1.10.3) lib/mix/tasks/compile.all.ex:27: anonymous fn/2 in Mix.Tasks.Compile.All.run/1\n (mix 1.10.3) lib/mix/tasks/compile.all.ex:43: Mix.Tasks.Compile.All.with_logger_app/2\n (mix 1.10.3) lib/mix/task.ex:330: Mix.Task.run_task/3\n (mix 1.10.3) lib/mix/tasks/compile.ex:96: Mix.Tasks.Compile.run/1",
"source": "ElixirLS",
"startLineNumber": 1,
"startColumn": 1,
"endLineNumber": 1,
"endColumn": 1
}
If you run Elixir / Phoenix in Docker then your local code editor with ElixirLS isn't going to be aware of the libraries installed inside of Docker, because ElixirLS's view of the world is based on your local file system.
VSCode gets around this by having a "remote containers" feature which runs a VSCode server inside of your container. It does this behind the scenes without you having to configure much beyond a few lines of JSON, but this feature isn't something that a lot of code editors support. I think Jetbrains' editors might do something to support Docker too but you'll be out of luck with Vim and most other editors.
I'm on VSCode and I did install ElixirLS on my remote.. But hmm, I probably installed it on the server which runs my containers, not inside the containers.. Might work for normal people.
I no longer use Docker. Pretty sure that @jerodsanto doesn't use it either. @adamstac might, but I'm less certain.
Instead of continuing down this path, should we capture instead the manual steps of how to configure a dev environment? The message from https://shipit.show/44 still rings strong: "Document, document, document".
I know that Jerod had to do this setup recently, and I have a new Mac ARM where I did not set this up yet, so maybe between the two of us we can knock something together that would address this issue, and all the other Docker-related ones.
What do you all think?
I'm in favor of this, as long as we document on both macOS and Linux so that either path is 💯
I've done the macOS path in this PR: https://github.com/thechangelog/changelog.com/pull/434/files#diff-eca12c0a30e25b4b46522ebf89465a03ba72a03f540796c979137931d8f92055R88-R135
Can someone help with the Linux version?