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

vscode-extensions.vadimcn.vscode-lldb: Error failed to get reply to handshake packet on x86_64-darwin #148946

Closed
nigelgbanks opened this issue Dec 6, 2021 · 6 comments
Assignees
Labels
0.kind: bug Something is broken 6.topic: darwin Running or building packages on Darwin 6.topic: vscode

Comments

@nigelgbanks
Copy link

Describe the bug

On x86_64-darwin the VS Code plugin vscode-extensions.vadimcn.vscode-lldb fails to connect to the debugger after starting. With the message failed to get reply to handshake packet.

If I install VSCode and the plugin manually it works as expected. That being said others not using nixpkgs have encountered this issue as well. I've put some effort into debugging the issue though not much luck.

Steps To Reproduce

I've attached a minimal reproducible example project that uses flakes.

Issue.zip

  1. On x86_64-darwin machine.
  2. Ensure VS Code is uninstalled
    • Remove the application via Nix if installed by Nix or manually from the /Applications folder.
    • rm -fr $HOME/Library/Application\ Support/Code/
    • rm -rf $HOME/.vscode
  3. Change into the directory of the unpacked zip file.
  4. Run nix develop.
  5. Once in the shell use code . to open visual studio code.
  6. Put a breakpoint in src/main.rc
  7. Launch the debugger.
  8. Observe the error.

Expected behavior

The debugger attaches to the process and stops on the set breakpoint.

Screenshots

Screenshot 2021-12-06 at 08 33 20

The following is the log output of codelldb.

Running `cargo build --bin=youtube-dl-subscriptions --package=youtube-dl-subscriptions --message-format=json`...
    Finished dev [unoptimized + debuginfo] target(s) in 1.33s
