diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2b5e8cf79..d20088dad 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -31,6 +31,8 @@ variables: # jobs can overwrite this variable to only fetch submodules they required # set to "none" if don't need to fetch submodules SUBMODULES_TO_FETCH: "all" + # tell build system do not check submodule update as we download archive instead of clone + IDF_SKIP_CHECK_SUBMODULES: 1 UNIT_TEST_BUILD_SYSTEM: cmake EXAMPLE_TEST_BUILD_SYSTEM: cmake diff --git a/make/project.mk b/make/project.mk index 796f2e39c..af30fe609 100644 --- a/make/project.mk +++ b/make/project.mk @@ -144,7 +144,7 @@ EXTRA_COMPONENT_DIRS ?= COMPONENT_DIRS := $(PROJECT_PATH)/components $(EXTRA_COMPONENT_DIRS) $(IDF_PATH)/components $(PROJECT_PATH)/main endif # Make sure that every directory in the list is an absolute path without trailing slash. -# This is necessary to split COMPONENT_DIRS into SINGLE_COMPONENT_DIRS and MULTI_COMPONENT_DIRS below. +# This is necessary to split COMPONENT_DIRS into SINGLE_COMPONENT_DIRS and MULTI_COMPONENT_DIRS below. COMPONENT_DIRS := $(foreach cd,$(COMPONENT_DIRS),$(abspath $(cd))) export COMPONENT_DIRS @@ -153,11 +153,11 @@ $(warning SRCDIRS variable is deprecated. These paths can be added to EXTRA_COMP COMPONENT_DIRS += $(abspath $(SRCDIRS)) endif -# List of component directories, i.e. directories which contain a component.mk file +# List of component directories, i.e. directories which contain a component.mk file SINGLE_COMPONENT_DIRS := $(abspath $(dir $(dir $(foreach cd,$(COMPONENT_DIRS),\ $(wildcard $(cd)/component.mk))))) -# List of components directories, i.e. directories which may contain components +# List of components directories, i.e. directories which may contain components MULTI_COMPONENT_DIRS := $(filter-out $(SINGLE_COMPONENT_DIRS),$(COMPONENT_DIRS)) # The project Makefile can define a list of components, but if it does not do this @@ -635,6 +635,11 @@ clean: app-clean bootloader-clean config-clean ldgen-clean # # This only works for components inside IDF_PATH check-submodules: +# for internal use: +# skip submodule check if running on Gitlab CI and job is configured as not clone submodules +ifeq ($(IDF_SKIP_CHECK_SUBMODULES),1) + @echo "skip submodule check on internal CI" +else # Check if .gitmodules exists, otherwise skip submodule check, assuming flattened structure ifneq ("$(wildcard ${IDF_PATH}/.gitmodules)","") @@ -662,7 +667,7 @@ endef # so the argument is suitable for use with 'git submodule' commands $(foreach submodule,$(subst $(IDF_PATH)/,,$(filter $(IDF_PATH)/%,$(COMPONENT_SUBMODULES))),$(eval $(call GenerateSubmoduleCheckTarget,$(submodule)))) endif # End check for .gitmodules existence - +endif # PHONY target to list components in the build and their paths list-components: diff --git a/tools/cmake/git_submodules.cmake b/tools/cmake/git_submodules.cmake index 09098b24a..e36ee919f 100644 --- a/tools/cmake/git_submodules.cmake +++ b/tools/cmake/git_submodules.cmake @@ -11,6 +11,14 @@ if(NOT GIT_FOUND) else() function(git_submodule_check root_path) + # for internal use: + # skip submodule check if running on Gitlab CI and job is configured as not clone submodules + if($ENV{IDF_SKIP_CHECK_SUBMODULES}) + if($ENV{IDF_SKIP_CHECK_SUBMODULES} EQUAL 1) + message("skip submodule check on internal CI") + return() + endif() + endif() execute_process( COMMAND ${GIT_EXECUTABLE} submodule status