mcu-debug / debug-tracker-vscode

A generic debug adapter tracker that provides API/Event services for other extensions
MIT License
7 stars 0 forks source link

debug-tracker-vscode not loaded automatically on devcontainer rebuild #2

Open AndyMNSenso opened 1 year ago

AndyMNSenso commented 1 year ago

For my work I depend on Cortex-debug (https://github.com/Marus/cortex-debug) which in turn depends on this awesome project.

I use Docker containers for my remote development. Every single time I rebuild my devcontainer I get an error stating:

"Cannot activate the Cortex-Debug extension because it depends on the debug-tracker-vscode extension which is not loaded. Would you like to reload the window to load the extension ? Screenshot at 2023-06-23 10-12-34

Then I have to reload the window and everything gets loaded. Cortex-Debug, debug-tracker-vscode, and other mcu-debug extensions (MemoryView, Peripheral viewer etc.) are installed locally and on the remote (in the devcontainer).

Versions: VSCode: 1.79.2 debug-tracker-vscode: v0.0.15 Cortex-Debug: v1.12.0

Is this a misconfiguration on my part ? Is there a way to make sure debug-tracker-vscode gets loaded before another extensions ? Other extensions always get loaded properly (C++, CMake, Gitlens, etc.)

haneefdm commented 1 year ago

According to VSCode documentation, dependent extensions do not get installed properly and you have to pre-install all of them during container building. Your startup time may also be reduced. See customizations.vscode section in

https://github.com/haneefdm/psoc6hello/blob/master/.devcontainer/devcontainer.json

I would consider this a bug in vscode but I can't argue with them. We shouldn't have to do this but ....

I have no clue if updates work properly though.

AndyMNSenso commented 1 year ago

I guess I had to give more information. I do the extensions installation during container building. My devcontainer json:

// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.245.0/containers/docker-existing-dockerfile
{
    "name": "DevContainer",

    // Sets the run context to one level up instead of the .devcontainer folder.
    "context": "..",

    // Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
    "dockerFile": "../Dockerfile",

    // Uncomment when using a ptrace-based debugger like C++, Go, and Rust
    "runArgs": [
        "--privileged"
    ],
    "customizations": {
        "vscode": {
            "extensions": [
                "ms-vscode.cpptools-extension-pack",
                "mcu-debug.debug-tracker-vscode",
                "mcu-debug.peripheral-viewer",
                "mcu-debug.rtos-views",
                "eamodio.gitlens",
                "cschlosser.doxdocgen",
                "ms-vscode.hexeditor",
                "mhutchie.git-graph",
                "marus25.cortex-debug"
            ]
        }
    },
    "postAttachCommand": "git config core.editor 'code --wait'",
    "mounts": ["type=bind,source=/dev/bus/usb,target=/dev/bus/usb"]
}
haneefdm commented 1 year ago

Sorry, I am no Docker expert and don't know why VSCode does not load all dependent extensions the first time it starts up. If you know how to make it work, let me know. At least for me it did not repeatedly prompt me to reload the.

Maybe, I should create an extension pack?!?!?! That is yet another thing to maintain.

haneefdm commented 1 year ago

Under normal circumstances, people have reported that if use just the command line to install an extension (nothing to do with Docker), then dependent extensions do not get installed. But, here we are forcing all extensions to be installed!!

AndyMNSenso commented 1 year ago

From what I can tell, the extensions do get installed, but the debug-tracker-vscode is not loaded after the installation.

I have to click "Reload window" for it to work which I guess means that the extensions was already installed and just needed to load.

haneefdm commented 1 year ago

That is the thing. I don't know why it does not load automatically.

haneefdm commented 1 year ago

For cortex-debug, it is not even a direct dependency. It is indirect dependency of one of the mcu-debug.* extensions. Cortex-Debug manifest simply says load all these other extensions but it does not actually do that in a Container. Does it find on the Desktop

AndyMNSenso commented 1 year ago

I have never had this issue outside of a devcontainer. I only have it on rebuild of a devcontainer.

Is there any additional information I can provide you ? A log of some sort ?

haneefdm commented 1 year ago

Btw, I don't see the problem myself. Lots of people using cortex-debug in a docker as well. So, I am not sure what is wrong with your setup.

Please feel free to let us know how to fix it. I don't have the resources to debug container stuff and I rely on volunteers. If you know how to fix it and if the problem is on our end, we will be glad to incorporate a fix.

Perhaps re-building the container could help? Or submit an issue against VSCode and they may tell you what you/we are doing wrong.

rjaegers commented 10 months ago

I had the same issue as described above. For me the issue seemed to be caused by having the extension installed both local and in the devcontainer. Installing the extension outside and inside of the devcontainer allows one to reproduce the issue.

Since I only use it from within the devcontainer my resolution was to uninstall the locally installed version of the plug-in. But there might be use-cases for having the plugin on both sides.