Raw artifacts:
{
  fileName: '/Users/nbanks/Projects/youtube-dl-subscriptions/target/debug/youtube-dl-subscriptions',
  name: 'youtube-dl-subscriptions',
  kind: 'bin'
}
Filtered artifacts: 
{
  fileName: '/Users/nbanks/Projects/youtube-dl-subscriptions/target/debug/youtube-dl-subscriptions',
  name: 'youtube-dl-subscriptions',
  kind: 'bin'
}
configuration: {
  type: 'lldb',
  request: 'launch',
  name: "Debug executable 'youtube-dl-subscriptions'",
  args: [],
  cwd: '${workspaceFolder}',
  __configurationTarget: 5,
  relativePathBase: '/Users/nbanks/Projects/youtube-dl-subscriptions',
  program: '/Users/nbanks/Projects/youtube-dl-subscriptions/target/debug/youtube-dl-subscriptions',
  sourceLanguages: [ 'rust' ]
}
liblldb: /Users/nbanks/.vscode/extensions/vadimcn.vscode-lldb/lldb/lib/liblldb.dylib
environment: {}
params: {
  evaluateForHovers: true,
  commandCompletions: true,
  sourceLanguages: [ 'rust' ]
}
Listening on port 56932
[2021-12-06T08:27:59.692Z DEBUG codelldb] New debug session
INFO(Python) 08:28:00 formatters: Initializing
INFO(Python) 08:28:00 formatters.rust: Initializing
[2021-12-06T08:28:00.526Z DEBUG codelldb::dap_codec] --> {"command":"initialize","arguments":{"clientID":"vscode","clientName":"Visual Studio Code","adapterID":"lldb","pathFormat":"path","linesStartAt1":true,"columnsStartAt1":true,"supportsVariableType":true,"supportsVariablePaging":true,"supportsRunInTerminalRequest":true,"locale":"en-gb","supportsProgressReporting":true,"supportsInvalidatedEvent":true,"supportsMemoryReferences":true},"type":"request","seq":1}
[2021-12-06T08:28:00.550Z DEBUG codelldb::dap_codec] <-- {"type":"response","request_seq":1,"success":true,"command":"initialize","body":{"exceptionBreakpointFilters":[{"default":true,"filter":"rust_panic","label":"Rust: on panic"}],"supportTerminateDebuggee":true,"supportsCancelRequest":true,"supportsCompletionsRequest":true,"supportsConditionalBreakpoints":true,"supportsConfigurationDoneRequest":true,"supportsDataBreakpoints":true,"supportsDelayedStackTraceLoading":true,"supportsEvaluateForHovers":true,"supportsFunctionBreakpoints":true,"supportsGotoTargetsRequest":true,"supportsHitConditionalBreakpoints":true,"supportsLogPoints":true,"supportsReadMemoryRequest":true,"supportsRestartFrame":true,"supportsSetVariable":true}}
[2021-12-06T08:28:00.567Z DEBUG codelldb::dap_codec] --> {"command":"launch","arguments":{"type":"lldb","request":"launch","name":"Debug executable 'youtube-dl-subscriptions'","args":[],"cwd":"/Users/nbanks/Projects/youtube-dl-subscriptions","__configurationTarget":5,"relativePathBase":"/Users/nbanks/Projects/youtube-dl-subscriptions","program":"/Users/nbanks/Projects/youtube-dl-subscriptions/target/debug/youtube-dl-subscriptions","sourceLanguages":["rust"],"_adapterSettings":{"displayFormat":"auto","showDisassembly":"auto","dereferencePointers":true,"suppressMissingSourceFiles":true,"evaluationTimeout":5,"consoleMode":"commands","sourceLanguages":null,"terminalPromptClear":null,"evaluateForHovers":true,"commandCompletions":true,"reproducer":false},"__sessionId":"c9e5ae41-7ea5-4911-a380-59571dfd7dd7"},"type":"request","seq":2}
[2021-12-06T08:28:00.568Z DEBUG codelldb::dap_codec] <-- {"type":"event","seq":1,"event":"capabilities","body":{"capabilities":{"exceptionBreakpointFilters":[{"default":true,"filter":"rust_panic","label":"Rust: on panic"}],"supportTerminateDebuggee":true,"supportsCancelRequest":true,"supportsCompletionsRequest":true,"supportsConditionalBreakpoints":true,"supportsConfigurationDoneRequest":true,"supportsDataBreakpoints":true,"supportsDelayedStackTraceLoading":true,"supportsEvaluateForHovers":true,"supportsFunctionBreakpoints":true,"supportsGotoTargetsRequest":true,"supportsHitConditionalBreakpoints":true,"supportsLogPoints":true,"supportsReadMemoryRequest":true,"supportsRestartFrame":true,"supportsSetVariable":true}}}
[2021-12-06T08:28:01.621Z DEBUG codelldb::dap_codec] <-- {"type":"event","seq":2,"event":"initialized"}
[2021-12-06T08:28:01.622Z DEBUG codelldb::debug_session] Debug event: 0x6000022f8358 Event: broadcaster = 0x7fc78c13c420 (lldb.target), type = 0x00000002 (modules-loaded), data = {youtube-dl-subscriptions}
[2021-12-06T08:28:01.626Z DEBUG codelldb::dap_codec] --> {"command":"setFunctionBreakpoints","arguments":{"breakpoints":[]},"type":"request","seq":3}
[2021-12-06T08:28:01.626Z DEBUG codelldb::dap_codec] <-- {"type":"event","seq":3,"event":"module","body":{"module":{"addressRange":"FFFFFFFFFFFFFFFF","id":"FFFFFFFFFFFFFFFF","name":"youtube-dl-subscriptions","path":"/Users/nbanks/Projects/youtube-dl-subscriptions/target/debug/youtube-dl-subscriptions","symbolFilePath":"/Users/nbanks/Projects/youtube-dl-subscriptions/target/debug/youtube-dl-subscriptions","symbolStatus":"Symbols loaded."},"reason":"new"}}
[2021-12-06T08:28:01.627Z DEBUG codelldb::dap_codec] <-- {"type":"response","request_seq":3,"success":true,"command":"setFunctionBreakpoints","body":{"breakpoints":[]}}
[2021-12-06T08:28:01.628Z DEBUG codelldb::dap_codec] <-- {"type":"request","seq":4,"command":"runInTerminal","arguments":{"args":["/nix/store/84zay225zfzqv4gl1dabhwp72775ff70-vscode-extension-vadimcn-vscode-lldb-1.6.8/share/vscode/extensions/vadimcn.vscode-lldb/adapter/.codelldb-wrapped","terminal-agent","--port=56934"],"cwd":"","kind":"integrated","title":"Debug executable 'youtube-dl-subscriptions'"}}
[2021-12-06T08:28:01.635Z DEBUG codelldb::dap_codec] --> {"command":"setDataBreakpoints","arguments":{"breakpoints":[]},"type":"request","seq":4}
[2021-12-06T08:28:01.636Z DEBUG codelldb::dap_codec] <-- {"type":"response","request_seq":4,"success":true,"command":"setDataBreakpoints","body":{"breakpoints":[]}}
[2021-12-06T08:28:01.780Z DEBUG codelldb::dap_codec] --> {"command":"setExceptionBreakpoints","arguments":{"filters":["rust_panic"]},"type":"request","seq":5}
[2021-12-06T08:28:03.982Z DEBUG codelldb::dap_codec] --> {"type":"response","seq":6,"command":"runInTerminal","request_seq":4,"success":true,"body":{"shellProcessId":11713}}
[2021-12-06T08:28:04.418Z DEBUG codelldb::debug_session] Debug event: 0x6000022e9258 Event: broadcaster = 0x7fc78c13c420 (lldb.target), type = 0x00000001 (breakpoint-changed), data = {}
[2021-12-06T08:28:04.418Z DEBUG codelldb::dap_codec] <-- {"type":"response","request_seq":5,"success":true,"command":"setExceptionBreakpoints"}
[2021-12-06T08:28:04.421Z DEBUG codelldb::dap_codec] --> {"command":"configurationDone","type":"request","seq":7}
[2021-12-06T08:28:04.424Z DEBUG codelldb::dap_codec] <-- {"type":"event","seq":5,"event":"output","body":{"output":"Launching: /Users/nbanks/Projects/youtube-dl-subscriptions/target/debug/youtube-dl-subscriptions\n"}}
[2021-12-06T08:28:05.116Z ERROR codelldb::debug_session] failed to get reply to handshake packet
[2021-12-06T08:28:05.116Z DEBUG codelldb::dap_codec] <-- {"type":"response","request_seq":2,"success":false,"command":"","message":"failed to get reply to handshake packet","show_user":true}
[2021-12-06T08:28:05.116Z DEBUG codelldb::dap_codec] <-- {"type":"response","request_seq":7,"success":true,"command":"configurationDone"}
[2021-12-06T08:28:05.302Z DEBUG codelldb::dap_codec] --> {"command":"disconnect","arguments":{"restart":false},"type":"request","seq":8}
[2021-12-06T08:28:05.313Z DEBUG codelldb::dap_codec] <-- {"type":"response","request_seq":8,"success":true,"command":"disconnect"}
[2021-12-06T08:28:05.627Z DEBUG codelldb::dap_session] Client has disconnected
[2021-12-06T08:28:05.634Z DEBUG codelldb::debug_session] End of the requests stream
[2021-12-06T08:28:05.634Z DEBUG codelldb::debug_session] DebugSession::drop()
[2021-12-06T08:28:05.636Z DEBUG codelldb] Session has ended
[2021-12-06T08:28:05.647Z DEBUG codelldb] Exiting
Debug adapter exit code=0, signal=null.

