vscode-cmake-tools: [debugger] cannot debug vcpkg using cmake tools

Brief Issue Summary

Hi guys, Today I tried to debug the portfile in vcpkg according to the official doc. After adding tasks.json and launch.json and then clicking the Debug zlib portfile button, I got: image

Also, in TERNIMAL, I got some errors:

 *  Executing task: & "/Users/jackyu/Documents/vcpkg/vcpkg" remove zlib; & "/Users/jackyu/Documents/vcpkg/vcpkg" install zlib --no-binarycaching --x-cmake-debug \\.\pipe\portfile_debugging 

zsh:1: parse error near `&'

 *  The terminal process "/bin/zsh '-l', '-c', '& "/Users/jackyu/Documents/vcpkg/vcpkg" remove zlib; & "/Users/jackyu/Documents/vcpkg/vcpkg" install zlib --no-binarycaching --x-cmake-debug \\.\pipe\portfile_debugging'" failed to launch (exit code: 1). 
 *  Terminal will be reused by tasks, press any key to close it. 
 *

OS: macOS 14.1.1. CMake: 3.27.8 CMake Tools: v1.16.32

Is there any way to fix this?

Thanks.

CMake Tools Diagnostics

No response

Debug Log

No response

Additional Information

After modified the command & \"${workspaceFolder}/vcpkg\" remove zlib; & \"${workspaceFolder}/vcpkg\" install zlib --no-binarycaching --x-cmake-debug \\\\.\\pipe\\portfile_debugging to \"${workspaceFolder}/vcpkg\" install zlib --no-binarycaching --x-cmake-debug \\\\.\\pipe\\portfile_debugging, the task appears to be executed successfully, but the warning window still appears: image

About this issue

  • Original URL
  • State: closed
  • Created 7 months ago
  • Comments: 25

Most upvoted comments

@JackBoosY Thanks for reclarifying, sorry I missed that.

My thought is that the pipe name from that blog post, is a Windows named pipe, following the protocol for naming a pipe in Windows. However, in things like Linux and Mac, I believe it is simply treated as a file, so the format from the blog likely won’t work. Could you change the named pipe name to something else? Maybe even a new absolute path, that is in the current directory.

Let me know if this works for you.

As you can see:

OS: macOS 14.1.1. CMake: 3.27.8 CMake Tools: v1.16.32

You can also get launch.json and tasks.json in https://devblogs.microsoft.com/cppblog/debug-vcpkg-portfiles-in-cmake-script-mode-with-visual-studio-code/, they are same except the .exe suffix since my OS is macOS.