diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f98f2b970..c3e188bdc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -26,6 +26,8 @@ variables: # IDF environment IDF_PATH: "$CI_PROJECT_DIR" + BATCH_BUILD: "1" + V: "0" APPLY_BOT_FILTER_SCRIPT: "$CI_PROJECT_DIR/tools/ci/apply_bot_filter.py" CHECKOUT_REF_SCRIPT: "$CI_PROJECT_DIR/tools/ci/checkout_project_ref.py" diff --git a/make/project.mk b/make/project.mk index 31f72bc5f..a5bc916bf 100644 --- a/make/project.mk +++ b/make/project.mk @@ -45,6 +45,9 @@ help: @echo "See also 'make bootloader', 'make bootloader-flash', 'make bootloader-clean', " @echo "'make partition_table', etc, etc." +# Non-interactive targets. Mostly, those for which you do not need to build a binary +NON_INTERACTIVE_TARGET += defconfig clean% %clean help list-components print_flash_cmd + # dependency checks ifndef MAKE_RESTARTS ifeq ("$(filter 4.% 3.81 3.82,$(MAKE_VERSION))","") diff --git a/make/project_config.mk b/make/project_config.mk index 0a212cd28..8f0006c79 100644 --- a/make/project_config.mk +++ b/make/project_config.mk @@ -15,15 +15,19 @@ SDKCONFIG ?= $(PROJECT_PATH)/sdkconfig # overrides (usually used for esp-idf examples) SDKCONFIG_DEFAULTS ?= $(PROJECT_PATH)/sdkconfig.defaults +# Workaround to run make parallel (-j). mconf and conf cannot be made simultaneously +$(KCONFIG_TOOL_DIR)/mconf: $(KCONFIG_TOOL_DIR)/conf + # reset MAKEFLAGS as the menuconfig makefile uses implicit compile rules $(KCONFIG_TOOL_DIR)/mconf $(KCONFIG_TOOL_DIR)/conf: $(wildcard $(KCONFIG_TOOL_DIR)/*.c) MAKEFLAGS="" CC=$(HOSTCC) LD=$(HOSTLD) \ $(MAKE) -C $(KCONFIG_TOOL_DIR) ifeq ("$(wildcard $(SDKCONFIG))","") -ifeq ("$(filter defconfig clean% %clean, $(MAKECMDGOALS))","") -# if no configuration file is present and defconfig or clean -# is not a named target, run defconfig then menuconfig to get the initial config +# if no configuration file is present we need a rule for it +ifeq ("$(filter $(NON_INTERACTIVE_TARGET), $(MAKECMDGOALS))","") +# if special non-interactive item is not a named target (eg. 'defconfig', 'clean') +# run defconfig then menuconfig to get the initial config $(SDKCONFIG): menuconfig menuconfig: defconfig else diff --git a/tools/ci/build_examples.sh b/tools/ci/build_examples.sh index df6c90811..f36ff60df 100755 --- a/tools/ci/build_examples.sh +++ b/tools/ci/build_examples.sh @@ -23,7 +23,7 @@ # ----------------------------------------------------------------------------- # Safety settings (see https://gist.github.com/ilg-ul/383869cbb01f61a51c4d). -if [[ ! -z ${DEBUG} ]] +if [[ ! -z ${DEBUG_SHELL} ]] then set -x # Activate the expand mode if DEBUG is anything but empty. fi diff --git a/tools/ci/configure_ci_environment.sh b/tools/ci/configure_ci_environment.sh index 77d094076..a92600e92 100644 --- a/tools/ci/configure_ci_environment.sh +++ b/tools/ci/configure_ci_environment.sh @@ -5,6 +5,10 @@ # Sets the error behaviour options for shell throughout the CI environment # set -o errexit # Exit if command failed. +set -o pipefail # Exit if pipe failed. + +# we can use the appropriate secret variable for debugging +[ ! -z $DEBUG_SHELL ] && set -x [ -z $CI_COMMIT_REF_NAME ] && echo "This internal script should only be run by a Gitlab CI runner." && exit 1 diff --git a/tools/ci/get-full-sources.sh b/tools/ci/get-full-sources.sh index 058cab534..ee2604a31 100755 --- a/tools/ci/get-full-sources.sh +++ b/tools/ci/get-full-sources.sh @@ -12,7 +12,7 @@ # ----------------------------------------------------------------------------- # Common bash -if [[ ! -z ${DEBUG} ]]; then +if [[ ! -z ${DEBUG_SHELL} ]]; then set -x # Activate the expand mode if DEBUG is anything but empty. fi diff --git a/tools/ci/mirror-submodule-update.sh b/tools/ci/mirror-submodule-update.sh index 04471f143..068838a77 100755 --- a/tools/ci/mirror-submodule-update.sh +++ b/tools/ci/mirror-submodule-update.sh @@ -8,7 +8,7 @@ # ----------------------------------------------------------------------------- # Common bash -if [[ ! -z ${DEBUG} ]] +if [[ ! -z ${DEBUG_SHELL} ]] then set -x # Activate the expand mode if DEBUG is anything but empty. fi diff --git a/tools/ci/mirror-synchronize.sh b/tools/ci/mirror-synchronize.sh index 163e7db7f..5047744e5 100755 --- a/tools/ci/mirror-synchronize.sh +++ b/tools/ci/mirror-synchronize.sh @@ -7,7 +7,7 @@ # ----------------------------------------------------------------------------- # Common bash -if [[ ! -z ${DEBUG} ]] +if [[ ! -z ${DEBUG_SHELL} ]] then set -x # Activate the expand mode if DEBUG is anything but empty. fi diff --git a/tools/unit-test-app/Makefile b/tools/unit-test-app/Makefile index 13873900e..05f1dc353 100644 --- a/tools/unit-test-app/Makefile +++ b/tools/unit-test-app/Makefile @@ -5,6 +5,8 @@ PROJECT_NAME := unit-test-app +NON_INTERACTIVE_TARGET += ut-apply-config-% ut-clean-% + include $(IDF_PATH)/make/project.mk # List of unit-test-app configurations.