KronicDeth / intellij-elixir

Elixir plugin for JetBrain's IntelliJ Platform (including Rubymine)
Other
1.84k stars 153 forks source link

WSL: Selected directory is not a valid home for SDK #2499

Open ncs-pl opened 2 years ago

ncs-pl commented 2 years ago

Describe the bug Unable to setup Elixir SDK and Erlang SDK when IntelliJ is on Windows 10 and SDKs in WSL.

To Reproduce Steps to reproduce the behavior:

  1. Download erlang and elixir in WSL
  2. Try to import SDK in "Project structure"

Expected behavior SDKs should be set up, or even detected automatically

Desktop:

Erlang:

Elixir:

Plugin:

Additional context I know there are opened issues about WSL but they are old and seem to be outdated

sh41 commented 2 years ago

Hi,

I did some digging in the code and I wanted to document what I found in case anyone else is looking into this or #1911 to save them some time.

Currently the SDK checking code is not aware of WSL. The line that checks if the SDK is executable literally just looks for the bin\erl file in the selected path and runs the File.canExecute method to determine whether or not to continue. This is executing in the Windows environment and the executable is on WSL over a network share and so that file is not executable as far as the plugin is concerned.

I had a look at the git4idea plugin in intellij-community to see how they deal with this and it appears that there is a whole different code path for dealing with git under WSL. You can see parts of it here and here. Compare the Local data class with the Wsl data class to see the difference.

So it looks like this functionality is possible, but only by specifically coding for it. Hope that helps anyone looking into this!

ncs-pl commented 2 years ago

Oh I see, thanks for the information. Do you know if someone started fixing it (any MR)?

SirMishaa commented 2 years ago

Any up ? Really important for me :(

LijTesfaye commented 1 year ago

Any Updates here please? I'm facing the same issue today.

codecodemelon commented 1 year ago

The problem still exist. Hahaha. So Sad!

odilonjk commented 1 year ago

For those who really wanna use IntelliJ, one walkaround is to install IntelliJ on Linux (WSL) instead of Windows.