vscode-cmake-tools icon indicating copy to clipboard operation
vscode-cmake-tools copied to clipboard

FetchContent: missing git password prompt

Open KnoerleMaTLS opened this issue 1 year ago • 11 comments

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

KnoerleMaTLS avatar Nov 13 '23 12:11 KnoerleMaTLS

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.

snehara99 avatar Nov 14 '23 17:11 snehara99

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?

J-Rios avatar Apr 19 '24 08:04 J-Rios

Same question, how to use git ssh authentication when building

RageCPP avatar Jun 07 '24 00:06 RageCPP

Same question. I have to manually download the package.

bacTlink avatar Jul 29 '24 09:07 bacTlink

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

Evelyn-001 avatar Aug 01 '24 07:08 Evelyn-001

Hello,

I see this problem at least in this scenario:

  • Having an SSH key with a passphrase.
  • Using SSH for getting the Git repository.
  • Using WSL (perhaps also on Linux, but didn't check).

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 [email protected]: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 :)

J-Rios avatar Aug 01 '24 22:08 J-Rios

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

Evelyn-001 avatar Aug 02 '24 08:08 Evelyn-001

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.

KnoerleMaTLS avatar Aug 02 '24 08:08 KnoerleMaTLS

@KnoerleMaTLS @Evelyn-001 Does configuring from CMake Tools and the fact that it doesn't prompt for a github password block the completion of your configure? Or is it just that you're expecting it to prompt for the github password and it doesn't?

gcampbell-msft avatar Oct 02 '24 10:10 gcampbell-msft