Skip to content
Permalink
Browse files
submodules.cmake: add missing --depth=1
  • Loading branch information
kevgs committed Jul 2, 2021
1 parent 2bf6f2c commit ffe744e
Showing 1 changed file with 1 addition and 1 deletion.
@@ -28,7 +28,7 @@ IF(GIT_EXECUTABLE AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
RESULT_VARIABLE update_result)
ELSE()
MESSAGE(STATUS "Updating submodules")
EXECUTE_PROCESS(COMMAND "${GIT_EXECUTABLE}" submodule update --init
EXECUTE_PROCESS(COMMAND "${GIT_EXECUTABLE}" submodule update --init --depth=1
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
RESULT_VARIABLE update_result)
ENDIF()

2 comments on commit ffe744e

@narayannewworld
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am getting below error and it seems --depth=1 is causing the issue .

-- Updating submodules
usage: git submodule [--quiet] add [-b ] [-f|--force] [--name ] [--reference ] [--] []
or: git submodule [--quiet] status [--cached] [--recursive] [--] [...]
or: git submodule [--quiet] init [--] [...]
or: git submodule [--quiet] deinit [-f|--force] [--] ...
or: git submodule [--quiet] update [--init] [--remote] [-N|--no-fetch] [-f|--force] [--rebase] [--reference ] [--merge] [--recursive] [--] [...]
or: git submodule [--quiet] summary [--cached|--files] [--summary-limit ] [commit] [--] [...]
or: git submodule [--quiet] foreach [--recursive]
or: git submodule [--quiet] sync [--recursive] [--] [...]
CMake Error at cmake/submodules.cmake:38 (MESSAGE):
No MariaDB Connector/C! Run

  /usr/bin/git submodule update --init

Then restart the build.
Call Stack (most recent call first):
CMakeLists.txt:412 (INCLUDE)

@vuvova
Copy link
Member

@vuvova vuvova commented on ffe744e Sep 29, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This means too old git. On a CentOS 7, perhaps?

Your options are:

  • upgrade git
  • hack away --depth 1 from this file
  • run git submodules --update --recursive --init and cmake -DUPDATE_SUBMODULES=0
  • patch this file to detect an old git and skip --depth 1 as needed (and create a pull request with this change 😄)

Please sign in to comment.