Additional context

Attempts to resolve the issues and others who are experiencing it in different context is here.

Notify maintainers

@oxalica

Metadata

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-darwin"`
 - host os: `Darwin 21.1.0, macOS 10.16`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.4`
 - channels(root): `"nixpkgs-22.05pre334535.9f25a8ac3a9"`
 - nixpkgs: `/etc/nixpkgs`

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute:
# a list of nixos modules affected by the problem
module:
   - vscode-extensions.vadimcn.vscode-lldb
@nigelgbanks nigelgbanks added the 0.kind: bug Something is broken label Dec 6, 2021
@oxalica
Copy link
Contributor

oxalica commented Dec 6, 2021

Sorry, i no longer use vscode.

@nigelgbanks
Copy link
Author

@oxalica Fair enough, I'll pick away at this in my spare moments and if I sort this out I'll raise a pull request.

@veprbl veprbl added the 6.topic: darwin Running or building packages on Darwin label Dec 6, 2021
@nigelgbanks nigelgbanks self-assigned this Feb 14, 2022
@arapov
Copy link
Contributor

arapov commented Dec 7, 2022

this issue is still present.

 - system: `"x86_64-darwin"`
 - host os: `Darwin 22.1.0, macOS 10.16`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.11.1`
 - channels(root): `"nixpkgs"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`
