You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support running through in WSL through VS Code Remote Development extensions #435
I'm afraid I don't understand what you're asking for. If I understand correctly, WSL is for running command line apps and Dart Code is not a command line app.
Dart Code (like VS Code and Dart) already works on Windows, Linux and Mac.
What I wanted to say, is to be able to use Dart-Code with Dart-Sdk installed in WSL not in Windows (run commands directly into the Bash)
I tried to set a custom sdkPath and proxy the commands (here an example wls-proxy ) the problem is that this extension requires an .exe in Windows but this method requires a .bat
So in this case a possible solution is to check if windows contains the bash and set this as 'dart.bat' instead of 'dart.exe' or have a config option that tells Dart-Code that is using WSL and run the .bat of the custom sdkPath
EDIT: As you mention it seems like the extension relies on more things that run executables , so I'm not sure if this is possible
Thanks for the extra info! Can you explain the motivation for this? What is the advantage to running in WSL versus just natively on Windows?
The Dart SDK is used for a couple of different things, from running your command line apps to also powering most of the editor experience (things like Intellisense, Error List, etc.).
My guess is that you probably only want this for the running of your app (eg. the editor works normally, but executing/debugging a command line app is run inside of WSL), is that right?
Exactly as you mention! I want to execute/debugging on Linux since is my target production enviroment I think is better to develop and ship in the same OS and is supposed to perform better
Windows is consuming 1GB+ ram and 60%+ of CPU just to compile and 900mb+ to server with pub... I'm not sure if just happend in windows since I'm newbie with Dart ^^'
Understood. I'll have to have a look at how this proxy works and understand exactly what needs to change. I haven't had much time to spend on Dart Code lately, so I can't make any promises about when it'll be.
Windows is consuming 1GB+ ram and 60%+ of CPU just to compile and 900mb+ to server with pub...
Which process is using the RAM/CPU? How big is the project? Probably best raising a separate case about that with info/screenshots.
The proxy is really easy, think it as a executable than can be added to the PATH env variable, it runs a command from windows to ubuntu, so for example php.bat will run "php" + the variables you send from the command line or program
So if you write "php -v" in the CMD this will run in the bash of Linux (if you have setup the env variable or call directly to the containing folder) and you can see what happend and interact from the CMD console just like it is installed on windows itself
I just noticed that the RAM and CPU problem is from Dart.exe itself so is not from the extension itself, in fact the project is just the tutorial so is pretty basic project
We use the SDK Path for multiple things (launching Dart but also the analysis server snapshot) so changing that isn't a good solution. We also probably don't want to run the analysis server inside WSL in case the proxying adds any latency (Dart Code communicates with it over STDIN/STDOUT).
So, probably the way to do this would be to allow you to specify a custom location for the Dart executable used for launching and debugging (since this is user-provided we don't need to make any assumptions about the file extension).
Some additional complications:
Can we connect to the debugger (we launch Dart with some flags that open a web server that we use to talk to the debugger - we need to be sure that inside WSL when it's binding to localhost ports we can connect to them as normal from the Windows side)
Do we need to map the paths for use inside WSL? (eg. if we run proxy\dart.bat C:\MyStuff\MyThing.bat can Dart inside WSL use that path? I guess not?)
If paths need translating, this will need doing in the debugger too, so that when we send breakpoints (or receive pause events) they are handled correctly. We already do a lot of path mapping for Flutter (since it runs on the remote device) so possibly we can extend that to work here
I had a quick Google, and it looks like path mapping is required, but probably quite straight forward:
Since we already send multiple paths per breakpoint (Dart, Flutter etc. are a little inconsistent) probably we can just do this conversion always to avoid you having to set an option to say it's WSL and paths need translating.
Again; I can't promise to look at this soon, but it does seem like a neat feature to support so I would like to have a go.
Serve apps from WSL are 100% accesible from Windows side, I've tested with Phoenix Elixir and works totally fine, no additinal config or something, so yeah we can connect to the debugger
Yeah in fact you can run bash commands inside any windows folder
I've not used flutter in a while already, so I'm not sure if the remote plugin works, tho I've use it a lot in different projects in rust, elixir, c++ and so without problem so I'd guess flutter will work just fine with a proper configuration
Using containers, Flutter is unable to connect to devices or emulators, so it doesn't really work currently. I haven't tried WSL though - when using WSL normally, can you connect to devices connected to the host machine? If so, I'll do some testing with WSL to see if it works for us here too.
changed the title [-]Supporting running through Ubuntu WSL / vglrun wrappers[/-][+]Supporting running through in WSL through VS Code Remote Development extensions[/+]on Jun 19, 2019
I'll use this issue to track ensuring everything works in WSL using the VS Code Remote Dev extensions.
I'm not familiar enough with vglrun to know whether the use case there can also be satisfied via WSL or Containers support (@algor if not, lmk and we should split this back out to another issue).
changed the title [-]Supporting running through in WSL through VS Code Remote Development extensions[/-][+]Support running through in WSL through VS Code Remote Development extensions[/+]on Jun 20, 2019
I did some testing using WSL with 3.2.1 and it seems to work fine:
You ofc need to ensure there's a Dart SDK inside WSL, and you seem to need to install the extension in it manually (go to the extensions side bar panel and click "Install in WSL").
I'm considering this working, but please to open new issues if you find any problems (or have any feature quests).
You ofc need to ensure there's a Dart SDK inside WSL, and you seem to need to install the extension in it manually (go to the extensions side bar panel and click "Install in WSL").
Is it necessary to install Dart SDK in WSL? can't I reuse the SDK in windows?
when I start vscode I get the following error message:
If I select "Locate SDK" and enter the Windows path (using /mnt/c/...)
I still get the same error
Activity
DanTup commentedon Oct 26, 2017
I'm afraid I don't understand what you're asking for. If I understand correctly, WSL is for running command line apps and Dart Code is not a command line app.
Dart Code (like VS Code and Dart) already works on Windows, Linux and Mac.
WolfDan commentedon Oct 26, 2017
Sorry I'm not english native ^^'
What I wanted to say, is to be able to use Dart-Code with Dart-Sdk installed in WSL not in Windows (run commands directly into the Bash)
I tried to set a custom sdkPath and proxy the commands (here an example wls-proxy ) the problem is that this extension requires an .exe in Windows but this method requires a .bat
So in this case a possible solution is to check if windows contains the bash and set this as 'dart.bat' instead of 'dart.exe' or have a config option that tells Dart-Code that is using WSL and run the .bat of the custom sdkPath
EDIT: As you mention it seems like the extension relies on more things that run executables , so I'm not sure if this is possible
DanTup commentedon Oct 26, 2017
Thanks for the extra info! Can you explain the motivation for this? What is the advantage to running in WSL versus just natively on Windows?
The Dart SDK is used for a couple of different things, from running your command line apps to also powering most of the editor experience (things like Intellisense, Error List, etc.).
My guess is that you probably only want this for the running of your app (eg. the editor works normally, but executing/debugging a command line app is run inside of WSL), is that right?
WolfDan commentedon Oct 26, 2017
Exactly as you mention! I want to execute/debugging on Linux since is my target production enviroment I think is better to develop and ship in the same OS and is supposed to perform better
Windows is consuming 1GB+ ram and 60%+ of CPU just to compile and 900mb+ to server with pub... I'm not sure if just happend in windows since I'm newbie with Dart ^^'
DanTup commentedon Oct 26, 2017
Understood. I'll have to have a look at how this proxy works and understand exactly what needs to change. I haven't had much time to spend on Dart Code lately, so I can't make any promises about when it'll be.
Which process is using the RAM/CPU? How big is the project? Probably best raising a separate case about that with info/screenshots.
WolfDan commentedon Oct 26, 2017
The proxy is really easy, think it as a executable than can be added to the PATH env variable, it runs a command from windows to ubuntu, so for example php.bat will run "php" + the variables you send from the command line or program
So if you write "php -v" in the CMD this will run in the bash of Linux (if you have setup the env variable or call directly to the containing folder) and you can see what happend and interact from the CMD console just like it is installed on windows itself
I just noticed that the RAM and CPU problem is from Dart.exe itself so is not from the extension itself, in fact the project is just the tutorial so is pretty basic project
DanTup commentedon Oct 27, 2017
We use the SDK Path for multiple things (launching Dart but also the analysis server snapshot) so changing that isn't a good solution. We also probably don't want to run the analysis server inside WSL in case the proxying adds any latency (Dart Code communicates with it over STDIN/STDOUT).
So, probably the way to do this would be to allow you to specify a custom location for the Dart executable used for launching and debugging (since this is user-provided we don't need to make any assumptions about the file extension).
Some additional complications:
proxy\dart.bat C:\MyStuff\MyThing.batcan Dart inside WSL use that path? I guess not?)I had a quick Google, and it looks like path mapping is required, but probably quite straight forward:
C:\Users\me\Documents\GitHub->/mnt/c/Users/me/Documents/GitHubSince we already send multiple paths per breakpoint (Dart, Flutter etc. are a little inconsistent) probably we can just do this conversion always to avoid you having to set an option to say it's WSL and paths need translating.
Again; I can't promise to look at this soon, but it does seem like a neat feature to support so I would like to have a go.
WolfDan commentedon Oct 27, 2017
Serve apps from WSL are 100% accesible from Windows side, I've tested with Phoenix Elixir and works totally fine, no additinal config or something, so yeah we can connect to the debugger
Yeah in fact you can run bash commands inside any windows folder
Maybe this can help ^^' https://github.com/Microsoft/vscode-cpptools/blob/master/Documentation/Debugger/gdb/Windows%20Subsystem%20for%20Linux.md (I haven't tested on Dart yet)
And don't worry about it for the moment I still using Dart on Windows ^^
22 remaining items
WolfDan commentedon Jun 12, 2019
I've not used flutter in a while already, so I'm not sure if the remote plugin works, tho I've use it a lot in different projects in rust, elixir, c++ and so without problem so I'd guess flutter will work just fine with a proper configuration
I hope someone can confirm it ^^
DanTup commentedon Jun 12, 2019
Using containers, Flutter is unable to connect to devices or emulators, so it doesn't really work currently. I haven't tried WSL though - when using WSL normally, can you connect to devices connected to the host machine? If so, I'll do some testing with WSL to see if it works for us here too.
[-]Supporting running through Ubuntu WSL / vglrun wrappers[/-][+]Supporting running through in WSL through VS Code Remote Development extensions[/+]DanTup commentedon Jun 19, 2019
I'll use this issue to track ensuring everything works in WSL using the VS Code Remote Dev extensions.
I'm not familiar enough with vglrun to know whether the use case there can also be satisfied via WSL or Containers support (@algor if not, lmk and we should split this back out to another issue).
[-]Supporting running through in WSL through VS Code Remote Development extensions[/-][+]Support running through in WSL through VS Code Remote Development extensions[/+]DanTup commentedon Jul 16, 2019
I did some testing using WSL with 3.2.1 and it seems to work fine:
You ofc need to ensure there's a Dart SDK inside WSL, and you seem to need to install the extension in it manually (go to the extensions side bar panel and click "Install in WSL").
I'm considering this working, but please to open new issues if you find any problems (or have any feature quests).
hros commentedon Oct 16, 2019
@DanTup
you say that:
Is it necessary to install Dart SDK in WSL? can't I reuse the SDK in windows?


when I start vscode I get the following error message:
If I select "Locate SDK" and enter the Windows path (using /mnt/c/...)
I still get the same error
DanTup commentedon Oct 16, 2019
I don't think so. WSL is running Linux and your Windows Dart SDK only has the Windows binary (dart.exe) which won't run inside Linux.
That makes sense, as we didn't locate the Linux binary (named
dart) in the SDK path you provided.