microsoft / vscode-cpptools

Official repository for the Microsoft C/C++ extension for VS Code.
Other
5.51k stars 1.55k forks source link

Include errors in WSL #11810

Closed anoban closed 9 months ago

anoban commented 9 months ago

Environment

Bug Summary and Steps to Reproduce

Bug Summary: I'm getting #include errors in WSL Debian GNU/Linux 12 (bookworm). I've seen this issue reported multiple times here but none of the discussions offer a working solution. I have gcc and g++ installed and the system headers are @ /usr/include

Screenshot (256)

But Visual Studio Code fails to recognize them (It does recognize #include s from Windows SDK but not from WSL). When I include #include <stdio.h> VSCode offers wprintf_s and other UCRT specific functions in autocomplete assistance, so I reckon it uses Windows SDK headers even when I'm inside WSL. C stdlib includes work as they are also available from Windows SDK but not surprisingly POSIX specific includes fail eg. #include <pthread.h> gives cannot open source file "pthread.h"C/C++(1696).

This happens when I'm in the WSL file system directories like /home/username/ and Windows directories like /mnt/d/folder. And the problem persists after manually adding compiler and include directories to a workspace settings.json file.

{
    "C_Cpp.default.compileCommands": "gcc",
    "C_Cpp.default.compilerArgs": [
        "-Wall",
        "-std=c17",
        "-Wpedantic",
        "-c"
    ],
    "C_Cpp.default.compilerPath": "\\\\wsl.localhost\\Debian\\usr\\bin\\gcc",
    // usr\bin\gcc didn't work either
    "C_Cpp.default.cppStandard": "c++20",
    "C_Cpp.default.cStandard": "c17",
    "C_Cpp.default.includePath": [
        "\\\\wsl.localhost\\Debian\\usr\\include"
        // usr\include didn't work either
    ],
    "C_Cpp.default.intelliSenseMode": "linux-gcc-x64"
}

Screenshot (257)

But gcc is on the path, and apparently compilation and linking works fine, so the compiler is able to see the #include directories but not the editor. Is there a way to solve this? I really do not want to use MSYS2 or mingw.

Configuration and Logs

User settings.json is:

{
    "files.autoSave": "onFocusChange",
    "editor.fontSize": 18,
    "editor.fontFamily": "Consolas, monospace",
    "editor.accessibilitySupport": "off",
    "editor.autoClosingDelete": "never",
    "editor.autoClosingOvertype": "always",
    "editor.autoClosingQuotes": "always",
    "editor.bracketPairColorization.independentColorPoolPerBracketType": true,
    "editor.codeLensFontSize": 16,
    "workbench.startupEditor": "none",
    "editor.codeLensFontFamily": "Consolas",
    "editor.dragAndDrop": false,
    "editor.dropIntoEditor.enabled": false,
    "editor.emptySelectionClipboard": false,
    "editor.folding": false,
    "editor.foldingHighlight": false,
    "editor.hover.delay": 30,
    "editor.inlayHints.padding": true,
    "editor.unicodeHighlight.includeComments": true,
    "editor.unicodeHighlight.nonBasicASCII": false,
    "editor.unusualLineTerminators": "auto",
    "editor.cursorWidth": 2,
    "editor.find.loop": false,
    "editor.formatOnPaste": true,
    "editor.minimap.enabled": false,
    "editor.minimap.renderCharacters": false,
    "editor.maxTokenizationLineLength": 20000000,
    "files.associations": {
        "*.clang-format": "yaml",
        "*.clang-tidy": "yaml"
    },
    "files.hotExit": "off",
    "files.trimFinalNewlines": true,
    "workbench.commandPalette.history": 0,
    "workbench.enableExperiments": false,
    "workbench.hover.delay": 50,
    "workbench.localHistory.maxFileSize": 2048,
    "workbench.tips.enabled": false,
    "workbench.editor.highlightModifiedTabs": true,
    "workbench.settings.enableNaturalLanguageSearch": false,
    "zenMode.hideLineNumbers": false,
    "zenMode.hideStatusBar": false,
    "window.autoDetectHighContrast": false,
    "window.restoreWindows": "none",
    "search.quickOpen.includeHistory": false,
    "terminal.external.windowsExec": "C:\\Program Files\\PowerShell\\7\\pwsh.exe",
    "terminal.integrated.allowMnemonics": true,
    "terminal.integrated.confirmOnExit": "hasChildProcesses",
    "terminal.integrated.cursorBlinking": true,
    "terminal.integrated.cursorStyle": "underline",
    "terminal.integrated.cursorWidth": 2,
    "terminal.integrated.defaultProfile.windows": "PowerShell",
    "terminal.integrated.enableBell": true,
    "terminal.integrated.environmentChangesIndicator": "on",
    "terminal.integrated.fontFamily": "Consolas, monospace",
    "terminal.integrated.fontSize": 18,
    "terminal.integrated.gpuAcceleration": "on",
    "github.gitAuthentication": false,
    "python.globalModuleInstallation": true,
    "security.workspace.trust.banner": "never",
    "security.workspace.trust.emptyWindow": false,
    "security.workspace.trust.enabled": false,
    "security.workspace.trust.startupPrompt": "never",
    "editor.formatOnType": true,
    "telemetry.telemetryLevel": "off",
    "editor.autoIndent": "advanced",
    "editor.trimAutoWhitespace": false,
    "git.confirmEmptyCommits": false,
    "git.confirmSync": false,
    "git.confirmNoVerifyCommit": false,
    "git.confirmForcePush": false,
    "git.decorations.enabled": false,
    "git.detectSubmodules": false,
    "git.enableStatusBarSync": false,
    "merge-conflict.codeLens.enabled": false,
    "merge-conflict.decorators.enabled": false,
    "editor.formatOnSave": true,
    "explorer.confirmDragAndDrop": false,
    "explorer.confirmDelete": false,
    "extensions.closeExtensionDetailsOnViewChange": true,
    "debug.allowBreakpointsEverywhere": true,
    "debug.confirmOnExit": "always",
    "debug.console.acceptSuggestionOnEnter": "on",
    "debug.console.closeOnEnd": true,
    "debug.console.fontSize": 16,
    "debug.terminal.clearBeforeReusing": true,
    "scm.alwaysShowActions": true,
    "scm.inputFontSize": 14,
    "git.enableSmartCommit": true,
    "npm.autoDetect": "off",
    "npm.fetchOnlinePackageInfo": false,
    "npm.scriptHover": false,
    "php.suggest.basic": false,
    "update.showReleaseNotes": false,
    "C_Cpp.autocompleteAddParentheses": true,
    "C_Cpp.codeFolding": "disabled",
    "C_Cpp.default.cStandard": "c17",
    "C_Cpp.inlayHints.autoDeclarationTypes.enabled": true,
    "C_Cpp.inlayHints.autoDeclarationTypes.showOnLeft": true,
    "C_Cpp.inlayHints.parameterNames.enabled": true,
    "C_Cpp.vcFormat.indent.caseContentsWhenBlock": true,
    "C_Cpp.vcFormat.indent.caseLabels": true,
    "C_Cpp.vcFormat.newLine.beforeOpenBrace.block": "sameLine",
    "C_Cpp.vcFormat.newLine.beforeOpenBrace.function": "sameLine",
    "C_Cpp.vcFormat.newLine.beforeOpenBrace.type": "sameLine",
    "C_Cpp.vcFormat.newLine.closeBraceSameLine.emptyFunction": true,
    "C_Cpp.vcFormat.newLine.closeBraceSameLine.emptyType": true,
    "C_Cpp.vcFormat.newLine.scopeBracesOnSeparateLines": true,
    "C_Cpp.vcFormat.space.afterCastCloseParenthesis": true,
    "C_Cpp.vcFormat.space.beforeConstructorColon": false,
    "C_Cpp.vcFormat.space.betweenEmptyBraces": true,
    "C_Cpp.doxygen.generateOnType": false,
    "editor.codeActionsOnSave": {
        "source.fixAll": "explicit",
        "source.organizeImports": "explicit"
    },
    "python.analysis.autoImportCompletions": true,
    "python.analysis.completeFunctionParens": true,
    "python.analysis.inlayHints.functionReturnTypes": true,
    "python.analysis.inlayHints.pytestParameters": true,
    "python.analysis.inlayHints.variableTypes": true,
    "python.analysis.logLevel": "Warning",
    "python.analysis.typeCheckingMode": "strict",
    "python.languageServer": "Pylance",
    "python.terminal.executeInFileDir": true,
    "git.openRepositoryInParentFolders": "always",
    "git.autofetch": true,
    "python.experiments.enabled": false,
    "extensions.ignoreRecommendations": true,
    "C_Cpp.intelliSenseEngineFallback": "enabled",
    "C_Cpp.vcFormat.indent.lambdaBracesWhenParameter": false,
    "C_Cpp.vcFormat.space.preserveInInitializerList": false,
    "C_Cpp.intelliSenseUpdateDelay": 500,
    "C_Cpp.default.intelliSenseMode": "windows-msvc-x64",
    "C_Cpp.default.compilerArgs": [
        "/Wall",
        "/std:c17"
    ],
    "C_Cpp.formatting": "clangFormat",
    "hexeditor.inspectorType": "sidebar",
    "hexeditor.showOpenFileButton": true,
    "markdown.editor.drop.enabled": false,
    "markdown.occurrencesHighlight.enabled": true,
    "markdown.preview.breaks": true,
    "markdown.preview.markEditorSelection": false,
    "markdown.preview.typographer": true,
    "markdown.server.log": "debug",
    "markdown.trace.extension": "verbose",
    "markdown.trace.server": "messages",
    "markdown.updateLinksOnFileMove.enabled": "prompt",
    "markdown.validate.enabled": true,
    "C_Cpp.errorSquiggles": "enabled",
    "workbench.colorTheme": "Default Dark+",
    "C_Cpp.markdownInComments": "enabled",
    "C_Cpp.suggestSnippets": true,
    "C_Cpp.workspaceSymbols": "All",
    "C_Cpp.clang_format_style": "",
    "C_Cpp.vcFormat.newLine.beforeWhileInDoWhile": true,
    "C_Cpp.vcFormat.wrap.preserveBlocks": "never",
    "C_Cpp.default.cppStandard": "c++20",
    "C_Cpp.inlayHints.referenceOperator.enabled": true,
    "C_Cpp.vcFormat.indent.accessSpecifiers": true,
    "C_Cpp.vcFormat.space.beforeInitializerListOpenBrace": true,
    "C_Cpp.vcFormat.space.beforeLambdaOpenParenthesis": true,
    "C_Cpp.vcFormat.space.betweenEmptyLambdaBrackets": true,
    "C_Cpp.clang_format_path": "C:\\Program Files\\LLVM\\bin\\clang-format.exe",
    "C_Cpp.codeAnalysis.clangTidy.enabled": true,
    "C_Cpp.codeAnalysis.clangTidy.path": "C:\\Program Files\\LLVM\\bin\\clang-tidy.exe",
    "python.createEnvironment.contentButton": "hide",
    "python.pipenvPath": "",
    "python.poetryPath": "",
    "python.terminal.activateEnvInCurrentTerminal": true,
    "python.terminal.activateEnvironment": false,
    "python.terminal.focusAfterLaunch": true,
    "python.analysis.addImport.exactMatchOnly": true,
    "python.analysis.autoFormatStrings": true,
    "python.analysis.diagnosticMode": "workspace",
    "python.analysis.inlayHints.callArgumentNames": "all",
    "powershell.analyzeOpenDocumentsOnly": true,
    "powershell.codeFolding.enable": false,
    "powershell.codeFormatting.autoCorrectAliases": true,
    "powershell.codeFormatting.avoidSemicolonsAsLineTerminators": true,
    "powershell.codeFormatting.ignoreOneLineBlock": false,
    "powershell.codeFormatting.trimWhitespaceAroundPipe": true,
    "powershell.codeFormatting.useCorrectCasing": true,
    "powershell.integratedConsole.showOnStartup": false,
    "powershell.integratedConsole.suppressStartupBanner": true,
    "powershell.startAsLoginShell.osx": false,
    "python.analysis.diagnosticSeverityOverrides": {
        "reportDeprecated": "error",
        "reportAssertAlwaysTrue": "error",
        "reportConstantRedefinition": "error",
        "reportDuplicateImport": "error",
        "reportImplicitOverride": "error",
        "reportImportCycles": "error",
        "reportGeneralTypeIssues": "warning",
        "reportImplicitStringConcatenation": "warning",
        "reportInconsistentConstructor": "error",
        "reportInvalidStringEscapeSequence": "error",
        "reportInvalidTypeVarUse": "error",
        "reportMatchNotExhaustive": "error",
        "reportMissingImports": "error",
        "reportMissingTypeArgument": "warning",
        "reportOptionalCall": "warning",
        "reportOptionalIterable": "warning",
        "reportOptionalContextManager": "warning",
        "reportOptionalOperand": "warning",
    },
    "[python]": {
        "editor.defaultFormatter": "ms-python.vscode-pylance",
        "editor.formatOnSave": true
    },
    "python.missingPackage.severity": "Warning",
    "python.testing.pytestEnabled": true,
    "python.testing.unittestEnabled": true,
    "notebook.formatOnSave.enabled": true,
    "html.format.indentHandlebars": true
}

The output from C/C++ configuration warnings are:

[12/28/2023, 3:59:50 AM] "d:\Real-Time-Embedded-Systems-Concepts-and-Practices\gcc" could not be parsed. 'includePath' from c_cpp_properties.json in folder 'REAL-TIME-EMBEDDED-SYSTEMS-CONCEPTS-AND-PRACTICES' will be used instead.
[12/28/2023, 3:59:50 AM] For C++ source files, IntelliSenseMode was changed from "linux-gcc-x64" to "windows-msvc-x64" based on compiler args and querying compilerPath: "cl.exe"
[12/28/2023, 3:59:50 AM] IntelliSenseMode was changed because it didn't match the detected compiler.  Consider setting "compilerPath" instead.  Set "compilerPath" to "" to disable detection of system includes and defines.
[12/28/2023, 3:59:50 AM] For C source files, IntelliSenseMode was changed from "linux-gcc-x64" to "windows-msvc-x64" based on compiler args and querying compilerPath: "cl.exe"
[12/28/2023, 3:59:50 AM] IntelliSenseMode was changed because it didn't match the detected compiler.  Consider setting "compilerPath" instead.  Set "compilerPath" to "" to disable detection of system includes and defines.
sean-mcmanus commented 9 months ago

We only support WSL2 using the Remote: WSL extension, i.e. when it runs the Linux version of our extension. It seems like you're using Windows paths in WSL1.

sean-mcmanus commented 9 months ago

See https://code.visualstudio.com/docs/cpp/config-wsl

anoban commented 9 months ago

@sean-mcmanus Thank you. I appreciate the assistance. Now that I have installed the WSL extension, when I invoke code.exe from WSL terminal, I get stuck at this

Updating VS Code Server to version 0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2
Removing previous installation...
Installing VS Code Server for x64 (0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2)
Downloading:  _ 

for eons. After a long time (20 minutes) I get this output:

Downloading: 100%
Failed
--2023-12-28 17:18:33--  https://update.code.visualstudio.com/commit:0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2/server-linux-x64/stable
Resolving update.code.visualstudio.com (update.code.visualstudio.com)... 13.107.213.58, 13.107.246.58, 2620:1ec:bdf::58, ...
Connecting to update.code.visualstudio.com (update.code.visualstudio.com)|13.107.213.58|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://vscode.download.prss.microsoft.com/dbazure/download/stable/0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2/vscode-server-linux-x64.tar.gz [following]
--2023-12-28 17:18:34--  https://vscode.download.prss.microsoft.com/dbazure/download/stable/0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2/vscode-server-linux-x64.tar.gz
Resolving vscode.download.prss.microsoft.com (vscode.download.prss.microsoft.com)... 152.199.39.108, 2606:2800:247:1cb7:261b:1f9c:2074:3c
Connecting to vscode.download.prss.microsoft.com (vscode.download.prss.microsoft.com)|152.199.39.108|:443... connected.

Then after another 28 minutes, I got this:

Unable to establish SSL connection.
ERROR: Failed to download https://update.code.visualstudio.com/commit:0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2/server-linux-x64/stable to /home/anoban/.vscode-server/bin/0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2-1703763213.tar.gz

Finally I gave up and I downloaded the latest archive (ttps://update.code.visualstudio.com/commit:0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2/server-linux-x64/stable) using Firefox (took about 10 seconds), unzipped it and copied the contents to /home/anoban/.vscode-server/bin/ hoping VSCode would launch from WSL without attempting to reinstall the vscode-server.

Screenshot (258)

But It does the same thing again! I end up with the same output in the terminal:

anoban@Inspiron-3501:/mnt/d$ code .
Updating VS Code Server to version 0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2
Removing previous installation...
Installing VS Code Server for x64 (0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2)
Downloading:    _

From what I've gathered this also seems to be a very common problem that still has no tangible solution.!

bobbrow commented 9 months ago

Does it also fail if you open VS Code from Windows (not the WSL terminal), click the green button in the bottom left corner, and select "Connect to WSL" from the drop down menu?

image

anoban commented 9 months ago

@bobbrow Thank you. No, that approach works fine without any problems :)

Screenshot (260)

Now, invoking code . from WSL2 works (Visual Studio Code opens) without trying to install the remote server, but it gets stuck at:

Screenshot (261)

and the error I got was The editor could not be opened due to an unexpected error: Unable to resolve resource vscode-remote://wsl%2Bdebian/mnt/d/ and Failed to connect to the remote extension host server (Error: WebSocket close with status code 1006). As the error message suggest, I presume this has something to do with my workspace being located in Windows's file system instead of Linux.

The complete log is:

[2023-12-30 00:47:38.155] WSL daemon log file: c:\Users\Anoban\AppData\Roaming\Code\logs\20231230T060303\window1\exthost\ms-vscode-remote.remote-wsl\wsl-daemon-20231230T004738.log
[2023-12-30 00:47:38.159] Connecting to daemon started by other WSL window... 5.15.133.1-microsoft-standard-WSL2 Debian
[2023-12-30 00:47:38.160] WSL resolver response: 127.0.0.1:49995
[2023-12-30 00:47:38.160] To debug connection issues, open a local browser on http://127.0.0.1:49995/version
[2023-12-30 00:47:38.160] No extension host environment set
[2023-12-30 00:47:37.775] Extension version: 0.81.8
[2023-12-30 00:47:37.775] L10N bundle: undefined
[2023-12-30 00:47:37.778] authorityHierarchy: wsl+Debian
[2023-12-30 00:47:37.778] WSL extension activating for a local WSL instance
[2023-12-30 00:47:37.784] Resolving wsl+Debian, resolveAttempt: 1
[2023-12-30 00:47:37.784] NodeExecServer run: C:\Windows\System32\wsl.exe --status
[2023-12-30 00:47:37.893] WSL feature installed: true (wsl --status)
[2023-12-30 00:47:37.893] NodeExecServer run: C:\Windows\System32\wsl.exe --list --verbose
[2023-12-30 00:47:37.996] 1 distros found
[2023-12-30 00:47:37.997] Starting VS Code Server inside WSL (wsl2)
[2023-12-30 00:47:37.997] Windows build: 22631. Multi distro support: available. WSL path support: enabled
[2023-12-30 00:47:37.997] Scriptless setup: false
[2023-12-30 00:47:37.998] No shell environment set or found for current distro.
[2023-12-30 00:47:38.195] Using executable (51) to forward requests from local 49995 to remote 37837
[2023-12-30 00:47:38.196] NodeExecServer run: C:\Windows\System32\wsl.exe -d Debian -e /home/anoban/.vscode-server/bin/0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2/node -e const net = require('net'); process.stdin.pause(); const client = net.createConnection({ host: '127.0.0.1', port: 37837 }, () => { client.pipe(process.stdout); process.stdin.pipe(client); }); client.on('close', function (hadError) { console.error(hadError ? 'Remote close with error' : 'Remote close'); process.exit(hadError ? 1 : 0); }); client.on('error', function (err) { process.stderr.write(err && (err.stack || err.message) || String(err)); });
[2023-12-30 00:47:38.350] Exec (51) stderr: Error: connect ECONNREFUSED 127.0.0.1:37837
[2023-12-30 00:47:38.350]     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16)
[2023-12-30 00:47:38.350] Exec (51) stderr: Remote close with error
[2023-12-30 00:47:38.380] Exec (51): Local close
[2023-12-30 00:47:38.380] Exec (51) has terminated (local socket closed) with status 1 and message undefined.
[2023-12-30 00:47:38.383] Resolving wsl+Debian, resolveAttempt: 2
[2023-12-30 00:47:38.383] Returning resolved promise.
[2023-12-30 00:47:38.395] Using executable (52) to forward requests from local 49995 to remote 37837
[2023-12-30 00:47:38.395] NodeExecServer run: C:\Windows\System32\wsl.exe -d Debian -e /home/anoban/.vscode-server/bin/0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2/node -e const net = require('net'); process.stdin.pause(); const client = net.createConnection({ host: '127.0.0.1', port: 37837 }, () => { client.pipe(process.stdout); process.stdin.pipe(client); }); client.on('close', function (hadError) { console.error(hadError ? 'Remote close with error' : 'Remote close'); process.exit(hadError ? 1 : 0); }); client.on('error', function (err) { process.stderr.write(err && (err.stack || err.message) || String(err)); });
[2023-12-30 00:47:38.536] Exec (52) stderr: Error: connect ECONNREFUSED 127.0.0.1:37837
[2023-12-30 00:47:38.536]     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16)
[2023-12-30 00:47:38.537] Exec (52) stderr: Remote close with error
[2023-12-30 00:47:38.564] Exec (52): Local close
[2023-12-30 00:47:38.565] Exec (52) has terminated (local socket closed) with status 1 and message undefined.
[2023-12-30 00:47:38.580] Using executable (53) to forward requests from local 49995 to remote 37837
[2023-12-30 00:47:38.580] NodeExecServer run: C:\Windows\System32\wsl.exe -d Debian -e /home/anoban/.vscode-server/bin/0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2/node -e const net = require('net'); process.stdin.pause(); const client = net.createConnection({ host: '127.0.0.1', port: 37837 }, () => { client.pipe(process.stdout); process.stdin.pipe(client); }); client.on('close', function (hadError) { console.error(hadError ? 'Remote close with error' : 'Remote close'); process.exit(hadError ? 1 : 0); }); client.on('error', function (err) { process.stderr.write(err && (err.stack || err.message) || String(err)); });
[2023-12-30 00:47:38.717] Exec (53) stderr: Error: connect ECONNREFUSED 127.0.0.1:37837
[2023-12-30 00:47:38.717]     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16)
[2023-12-30 00:47:38.717] Exec (53) stderr: Remote close with error
[2023-12-30 00:47:38.739] Exec (53): Local close
[2023-12-30 00:47:38.740] Exec (53) has terminated (local socket closed) with status 1 and message undefined.
[2023-12-30 00:47:38.740] Resolving wsl+Debian, resolveAttempt: 3
[2023-12-30 00:47:38.740] Returning resolved promise.
[2023-12-30 00:47:38.754] Using executable (54) to forward requests from local 49995 to remote 37837
[2023-12-30 00:47:38.754] NodeExecServer run: C:\Windows\System32\wsl.exe -d Debian -e /home/anoban/.vscode-server/bin/0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2/node -e const net = require('net'); process.stdin.pause(); const client = net.createConnection({ host: '127.0.0.1', port: 37837 }, () => { client.pipe(process.stdout); process.stdin.pipe(client); }); client.on('close', function (hadError) { console.error(hadError ? 'Remote close with error' : 'Remote close'); process.exit(hadError ? 1 : 0); }); client.on('error', function (err) { process.stderr.write(err && (err.stack || err.message) || String(err)); });
[2023-12-30 00:47:38.890] Exec (54) stderr: Error: connect ECONNREFUSED 127.0.0.1:37837
[2023-12-30 00:47:38.890]     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16)
[2023-12-30 00:47:38.891] Exec (54) stderr: Remote close with error
[2023-12-30 00:47:38.914] Exec (54): Local close
[2023-12-30 00:47:38.914] Exec (54) has terminated (local socket closed) with status 1 and message undefined.
[2023-12-30 00:47:38.930] Using executable (55) to forward requests from local 49995 to remote 37837
[2023-12-30 00:47:38.931] NodeExecServer run: C:\Windows\System32\wsl.exe -d Debian -e /home/anoban/.vscode-server/bin/0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2/node -e const net = require('net'); process.stdin.pause(); const client = net.createConnection({ host: '127.0.0.1', port: 37837 }, () => { client.pipe(process.stdout); process.stdin.pipe(client); }); client.on('close', function (hadError) { console.error(hadError ? 'Remote close with error' : 'Remote close'); process.exit(hadError ? 1 : 0); }); client.on('error', function (err) { process.stderr.write(err && (err.stack || err.message) || String(err)); });
[2023-12-30 00:47:39.067] Exec (55) stderr: Error: connect ECONNREFUSED 127.0.0.1:37837
[2023-12-30 00:47:39.067]     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16)
[2023-12-30 00:47:39.067] Exec (55) stderr: Remote close with error
[2023-12-30 00:47:39.096] Exec (55): Local close
[2023-12-30 00:47:39.097] Exec (55) has terminated (local socket closed) with status 1 and message undefined.
[2023-12-30 00:47:39.098] Resolving wsl+Debian, resolveAttempt: 4
[2023-12-30 00:47:39.098] Returning resolved promise.
[2023-12-30 00:47:39.111] Using executable (56) to forward requests from local 49995 to remote 37837
[2023-12-30 00:47:39.111] NodeExecServer run: C:\Windows\System32\wsl.exe -d Debian -e /home/anoban/.vscode-server/bin/0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2/node -e const net = require('net'); process.stdin.pause(); const client = net.createConnection({ host: '127.0.0.1', port: 37837 }, () => { client.pipe(process.stdout); process.stdin.pipe(client); }); client.on('close', function (hadError) { console.error(hadError ? 'Remote close with error' : 'Remote close'); process.exit(hadError ? 1 : 0); }); client.on('error', function (err) { process.stderr.write(err && (err.stack || err.message) || String(err)); });
[2023-12-30 00:47:39.248] Exec (56) stderr: Error: connect ECONNREFUSED 127.0.0.1:37837
[2023-12-30 00:47:39.248]     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16)
[2023-12-30 00:47:39.248] Exec (56) stderr: Remote close with error
[2023-12-30 00:47:39.287] Exec (56): Local close
[2023-12-30 00:47:39.290] Exec (56) has terminated (local socket closed) with status 1 and message undefined.
[2023-12-30 00:47:39.302] Using executable (57) to forward requests from local 49995 to remote 37837
[2023-12-30 00:47:39.303] NodeExecServer run: C:\Windows\System32\wsl.exe -d Debian -e /home/anoban/.vscode-server/bin/0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2/node -e const net = require('net'); process.stdin.pause(); const client = net.createConnection({ host: '127.0.0.1', port: 37837 }, () => { client.pipe(process.stdout); process.stdin.pipe(client); }); client.on('close', function (hadError) { console.error(hadError ? 'Remote close with error' : 'Remote close'); process.exit(hadError ? 1 : 0); }); client.on('error', function (err) { process.stderr.write(err && (err.stack || err.message) || String(err)); });
[2023-12-30 00:47:39.459] Exec (57) stderr: Error: connect ECONNREFUSED 127.0.0.1:37837
[2023-12-30 00:47:39.459]     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16)
[2023-12-30 00:47:39.460] Exec (57) stderr: Remote close with error
[2023-12-30 00:47:39.485] Exec (57): Local close
[2023-12-30 00:47:39.486] Exec (57) has terminated (local socket closed) with status 1 and message undefined.
[2023-12-30 00:47:39.499] Using executable (58) to forward requests from local 49995 to remote 37837
[2023-12-30 00:47:39.499] NodeExecServer run: C:\Windows\System32\wsl.exe -d Debian -e /home/anoban/.vscode-server/bin/0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2/node -e const net = require('net'); process.stdin.pause(); const client = net.createConnection({ host: '127.0.0.1', port: 37837 }, () => { client.pipe(process.stdout); process.stdin.pipe(client); }); client.on('close', function (hadError) { console.error(hadError ? 'Remote close with error' : 'Remote close'); process.exit(hadError ? 1 : 0); }); client.on('error', function (err) { process.stderr.write(err && (err.stack || err.message) || String(err)); });
[2023-12-30 00:47:39.505] Resolving wsl+Debian, resolveAttempt: 5
[2023-12-30 00:47:39.505] Returning resolved promise.
[2023-12-30 00:47:39.659] Exec (58) stderr: Error: connect ECONNREFUSED 127.0.0.1:37837
[2023-12-30 00:47:39.659]     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16)
[2023-12-30 00:47:39.660] Exec (58) stderr: Remote close with error
[2023-12-30 00:47:39.683] Exec (58): Local close
[2023-12-30 00:47:39.684] Exec (58) has terminated (local socket closed) with status 1 and message undefined.
[2023-12-30 00:47:39.699] Using executable (59) to forward requests from local 49995 to remote 37837
[2023-12-30 00:47:39.699] NodeExecServer run: C:\Windows\System32\wsl.exe -d Debian -e /home/anoban/.vscode-server/bin/0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2/node -e const net = require('net'); process.stdin.pause(); const client = net.createConnection({ host: '127.0.0.1', port: 37837 }, () => { client.pipe(process.stdout); process.stdin.pipe(client); }); client.on('close', function (hadError) { console.error(hadError ? 'Remote close with error' : 'Remote close'); process.exit(hadError ? 1 : 0); }); client.on('error', function (err) { process.stderr.write(err && (err.stack || err.message) || String(err)); });
[2023-12-30 00:47:39.824] Exec (59) stderr: Error: connect ECONNREFUSED 127.0.0.1:37837
[2023-12-30 00:47:39.825]     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16)
[2023-12-30 00:47:39.826] Exec (59) stderr: Remote close with error
[2023-12-30 00:47:39.843] Exec (59): Local close
[2023-12-30 00:47:39.844] Exec (59) has terminated (local socket closed) with status 1 and message undefined.
[2023-12-30 00:47:39.858] Using executable (60) to forward requests from local 49995 to remote 37837
[2023-12-30 00:47:39.858] NodeExecServer run: C:\Windows\System32\wsl.exe -d Debian -e /home/anoban/.vscode-server/bin/0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2/node -e const net = require('net'); process.stdin.pause(); const client = net.createConnection({ host: '127.0.0.1', port: 37837 }, () => { client.pipe(process.stdout); process.stdin.pipe(client); }); client.on('close', function (hadError) { console.error(hadError ? 'Remote close with error' : 'Remote close'); process.exit(hadError ? 1 : 0); }); client.on('error', function (err) { process.stderr.write(err && (err.stack || err.message) || String(err)); });
[2023-12-30 00:47:39.861] Download in background is enabled
[2023-12-30 00:47:40.006] Exec (60) stderr: Error: connect ECONNREFUSED 127.0.0.1:37837
[2023-12-30 00:47:40.006]     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16)
[2023-12-30 00:47:40.007] Exec (60) stderr: Remote close with error
[2023-12-30 00:47:40.028] Exec (60): Local close
[2023-12-30 00:47:40.028] Exec (60) has terminated (local socket closed) with status 1 and message undefined.
bobbrow commented 9 months ago

Hi @anoban, what you're describing sounds like an issue with VS Code. Can you report your issue here: https://github.com/microsoft/vscode-remote-release/issues?

Is there anything else still unresolved from a C++ point of view, or is it ok to close this issue?

anoban commented 9 months ago

@bobbrow Okay, thanks for your help. I'll try that :)