Initial debug configuration: {
  type: 'lldb',
  request: 'launch',
  name: 'Debug',
  cargo: {
    args: [ 'build', '--bin=play00', '--package=play00' ],
    filter: { name: 'play00', kind: 'bin' }
  },
  args: [],
  cwd: '${workspaceFolder}',
  __configurationTarget: 6
}
Raw artifacts:
{
  fileName: '/Users/anton/Workspace/tutorials/play00/target/debug/play00',
  name: 'play00',
  kind: 'bin'
}
Filtered artifacts: 
{
  fileName: '/Users/anton/Workspace/tutorials/play00/target/debug/play00',
  name: 'play00',
  kind: 'bin'
}
Resolved debug configuration: {
  type: 'lldb',
  request: 'launch',
  name: 'Debug',
  args: [],
  cwd: '${workspaceFolder}',
  __configurationTarget: 6,
  relativePathBase: '/Users/anton/Workspace/tutorials/play00',
  program: '/Users/anton/Workspace/tutorials/play00/target/debug/play00',
  sourceLanguages: [ 'rust' ],
  _adapterSettings: {
    displayFormat: 'auto',
    showDisassembly: 'auto',
    dereferencePointers: true,
    suppressMissingSourceFiles: true,
    evaluationTimeout: 5,
    consoleMode: 'commands',
    sourceLanguages: null,
    terminalPromptClear: null,
    evaluateForHovers: true,
    commandCompletions: true,
    reproducer: false
  }
}
liblldb: /Users/anton/.vscode-oss/extensions/vadimcn.vscode-lldb/lldb/lib/liblldb.dylib
environment: {}
params: {
  evaluateForHovers: true,
  commandCompletions: true,
  sourceLanguages: [ 'rust' ]
}
[2022-12-07T14:33:21.090Z DEBUG codelldb] New debug session
[2022-12-07T14:33:21.148Z ERROR codelldb::debug_session] Initialize Python interpreter: Error:  Fail
    Error Message:
    error: module importing failed: invalid pathname
    
[2022-12-07T14:33:21.148Z DEBUG codelldb::dap_codec] --> {"command":"initialize","arguments":{"clientID":"vscode","clientName":"VSCodium","adapterID":"lldb","pathFormat":"path","linesStartAt1":true,"columnsStartAt1":true,"supportsVariableType":true,"supportsVariablePaging":true,"supportsRunInTerminalRequest":true,"locale":"en-us","supportsProgressReporting":true,"supportsInvalidatedEvent":true,"supportsMemoryReferences":true,"supportsArgsCanBeInterpretedByShell":true},"type":"request","seq":1}
[2022-12-07T14:33:21.148Z DEBUG codelldb::dap_codec] <-- {"seq":1,"type":"response","request_seq":1,"success":true,"command":"initialize","body":{"exceptionBreakpointFilters":[{"default":true,"filter":"rust_panic","label":"Rust: on panic"}],"supportTerminateDebuggee":true,"supportsCancelRequest":true,"supportsCompletionsRequest":true,"supportsConditionalBreakpoints":true,"supportsConfigurationDoneRequest":true,"supportsDataBreakpoints":true,"supportsDelayedStackTraceLoading":true,"supportsEvaluateForHovers":true,"supportsFunctionBreakpoints":true,"supportsGotoTargetsRequest":true,"supportsHitConditionalBreakpoints":true,"supportsLogPoints":true,"supportsReadMemoryRequest":true,"supportsRestartFrame":true,"supportsSetVariable":true,"supportsWriteMemoryRequest":true}}
[2022-12-07T14:33:21.156Z DEBUG codelldb::dap_codec] --> {"command":"launch","arguments":{"type":"lldb","request":"launch","name":"Debug","args":[],"cwd":"/Users/anton/Workspace/tutorials/play00","__configurationTarget":6,"relativePathBase":"/Users/anton/Workspace/tutorials/play00","program":"/Users/anton/Workspace/tutorials/play00/target/debug/play00","sourceLanguages":["rust"],"_adapterSettings":{"displayFormat":"auto","showDisassembly":"auto","dereferencePointers":true,"suppressMissingSourceFiles":true,"evaluationTimeout":5,"consoleMode":"commands","sourceLanguages":null,"terminalPromptClear":null,"evaluateForHovers":true,"commandCompletions":true,"reproducer":false},"__sessionId":"a7952983-e9df-4813-9e46-4cc95feb3b86"},"type":"request","seq":2}
[2022-12-07T14:33:21.157Z DEBUG codelldb::dap_codec] <-- {"seq":2,"type":"event","event":"output","body":{"category":"stderr","output":"Could not initialize Python interpreter - some features will be unavailable (e.g. debug visualizers).\n"}}
[2022-12-07T14:33:21.157Z DEBUG codelldb::dap_codec] <-- {"seq":3,"type":"event","event":"output","body":{"output":"Console is in 'commands' mode, prefix expressions with '?'.\n"}}
[2022-12-07T14:33:21.204Z DEBUG codelldb::dap_codec] <-- {"seq":4,"type":"event","event":"initialized"}
[2022-12-07T14:33:21.204Z DEBUG codelldb::debug_session] Debug event: 0x7fc336f08548 Event: broadcaster = 0x7fc327c9f440 (lldb.target), type = 0x00000002 (modules-loaded), data = {play00}
[2022-12-07T14:33:21.204Z DEBUG codelldb::dap_codec] <-- {"seq":5,"type":"event","event":"module","body":{"module":{"addressRange":"FFFFFFFFFFFFFFFF","id":"FFFFFFFFFFFFFFFF","name":"play00","path":"/Users/anton/Workspace/tutorials/play00/target/debug/play00","symbolFilePath":"/Users/anton/Workspace/tutorials/play00/target/debug/play00","symbolStatus":"Symbols loaded."},"reason":"new"}}
[2022-12-07T14:33:21.204Z DEBUG codelldb::dap_codec] <-- {"seq":6,"type":"request","command":"runInTerminal","arguments":{"args":["/nix/store/7fryvvdiv8m2iqkbjnj8nja579q7fnb7-vscode-extension-vadimcn-vscode-lldb-1.8.1/share/vscode/extensions/vadimcn.vscode-lldb/adapter/.codelldb-wrapped","terminal-agent","--connect=49856"],"cwd":"","kind":"integrated","title":"Debug"}}
[2022-12-07T14:33:21.208Z DEBUG codelldb::dap_codec] --> {"command":"setBreakpoints","arguments":{"source":{"name":"main.rs","path":"/Users/anton/Workspace/tutorials/play00/src/main.rs"},"lines":[8],"breakpoints":[{"line":8}],"sourceModified":false},"type":"request","seq":3}
[2022-12-07T14:33:21.208Z DEBUG codelldb::dap_codec] --> {"command":"setFunctionBreakpoints","arguments":{"breakpoints":[]},"type":"request","seq":4}
[2022-12-07T14:33:21.208Z DEBUG codelldb::dap_codec] --> {"command":"setDataBreakpoints","arguments":{"breakpoints":[]},"type":"request","seq":5}
[2022-12-07T14:33:21.208Z DEBUG codelldb::dap_codec] --> {"command":"setExceptionBreakpoints","arguments":{"filters":["rust_panic"]},"type":"request","seq":6}
[2022-12-07T14:33:21.224Z DEBUG codelldb::debug_session] Debug event: 0x7fc336f1f608 Event: broadcaster = 0x7fc327c9f440 (lldb.target), type = 0x00000001 (breakpoint-changed), data = {}
[2022-12-07T14:33:21.224Z DEBUG codelldb::dap_codec] <-- {"seq":7,"type":"response","request_seq":3,"success":true,"command":"setBreakpoints","body":{"breakpoints":[{"id":1,"line":8,"message":"Resolved locations: 0","verified":true}]}}
[2022-12-07T14:33:21.224Z DEBUG codelldb::dap_codec] <-- {"seq":8,"type":"response","request_seq":4,"success":true,"command":"setFunctionBreakpoints","body":{"breakpoints":[]}}
[2022-12-07T14:33:21.224Z DEBUG codelldb::dap_codec] <-- {"seq":9,"type":"response","request_seq":5,"success":true,"command":"setDataBreakpoints","body":{"breakpoints":[]}}
[2022-12-07T14:33:21.240Z DEBUG codelldb::debug_session] Debug event: 0x7fc34784f428 Event: broadcaster = 0x7fc327c9f440 (lldb.target), type = 0x00000001 (breakpoint-changed), data = {}
[2022-12-07T14:33:21.240Z DEBUG codelldb::dap_codec] <-- {"seq":10,"type":"response","request_seq":6,"success":true,"command":"setExceptionBreakpoints"}
[2022-12-07T14:33:21.350Z DEBUG codelldb::dap_codec] --> {"command":"configurationDone","type":"request","seq":7}
[2022-12-07T14:33:21.350Z DEBUG codelldb::dap_codec] <-- {"seq":11,"type":"response","request_seq":7,"success":true,"command":"configurationDone"}
[2022-12-07T14:33:21.355Z DEBUG codelldb::dap_codec] --> {"command":"threads","type":"request","seq":8}
[2022-12-07T14:33:21.355Z DEBUG codelldb::dap_codec] <-- {"seq":12,"type":"response","request_seq":8,"success":true,"command":"threads","body":{"threads":[]}}
[2022-12-07T14:33:22.672Z DEBUG codelldb::dap_codec] --> {"type":"response","seq":9,"command":"runInTerminal","request_seq":6,"success":true,"body":{"shellProcessId":15045}}
[2022-12-07T14:33:23.246Z DEBUG codelldb::dap_codec] <-- {"seq":13,"type":"event","event":"output","body":{"output":"Launching: /Users/anton/Workspace/tutorials/play00/target/debug/play00\n"}}
[2022-12-07T14:33:23.894Z ERROR codelldb::debug_session] Connection shut down by remote side while waiting for reply to initial handshake packet
[2022-12-07T14:33:23.894Z DEBUG codelldb::dap_codec] <-- {"seq":14,"type":"response","request_seq":2,"success":false,"command":"","message":"Connection shut down by remote side while waiting for reply to initial handshake packet","show_user":true}
[2022-12-07T14:33:23.916Z DEBUG codelldb::dap_codec] --> {"command":"disconnect","arguments":{"restart":false},"type":"request","seq":10}
[2022-12-07T14:33:23.916Z ERROR codelldb::debug_session] Internal debugger error: Sending isconnect packet failed.
[2022-12-07T14:33:23.916Z DEBUG codelldb::dap_codec] <-- {"seq":15,"type":"response","request_seq":10,"success":false,"command":"","message":"Internal debugger error: Sending isconnect packet failed.","show_user":true}
[2022-12-07T14:33:24.403Z DEBUG codelldb::dap_session] Client has disconnected
[2022-12-07T14:33:24.403Z DEBUG codelldb::debug_session] End of the requests stream
[2022-12-07T14:33:24.403Z DEBUG codelldb::debug_session] DebugSession::drop()
[2022-12-07T14:33:24.403Z DEBUG codelldb] End of the debug session
[2022-12-07T14:33:24.414Z DEBUG codelldb] Exiting
Debug adapter exit code=0 (0x0), signal=null.

