Skip to content

Support running through in WSL through VS Code Remote Development extensions #435

Closed

Description

@WolfDan

Can be great a support for WSL, with this users can use only Linux to develop from Windows

Greetings

Activity

  1. DanTup commented on Oct 26, 2017

    @DanTup
    Member

    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.

  2. WolfDan commented on Oct 26, 2017

    @WolfDan
    Author

    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

  3. DanTup commented on Oct 26, 2017

    @DanTup
    Member

    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?

  4. WolfDan commented on Oct 26, 2017

    @WolfDan
    Author

    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 ^^'

  5. DanTup commented on Oct 26, 2017

    @DanTup
    Member

    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.

  6. added
    in debuggingRelates to the debug adapter or process of running debug sessions
    is enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.
    on Oct 26, 2017
  7. added this to the v2.5.0 milestone on Oct 26, 2017
  8. WolfDan commented on Oct 26, 2017

    @WolfDan
    Author

    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

  9. DanTup commented on Oct 27, 2017

    @DanTup
    Member

    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:

    1. 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)
    2. 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?)
    3. 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:

    C:\Users\me\Documents\GitHub -> /mnt/c/Users/me/Documents/GitHub

    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.

  10. WolfDan commented on Oct 27, 2017

    @WolfDan
    Author
    1. 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

    2. Yeah in fact you can run bash commands inside any windows folder

    3. 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 ^^

  11. modified the milestones: v2.5.0, v2.7.0 on Nov 23, 2017
  12. modified the milestones: v2.7.0, v2.8.0 on Dec 20, 2017
  13. 22 remaining items

  14. WolfDan commented on Jun 12, 2019

    @WolfDan
    Author

    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 ^^

  15. DanTup commented on Jun 12, 2019

    @DanTup
    Member

    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.

  16. added
    is enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.
    and removed
    awaiting infoRequires more information from the customer to progress
    on Jun 19, 2019
  17. added this to the On Deck milestone on Jun 19, 2019
  18. 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
  19. DanTup commented on Jun 19, 2019

    @DanTup
    Member

    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).

  20. 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
  21. modified the milestones: On Deck, v3.3.0 on Jun 20, 2019
  22. DanTup commented on Jul 16, 2019

    @DanTup
    Member

    I did some testing using WSL with 3.2.1 and it seems to work fine:

    wsl

    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).

  23. added
    in remoteRelates to running the extension in a remote setting using VS Code's remote dev support
    on Jul 22, 2019
  24. hros commented on Oct 16, 2019

    @hros

    @DanTup
    you say that:

    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:
    image
    If I select "Locate SDK" and enter the Windows path (using /mnt/c/...)
    image
    I still get the same error

  25. DanTup commented on Oct 16, 2019

    @DanTup
    Member

    Is it necessary to install Dart SDK in WSL? can't I reuse the SDK in windows?

    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.

    If I select "Locate SDK" and enter the Windows path (using /mnt/c/...)
    I still get the same error

    That makes sense, as we didn't locate the Linux binary (named dart) in the SDK path you provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in remoteRelates to running the extension in a remote setting using VS Code's remote dev supportis enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions