Cmake error incorect git version

Sysprogs forums Forums VisualGDB Cmake error incorect git version

Tagged: , ,

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #35640
    Nakame
    Participant

    Hello !

    I am trying to add fuzz testing to my project using google fuzztest framework but when i try to add the cmakelist i get the following error :

     

    CMake Error at C:/Users/User/AppData/Local/VisualGDB/CMake/share/cmake-3.28/Modules/ExternalProject.cmake:2796 (message):
    git version 1.6.5 or later required for –recursive flag with ‘git
    submodule …’: GIT_VERSION_STRING=”
    Call Stack (most recent call first):
    C:/Users/User/AppData/Local/VisualGDB/CMake/share/cmake-3.28/Modules/ExternalProject.cmake:2915 (_ep_get_git_submodules_recurse)
    C:/Users/User/AppData/Local/VisualGDB/CMake/share/cmake-3.28/Modules/ExternalProject.cmake:4422 (_ep_add_download_command)
    CMakeLists.txt:29 (ExternalProject_Add)

    — Configuring incomplete, errors occurred!

    CMake Error at C:/Users/User/AppData/Local/VisualGDB/CMake/share/cmake-3.28/Modules/FetchContent.cmake:1667 (message):
    CMake step for abseil-cpp failed: 1
    Call Stack (most recent call first):
    C:/Users/User/AppData/Local/VisualGDB/CMake/share/cmake-3.28/Modules/FetchContent.cmake:1819:EVAL:2 (__FetchContent_directPopulate)
    C:/Users/User/AppData/Local/VisualGDB/CMake/share/cmake-3.28/Modules/FetchContent.cmake:1819 (cmake_language)
    C:/Users/User/AppData/Local/VisualGDB/CMake/share/cmake-3.28/Modules/FetchContent.cmake:2033 (FetchContent_Populate)
    fuzztest/cmake/BuildDependencies.cmake:71 (FetchContent_MakeAvailable)
    fuzztest/CMakeLists.txt:37 (include)

     

    Adding the lines :

    find_package(Git)
    message(STATUS “GIT_EXECUTABLE=’${GIT_EXECUTABLE}'”)

    seem to give me the correct path to the toolchain’s git executable ( ” GIT_EXECUTABLE=’C:/SysGCC/raspberryBuster/arm-linux-gnueabihf/sysroot/usr/bin/git’ ” ) but i still get the error.

    Any ideas on how i could fix that ?

     

    Thank you in advance !

    #35641
    support
    Keymaster

    Hi,

    This looks like an issue with CMake and not VisualGDB. Please consider asking in the CMake community instead.

    #35642
    bflannery
    Participant

    If you want to use git within CMake on windows you need to make sure git is runnable from from your ps/cmd environment.

    You will probably find difficult to run the arm-linux-gnueabihf git executable on your windows machine.

    If you add git to your PATH and restart visual studio I believe this issue will go away. (also remove the find_git)

    Test by running “git version” from your command prompt.

    • This reply was modified 1 month ago by bflannery.
    #35645
    Nakame
    Participant

    While i agree that it is a cmake problem, it is also a visualGDB problem as other cmake projects seem to work fine.

    I do have git installed for window and the PATH environment variable is corretly set. Git work in the window cmd terminal without issues, but the visualGDB cmake file stubornly keep looking for git inside the toolchain files. I did not find a way to force it to look for my local git installation .

     

    C:\Users\User>git version
    git version 2.45.1.windows.1

     

    #35648
    bflannery
    Participant

    This post on stack overflow seems to describe a solution to your problem.

    https://stackoverflow.com/a/43995834

    And if clearing the cache doesn’t work perhaps you can try setting the variable manually.

    #35650
    support
    Keymaster

    @bflannery, thanks for the link


    @Nakame
    , If you believe this is a VisualGDB problem, please make sure you can reproduce it on a clean project created from scratch. If it persists, please share complete repro steps that we could follow on our side to reproduce the issue. Please make sure the steps include the screenshots of all screens where you change any settingsĀ  (e.g. all wizard pages). You can read more about the scope of VisualGDB support here: https://visualgdb.com/support/scope/

    #35652
    Nakame
    Participant

    @bflannery thank you for the link but i had already tryed that before comming here šŸ™‚ How can i force the directory for git myself ?

     

    @support i am almost positive this have something to do with visualGDB as it does work on other cmake project. Here is the screenshots of me creating a new project from scratch and failing

    Attachments:
    You must be logged in to view attached files.
    #35657
    support
    Keymaster

    Hi,

    According to the screenshots, you are referencing a 3rd-party library that is raising the error.

    Please try creating a similar project manually outside VisualGDB using the same toolchain referencing the same library.

    If it works without errors, please share the screenshots of the manual process (including the screenshots of all files you edited), and we will help you configure VisualGDB to match the manually configured project.

    #35658
    bflannery
    Participant

    This configures without error for me. I didn’t try with the manually cloning.

    Side note, I hate wordpress forums.

    • This reply was modified 4 weeks, 1 day ago by bflannery.
    • This reply was modified 4 weeks, 1 day ago by bflannery.
    #35668
    Nakame
    Participant

    Hello !

     

    @bfannery thank you very much ! This is helpful and i learned something šŸ™‚ Unfortunatly it doest solve the issue at all. I have the exact same error . From what i can gather the error come from the fact that cmake in visualGDB projects look for git in the toolchain folder and so fail to use it ( since it’s a git for linux and i am working on window ) I could not find a way to force cmake to look inside another forlderĀ  for git …

    @support I used the method showed by @bfannery to try and fetch a git folder for another cmake project i made using visualGDB and i am having the same error. I am joining here both cmakefiles

     

    Attachments:
    You must be logged in to view attached files.
    #35671
    Nakame
    Participant

    ho and here is the error i get. You can see that the git executable found is located inside the toolchain folder and not in windows as expected.

    Attachments:
    You must be logged in to view attached files.
    #35676
    bflannery
    Participant

    You can override the variable by setting it in your CMakeLists.txt file.

    Otherwise, you should just be able to modify your CMakeCache.txt to point the variables at the correct git executable.

    This is located under {ProjectDir}/build/VisualGDB/{Configuration}/CMakeCache.txt

    Not sure why it is finding the wrong git.exe to begin with though. It may have something to do with where you added git.exe in your environment variables. If visual studio wasn’t running under your credentials it may not see a user variable.

     

    #35687
    Nakame
    Participant

    Thank you very much ! I will try this solution as soon as i have some time to spare.

Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.