@arapov
Copy link
Contributor

arapov commented Dec 13, 2022

I feel like the build itself is broken. I wonder if it will help if we can bring the build closer two what we get via vadimcn.vscode-lldb installation using vscode module install, which works flawlessly... I am not knowledgable enough to fix the nix scripts though.

@nigelgbanks, have you actually had a time to look into this problem?

@nigelgbanks
Copy link
Author

I've unfortunately not had time to dig into this further.

qrlex pushed a commit to qrlex/nixpkgs that referenced this issue Oct 9, 2023
Summary:

  vscode-lldb has been broken on Darwin due to a build-time issue:

    * on Darwin, the vscode-lldb build scripts expect $HOME to exist and be
      writable, NixOS#202507

  and several runtime-issues:

    * codelldb can't find its dynamic libraries (NixOS#160874)

    * lldb-server from nixpkgs doesn't work due to missing the

        "com.apple.security.cs.debugger"

      macOS codesigning entitlement, (NixOS#38624), also with the symptom that
      tccd, the macOS "Transparency, Consent, and Control" daemon, denies
      requests it receives from vscode/codium with log messages like:

	  "AUTHREQ_CTX: msgID=..., function=<private>, service=kTCCServiceDeveloperTool, preflight=yes, query=1,"
          "Service kTCCServiceDeveloperTool does not allow prompting; returning denied."
          "AUTHREQ_RESULT: msgID=..., authValue=0, authReason=5, authVersion=1, error=(null),", etc.

    * lldb-server from nixpkgs may also provide a different CLI interface than
      codelldb expects on macOS.

    * vscode-lldb directs lldb to load rust pretty-printing scripts which need
      to be preserved through the build process in nixpkgs

Solution:

  * The build problem can be fixed by setting HOME="$(pwd)/home", as suggested
    in NixOS#202507.

  * The dynamic libraries issue can be fixed by setting LD_LIBRARY_PATH while
    wrapping codelldb

  * The permissions issue and CLI interface issue can both be fixed by using
    Xcode's debugserver,

      /Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/Resources/debugserver

    on macOS, since it has the required entitlement and the expected interface.

  * Finally, the script-loading issue can be fixed by copying the required
    scripts to the location that vscode-lldb expects to find them in.

Fixes:

  * NixOS#148946: Error failed to get reply to handshake packet on x86_64-darwin
    with vscode-extensions.vadimcn.vscode-lldb

  * NixOS#160874: codelldb inside of vscode-lldb extension doesn't work

  * NixOS#202507: vscode-extensions.vadimcn.vscode-lldb fails to build on aarch64-darwin

(cherry picked from commit fa70e7499b08524a4a02e7ce9e39847b9d3c95df)
wegank pushed a commit to mstone/nixpkgs that referenced this issue Apr 10, 2024
Summary:

  vscode-lldb has been broken on Darwin due to a build-time issue:

    * on Darwin, the vscode-lldb build scripts expect $HOME to exist and be
      writable, NixOS#202507

  and several runtime-issues:

    * codelldb can't find its dynamic libraries (NixOS#160874)

    * lldb-server from nixpkgs doesn't work due to missing the

        "com.apple.security.cs.debugger"

      macOS codesigning entitlement, (NixOS#38624), also with the symptom that
      tccd, the macOS "Transparency, Consent, and Control" daemon, denies
      requests it receives from vscode/codium with log messages like:

	  "AUTHREQ_CTX: msgID=..., function=<private>, service=kTCCServiceDeveloperTool, preflight=yes, query=1,"
          "Service kTCCServiceDeveloperTool does not allow prompting; returning denied."
          "AUTHREQ_RESULT: msgID=..., authValue=0, authReason=5, authVersion=1, error=(null),", etc.

    * lldb-server from nixpkgs may also provide a different CLI interface than
      codelldb expects on macOS.

    * vscode-lldb directs lldb to load rust pretty-printing scripts which need
      to be preserved through the build process in nixpkgs

Solution:

  * The build problem can be fixed by setting HOME="$(pwd)/home", as suggested
    in NixOS#202507.

  * The dynamic libraries issue can be fixed by setting LD_LIBRARY_PATH while
    wrapping codelldb

  * The permissions issue and CLI interface issue can both be fixed by using
    Xcode's debugserver,

      /Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/Resources/debugserver

    on macOS, since it has the required entitlement and the expected interface.

  * Finally, the script-loading issue can be fixed by copying the required
    scripts to the location that vscode-lldb expects to find them in.

Fixes:

  * NixOS#148946: Error failed to get reply to handshake packet on x86_64-darwin
    with vscode-extensions.vadimcn.vscode-lldb

  * NixOS#160874: codelldb inside of vscode-lldb extension doesn't work

  * NixOS#202507: vscode-extensions.vadimcn.vscode-lldb fails to build on aarch64-darwin
@superherointj superherointj changed the title Error failed to get reply to handshake packet on x86_64-darwin with vscode-extensions.vadimcn.vscode-lldb vscode-extensions.vadimcn.vscode-lldb: Error failed to get reply to handshake packet on x86_64-darwin Jun 17, 2024
@superherointj
Copy link
Contributor

superherointj commented Jun 17, 2024

Seems fixed by #211321
Re-open in case issue persist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken 6.topic: darwin Running or building packages on Darwin 6.topic: vscode
Projects
None yet
Development

No branches or pull requests

5 participants