Skip to content
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

Running the memoryinspector in WSL #150

Open
jlonnberg opened this issue Oct 31, 2024 · 7 comments · May be fixed by #151
Open

Running the memoryinspector in WSL #150

jlonnberg opened this issue Oct 31, 2024 · 7 comments · May be fixed by #151
Labels
bug Something isn't working

Comments

@jlonnberg
Copy link

Description
The extensions fails to activate properly when running in WSL

How to reproduce:
Launch a simple gcc project in WSL and try to use the extension

Expected behavior
The extension is activated properly in WSL

Environment

  • OS: WSL, Ubuntu 22.04 on windows 11
  • Browser:
  • Theia or VS Code Version:

Additional information

@jlonnberg jlonnberg added the bug Something isn't working label Oct 31, 2024
@thegecko
Copy link
Contributor

thegecko commented Nov 6, 2024

Thanks for raising this issue. The behaviour seen here is due to a culmination of a few things:

  • VS Code has multiple runtime environments or extension hosts and in some setups, the workspace host is separated from the UI host. This is the case with VS Code remote, WSL and codespaces
  • Debuggers have to run in one of these hosts and each host isn't aware of debug sessions running in other hosts
  • This extension has to run in the same host as the debugger in order to interact with it

The host an extension runs in is outlined using the extensionKind package.json entry and we currently have this set to ui for the following reasons:

  • It works in the normal desktop version of VS Code (as would workspace TBF)
  • Arm have a unique use case where we run a debugger in the UI extension host to enable browser-based debugging of physical hardware from an online IDE (e.g. Keil Studio Cloud)

However this setup means the memory inspector extension doesn't see any debuggers running in remote hosts.

In order to resolve this issue, we need to decide where we want this extension to run. The options boil down to:

  1. Keep the existing setup. Desktop and browser debug will continue to work, but remote debug scenarios wont be supported.
  2. Change this to run in the workspace. Desktop and remote scenarios will work, but browser debugging will not.

I will separately raise a question with the VS Code team to get their input.

As this is an OSS project and the UI use case may be unique to Arm, I suggest we go with option 2 and change the default behaviour to support remote workspaces. Arm then need to investigate a workaround for our browser scenario.

Feedback welcome @jreineckearm

@jlonnberg
Copy link
Author

@thegecko There's also the option to list the extension as UI preferred and workspace as secondary option. This did the trick for us when trying to figure out what the problem was

@thegecko
Copy link
Contributor

thegecko commented Nov 6, 2024

@thegecko There's also the option to list the extension as UI preferred and workspace as secondary option. This did the trick for us when trying to figure out what the problem was

Hmm, my tests in that scenario didn't work. But if it did, it would still break the browser scenario :(
In order for this to continue to work in a serverless environment (vscode.dev) it would still need ui in the list somewhere.

Would you mind confirming if this fixes your setup:

...
"extensionKind": [
  "ui",
  "workspace"
]
...

@jlonnberg
Copy link
Author

@thegecko Yes, that solved the problem for us at least

@colin-grant-work
Copy link
Contributor

But if it did, it would still break the browser scenario :(

Our experience is also that you basically have to commit to one extension host or the other when working remotely. The Memory Inspector will only run in one extension host, and that needs to be the one that runs the debugger. If you had different debuggers running in the different hosts, only one would work with the Memory Inspector. For our use cases we prefer the workspace extension host, so we've just modified the package.json accordingly, but it's an unfortunate limitation.

@thegecko thegecko linked a pull request Nov 7, 2024 that will close this issue
1 task
@thegecko
Copy link
Contributor

thegecko commented Nov 7, 2024

Changed in #151

@thegecko
Copy link
Contributor

thegecko commented Nov 7, 2024

Hmm, my tests in that scenario didn't work...
...Yes, that solved the problem for us at least

Forgot to mention, I confirmed the PR linked above does indeed fix WSL support in my test setup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants