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

CMake : errors concerning GetGitRevisionDescription.cmake during configure step #357

Closed
arnodu opened this issue Oct 24, 2022 · 0 comments · Fixed by #358
Closed

CMake : errors concerning GetGitRevisionDescription.cmake during configure step #357

arnodu opened this issue Oct 24, 2022 · 0 comments · Fixed by #358

Comments

@arnodu
Copy link

arnodu commented Oct 24, 2022

Hi,

This is related to my previous issue #348 and the error during cmake configuration when git is invoked to fetch the branch/version string. #353 partially fixes my issues, but in very specific cases, i still get the error.

The error message i get looks like :

-- The CXX compiler identification is GNU 9.4.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at external/git/cmake/GetGitRevisionDescription.cmake:71 (get_filename_component):
  get_filename_component called with incorrect number of arguments
Call Stack (most recent call first):
  external/git/cmake/GetGitRevisionDescription.cmake:160 (_git_find_closest_git_dir)
  CMakeLists.txt:495 (get_git_head_revision)
CMake Error at external/git/cmake/GetGitRevisionDescription.cmake:71 (get_filename_component):
  get_filename_component called with incorrect number of arguments
Call Stack (most recent call first):
  external/git/cmake/GetGitRevisionDescription.cmake:160 (_git_find_closest_git_dir)
  external/git/cmake/GetGitRevisionDescription.cmake:200 (get_git_head_revision)
  external/git/cmake/GetGitRevisionDescription.cmake:268 (git_describe)
  CMakeLists.txt:501 (git_get_exact_tag)
CMake Error at external/git/cmake/GetGitRevisionDescription.cmake:71 (get_filename_component):
  get_filename_component called with incorrect number of arguments
Call Stack (most recent call first):
  external/git/cmake/GetGitRevisionDescription.cmake:160 (_git_find_closest_git_dir)
  external/git/cmake/GetGitRevisionDescription.cmake:321 (get_git_head_revision)
  CMakeLists.txt:503 (git_get_branch)
CMake Error at external/git/cmake/GetGitRevisionDescription.cmake:71 (get_filename_component):
  get_filename_component called with incorrect number of arguments
Call Stack (most recent call first):
  external/git/cmake/GetGitRevisionDescription.cmake:160 (_git_find_closest_git_dir)
  external/git/cmake/GetGitRevisionDescription.cmake:355 (get_git_head_revision)
  CMakeLists.txt:510 (git_get_short_hash)
CMake Error at external/git/cmake/GetGitRevisionDescription.cmake:71 (get_filename_component):
  get_filename_component called with incorrect number of arguments
Call Stack (most recent call first):
  external/git/cmake/GetGitRevisionDescription.cmake:160 (_git_find_closest_git_dir)
  external/git/cmake/GetGitRevisionDescription.cmake:285 (get_git_head_revision)
  CMakeLists.txt:522 (git_local_changes)
-- Found MPI_CXX: /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi_cxx.so (found version "3.1") 
-- Found MPI: TRUE (found version "3.1")  
-- Found LibXml2: /usr/lib/x86_64-linux-gnu/libxml2.so (found version "2.9.10") 
-- RapidJSON library not found, JSON support will be disabled.
-- Performing Test CXX_COMPILER_SUPPORTS_SANITIZE_MODULE
-- Performing Test CXX_COMPILER_SUPPORTS_SANITIZE_MODULE - Success
-- Performing Test HAVE___BUILTIN_UNREACHABLE
-- Performing Test HAVE___BUILTIN_UNREACHABLE - Success
-- Configuring incomplete, errors occurred!
See also "/builds/<..>/build/external/Build/bitpit_external/CMakeFiles/CMakeOutput.log".

In my specific case, bitpit is in a git submodule for my application AND i try to compile my application into a gitlab-ci job. As a result, the git command to retrieve the branch name for bitpit fails (because of this) and i get this error.

Anyway, there is a patch that i think you should include in your GetGitRevisionDescription.cmake : rpavlik/cmake-modules@3933abd .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant