theia-ide / theia-apps

Theia applications examples - docker images, desktop apps, packagings
Apache License 2.0
1.04k stars 344 forks source link

latest version of theiaide/theia-python will not debug #485

Closed alancummings closed 2 years ago

alancummings commented 2 years ago

The latest version (2021-07-23) of the theiaide python image on dockerhub fails to debug. To reproduce:

  1. Run docker run --rm -it -p3000:3000 theiaide/theia-python
  2. open a browser at http://localhost:3000
  3. create a new python file test.py
  4. add this content:
    import sys
    print(sys.platform)
  5. add a launch config to run the current file
  6. run the launch config --> a message pops up: "There was an error starting the debug session, check the logs for more details." --> the backend log has this:
    root ERROR Error starting the debug session TypeError: is_electron_1.default is not a function
    at Object.startDebugAdapter (/home/theia/node_modules/@theia/plugin-ext/lib/plugin/node/debug/plugin-debug-adapter-starter.js:44:48)
    at DebugExtImpl.<anonymous> (/home/theia/node_modules/@theia/plugin-ext/lib/plugin/node/debug/debug.js:725:82)
    at step (/home/theia/node_modules/@theia/plugin-ext/lib/plugin/node/debug/debug.js:33:23)
    at Object.next (/home/theia/node_modules/@theia/plugin-ext/lib/plugin/node/debug/debug.js:14:53)
    at fulfilled (/home/theia/node_modules/@theia/plugin-ext/lib/plugin/node/debug/debug.js:5:58)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
vince-fugnitto commented 2 years ago

@alancummings thank you for reporting the issue, please see https://github.com/theia-ide/theia-apps/issues/483, it should be fixed in the next version.

alancummings commented 2 years ago

I've tested with the current "next" tagged docker container (reportedly updated on July 27): docker run --rm -it -p 3000:3000 theiaide/theia-python:next It still will not debug, but there is no longer any error output. Just, nothing at all happens. I suspect the version of ms-python needs to be in the range 2020.7.96456 - 2020.10.332292344 for python debugging to work in Theia (built in version is 2020.1.58038)

vince-fugnitto commented 2 years ago

@alancummings it works for you when the version mentioned in https://github.com/theia-ide/theia-apps/issues/441#issuecomment-835049516 is used?

I believe ms-toolsai.jupyter while not available yet on open-vsx can be requested, and for the meantime you can reference it by url (a built version) in your package.json.

marcdumais-work commented 2 years ago

Unfortunately I think vscode-jupyter is proprietary, since it uses proprietary package vsls (1) as a runtime dependency (2). AFAIK (IANAL) this makes this extension not legally usable in anything except official Visual Studio products.

The license for vsls is contained in this file: https://raw.githubusercontent.com/microsoft/vscode-jupyter/c13fe7f10ec6b82369c2a16727819be6339178ea/ThirdPartyNotices-Distribution.txt

(1): https://www.npmjs.com/package/vsls (2): https://github.com/microsoft/vscode-jupyter/blob/c13fe7f10ec6b82369c2a16727819be6339178ea/package.json#L2187

alancummings commented 2 years ago

Yes, if I build an IDE myself, it can work for any ms-python in the range from 2020.7.96456 to 2020.10.332292344

This issue I'm reporting is specific to the built and uploaded image in docker hub -- if a user runs that container, it is not possible (that I know of) to change the version of ms-python that it has installed - so the docker hub image theiaide/theia-python will not debug python.

There does seem to be a broader issue that all of the Github code seems to include version 2020.1.58038 in the package.json (if ms-python is included).

vince-fugnitto commented 2 years ago

@alancummings are you interested in contributing a fix to update the ms-python extension to the latest working version?

https://github.com/theia-ide/theia-apps/blob/a83be54ff44f087c87d8652f05ec73538ea055f7/theia-python-docker/latest.package.json#L102

https://github.com/theia-ide/theia-apps/blob/a83be54ff44f087c87d8652f05ec73538ea055f7/theia-python-docker/next.package.json#L102

The same is likely true for theia-full:

https://github.com/theia-ide/theia-apps/blob/a83be54ff44f087c87d8652f05ec73538ea055f7/theia-full-docker/latest.package.json#L136

https://github.com/theia-ide/theia-apps/blob/a83be54ff44f087c87d8652f05ec73538ea055f7/theia-full-docker/next.package.json#L136

alancummings commented 2 years ago

I can do that. I have a fix, do you want to give me push access? Or, here is a patch file (attached) update-vscode-python-version.patch.txt

NOTE: this upgrades to version 2020.8.105369 -- later versions up to 2020.10.332292344 will run in the debugger, but the feature of showing the workspace python version in the status bar is broken after 2020.8.105369 I've also switched to Open-VSX instead of MS

vince-fugnitto commented 2 years ago

I can do that. I have a fix, do you want to give me push access?

Unfortunately I cannot grant push access, you'll need to follow the usual workflow when working in open-source which is forking the repository, and creating pull-requests from your fork which we will review:

alancummings commented 2 years ago

I created pull request #492