microsoft / vscode-cmake-tools

CMake integration in Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=vector-of-bool.cmake-tools
MIT License
1.46k stars 447 forks source link

FetchContent: missing git password prompt #3439

Open KnoerleMaTLS opened 10 months ago

KnoerleMaTLS commented 10 months ago

Brief Issue Summary

When configuring a project using the CMake tools extension and CMakePresets there is no password prompt for git repositories cloned by FetchContent. When running the same cmake presets from the terminal directly, there is a prompt which asks for the password for the private repository.

Since the CMake tools extension just uses the "output" window there will probably be no way to get this working, right?

Best regards, Manuel

CMake Tools Diagnostics

No response

Debug Log

No response

Additional Information

No response

snehara99 commented 10 months ago

Hi @KnoerleMaTLS thank you for bringing this to our attention. We'll add this to our backlog and look into it as soon as we have the capacity! We can potentially look into a prompt for the password outside of the output window.

J-Rios commented 4 months ago

Hi,

Unfortunately I just ran into the same issue...

Do you find any workaround for this (a part of manually call cmake from terminal)? For example like configuring some vscode task and/or using ssh-agent?

RageCPP commented 3 months ago

Same question, how to use git ssh authentication when building

bacTlink commented 1 month ago

Same question. I have to manually download the package.

Evelyn-001 commented 1 month ago

Thanks for reporting this issue. Today we try to repro this issue using a simple CMake project, but we didn't repro it. No matter running the same CMake presets from the terminal or configuring the project using the CMake tools extension directly, the prompt which asks for the password for the private repository is displayed. Please see attached video. For further investigation, could you please share us a demo project with clear repro steps? If we miss or misunderstand anything, please let us know. Thanks. ENV: VS code: 1.91.1 CMake Tool: v1.18.44 not repor1 not repor2

J-Rios commented 1 month ago

Hello,

I see this problem at least in this scenario:

A basic CMakeList.txt example to replicate the issue:

cmake_minimum_required(VERSION 3.29)

project(test1 VERSION 0.1.0 LANGUAGES C CXX)

add_executable(test1 main.cpp)

include(FetchContent)

FetchContent_Declare(
    squeue
    GIT_REPOSITORY git@github.com:J-Rios/squeue.git
    GIT_TAG main
)
FetchContent_MakeAvailable(squeue)

Running CMake from a terminal make it shows a promt to ask for the user input of the SSH key passphrase, and it fetch the content and build the project properly:

imagen

But running CMake from VSCode doesn't show any window dialog neither vscode terminal promt to input the passphrase, it keeps there configuring the project forever (cmake is waiting for the user to provide the passphrase in the "backend", but no "frontend" way to provide it):

imagen

Env:

VS code: 1.91.1 CMake Tool: v1.18.44 OS: Windows 11 (But using WSL with Ubuntu 22.04 LTS; also with wslg, so it can show X11 and Wayland GUI windows).

Best Regards :)

Evelyn-001 commented 1 month ago

Thanks for your reply. We have reproduced this issue using WSL with Ubuntu 22.04 LTS with below ENV, when running cmake presets from the terminal directly, there is a prompt which asks for the password for the private repository but configuring the project using the CMake tools extension directly, the project always configuring, and no prompt which asks for the password for the private repository is displayed. Our development team will investigate this issue later and we will provide you with any updates. Thank you for your support. Env: VS code: 1.91.1 CMake Tool: v1.18.44 OS: Windows 10 (using WSL with Ubuntu 22.04 LTS) image

080202

KnoerleMaTLS commented 1 month ago

Thank you @J-Rios for the reproduction steps. This is almost the same setup in which i had run into the problem. Instead of SSH we use a PAT for the authorization. Anyway the behaviour is the same and no password prompt is shown.

Sorry for initially not mentioning the fact, that this was run in the WSL. Totally forgot about it. Also thanks @Evelyn-001 for your investigations. Looking forward to hearing from you again.