Giter VIP home page Giter VIP logo

Comments (4)

decimad avatar decimad commented on June 26, 2024

Update on my debugging endeavors:
I cloned the git project. Somehow after a while vscode detected a devenv project, so I installed that extension and shortly afterwards docker on WSL2 (ugh).
Seemingly I can debug the extension now, but it won't yet find the correct python with sphinx and also not the esbonio deployment which I think is part of the project, no?

Is there a way to avoid this huge tooling overhead, yet still debug the extension?
Speaking of which, since the devenv is running a linux, I won't be able to reproduce the Windows-specific partition problem I wanted to diagnose, I think.

from esbonio.

alcarney avatar alcarney commented on June 26, 2024

Thank you for trying to debug this!

Before I get into the debugging setup, have you tried running the extension with esbonio.logging.level set to debug? The sever logs quite a lot of information so you should be able to get more details from the Esbonio Output channel in VSCode.

If I had to guess, I would expect that the server needs to do something in order to take into account the partition where the project is located when spawning the Sphinx subprocess - I don't suppose you'd know what that "something" would be?

Apologies for the broken devenv, it's very new and I'm yet to get it working completely myself! 😅
One of the reasons I'm experimenting with the devcontainer is to try and streamline the process of setting up the development environment, which for the VSCode extension is a little involved.

Speaking of which, since the devenv is running a linux, I won't be able to reproduce the Windows-specific partition problem I wanted to diagnose, I think.

Correct.

Unfortunately, I don't have time right now to write down the steps in detail but wanted to acknowledge your issue at least. Aside from the usual node project steps, setting up the environment boils down to reconstructing the missing esbonio deployment in the bundled/libs folder. You might be able to figure it out from the Makefile in the code/ folder.

I'll try and get more detailed steps written up either later today or tomorrow :)

from esbonio.

decimad avatar decimad commented on June 26, 2024

Hello, here is an excerpt of the debug log:

[esbonio.Configuration] SphinxConfig(enable_dev_tools=False, enable_sync_scrolling=True, python_command=['c:\\Users\\<user>\\AppData\\Local\\Programs\\Python\\Python312\\python.exe'], build_command=['sphinx-build', '-M', 'html', 'src', 'build'], env_passthrough=[], cwd='', python_path=[])
[esbonio.Configuration] Previous: None
[esbonio.Configuration] Current: SphinxConfig(enable_dev_tools=False, enable_sync_scrolling=True, python_command=['c:\\Users\\<user>\\AppData\\Local\\Programs\\Python\\Python312\\python.exe'], build_command=['sphinx-build', '-M', 'html', 'src', 'build'], env_passthrough=[], cwd='', python_path=[])
[esbonio.Configuration] ConfigChangeEvent(scope='file:///f%3A/projects/personal/sphinx-projects/sphinx-extension', value=SphinxConfig(enable_dev_tools=False, enable_sync_scrolling=True, python_command=['c:\\Users\\<user>\\AppData\\Local\\Programs\\Python\\Python312\\python.exe'], build_command=['sphinx-build', '-M', 'html', 'src', 'build'], env_passthrough=[], cwd='', python_path=[]), previous=None)
[esbonio.SphinxManager] Cwd: f:\projects\personal\sphinx-projects\sphinx-extension
[esbonio.SphinxManager] Build command: ['sphinx-build', '-M', 'html', 'src', 'build']
[esbonio.SphinxManager] Client created for scope file:///f%3A/projects/personal/sphinx-projects/sphinx-extension
[esbonio.SphinxManager] SphinxClient[b988b981-a84e-4e0a-b053-740586589a95]: None -> ClientState.Starting
[esbonio.SphinxManager] Starting sphinx agent: c:\Users\<user>\AppData\Local\Programs\Python\Python312\python.exe -m sphinx_agent
[esbonio.ProjectManager] No applicable project for uri: file:///f%3A/projects/personal/sphinx-projects/sphinx-extension/src/index.rst
[esbonio.ProjectManager] No applicable project for uri: file:///f%3A/projects/personal/sphinx-projects/sphinx-extension/src/index.rst
Running Sphinx v7.3.7
[esbonio.SphinxManager] Unable to start SphinxClient: path is on mount 'C:', start on mount 'F:'
Traceback (most recent call last):
  File "c:\Users\<user>\.vscode-insiders\extensions\swyddfa.esbonio-0.94.0\bundled\libs\esbonio\server\features\sphinx_manager\client_subprocess.py", line 210, in start
    self.sphinx_info = await self.protocol.send_request_async(
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pygls.exceptions.JsonRpcInternalError: path is on mount 'C:', start on mount 'F:'
[esbonio.SphinxManager] SphinxClient[b988b981-a84e-4e0a-b053-740586589a95]: ClientState.Starting -> ClientState.Errored

from esbonio.

alcarney avatar alcarney commented on June 26, 2024

Looking at the logs, the error is triggered when the server spawns the Sphinx process, it tries to compute a relative path between the Sphinx project and some bundled JS files the server needs to make previews work - which of course can't work across partitions. I have a proof of concept fix, so it should be possible to rework things to not need the relative path.


Here are some notes on setting up the development environment in case you are still interested in trying that.

  1. Open a terminal in the code/ folder
  2. Run npm ci to install JS dependencies
  3. Run npm run compile to compile the extension
  4. Run python -m pip install -t ./bundled/libs --no-cache-dir --implementation py --no-deps --upgrade -r ./requirements.txt to install esbonio's Python dependencies
  5. Now on linux I would run ln -s $(pwd)/../lib/esbonio/esbonio bundled/libs/esbonio to link the code/bundled/libs/esbonio folder with the development version of the server in the lib/esbonio/esbonio. But I know on Windows symlinks work differently... so maybe just copy-pasting the files across is enough to get things working.

That should be all the dependencies taken care of, so you should be able to use the VSCode Extension debug config to start a debug session 🤞

from esbonio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.