mirror of
https://github.com/espressif/esp-idf
synced 2025-03-10 01:29:21 -04:00
build: Fix problems with building kconfig and generating sdkconfig
We had some problems: simultaneous compiling of kconfig in the same tree; attempt to use menuconfig in some examples and ut in batch mode (w/o interactive console) Also increase debug abilities in CI: force non-interactive building; add variable DEBUG_SHELL to toggle verbosity of scripts
This commit is contained in:
parent
2935e958fc
commit
f3d61015f7
@ -26,6 +26,8 @@ variables:
|
|||||||
# IDF environment
|
# IDF environment
|
||||||
|
|
||||||
IDF_PATH: "$CI_PROJECT_DIR"
|
IDF_PATH: "$CI_PROJECT_DIR"
|
||||||
|
BATCH_BUILD: "1"
|
||||||
|
V: "0"
|
||||||
APPLY_BOT_FILTER_SCRIPT: "$CI_PROJECT_DIR/tools/ci/apply_bot_filter.py"
|
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"
|
CHECKOUT_REF_SCRIPT: "$CI_PROJECT_DIR/tools/ci/checkout_project_ref.py"
|
||||||
|
|
||||||
|
@ -45,6 +45,9 @@ help:
|
|||||||
@echo "See also 'make bootloader', 'make bootloader-flash', 'make bootloader-clean', "
|
@echo "See also 'make bootloader', 'make bootloader-flash', 'make bootloader-clean', "
|
||||||
@echo "'make partition_table', etc, etc."
|
@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
|
# dependency checks
|
||||||
ifndef MAKE_RESTARTS
|
ifndef MAKE_RESTARTS
|
||||||
ifeq ("$(filter 4.% 3.81 3.82,$(MAKE_VERSION))","")
|
ifeq ("$(filter 4.% 3.81 3.82,$(MAKE_VERSION))","")
|
||||||
|
@ -15,15 +15,19 @@ SDKCONFIG ?= $(PROJECT_PATH)/sdkconfig
|
|||||||
# overrides (usually used for esp-idf examples)
|
# overrides (usually used for esp-idf examples)
|
||||||
SDKCONFIG_DEFAULTS ?= $(PROJECT_PATH)/sdkconfig.defaults
|
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
|
# reset MAKEFLAGS as the menuconfig makefile uses implicit compile rules
|
||||||
$(KCONFIG_TOOL_DIR)/mconf $(KCONFIG_TOOL_DIR)/conf: $(wildcard $(KCONFIG_TOOL_DIR)/*.c)
|
$(KCONFIG_TOOL_DIR)/mconf $(KCONFIG_TOOL_DIR)/conf: $(wildcard $(KCONFIG_TOOL_DIR)/*.c)
|
||||||
MAKEFLAGS="" CC=$(HOSTCC) LD=$(HOSTLD) \
|
MAKEFLAGS="" CC=$(HOSTCC) LD=$(HOSTLD) \
|
||||||
$(MAKE) -C $(KCONFIG_TOOL_DIR)
|
$(MAKE) -C $(KCONFIG_TOOL_DIR)
|
||||||
|
|
||||||
ifeq ("$(wildcard $(SDKCONFIG))","")
|
ifeq ("$(wildcard $(SDKCONFIG))","")
|
||||||
ifeq ("$(filter defconfig clean% %clean, $(MAKECMDGOALS))","")
|
# if no configuration file is present we need a rule for it
|
||||||
# if no configuration file is present and defconfig or clean
|
ifeq ("$(filter $(NON_INTERACTIVE_TARGET), $(MAKECMDGOALS))","")
|
||||||
# is not a named target, run defconfig then menuconfig to get the initial config
|
# if special non-interactive item is not a named target (eg. 'defconfig', 'clean')
|
||||||
|
# run defconfig then menuconfig to get the initial config
|
||||||
$(SDKCONFIG): menuconfig
|
$(SDKCONFIG): menuconfig
|
||||||
menuconfig: defconfig
|
menuconfig: defconfig
|
||||||
else
|
else
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
# Safety settings (see https://gist.github.com/ilg-ul/383869cbb01f61a51c4d).
|
# Safety settings (see https://gist.github.com/ilg-ul/383869cbb01f61a51c4d).
|
||||||
|
|
||||||
if [[ ! -z ${DEBUG} ]]
|
if [[ ! -z ${DEBUG_SHELL} ]]
|
||||||
then
|
then
|
||||||
set -x # Activate the expand mode if DEBUG is anything but empty.
|
set -x # Activate the expand mode if DEBUG is anything but empty.
|
||||||
fi
|
fi
|
||||||
|
@ -5,6 +5,10 @@
|
|||||||
# Sets the error behaviour options for shell throughout the CI environment
|
# Sets the error behaviour options for shell throughout the CI environment
|
||||||
#
|
#
|
||||||
set -o errexit # Exit if command failed.
|
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
|
[ -z $CI_COMMIT_REF_NAME ] && echo "This internal script should only be run by a Gitlab CI runner." && exit 1
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
# Common bash
|
# Common bash
|
||||||
if [[ ! -z ${DEBUG} ]]; then
|
if [[ ! -z ${DEBUG_SHELL} ]]; then
|
||||||
set -x # Activate the expand mode if DEBUG is anything but empty.
|
set -x # Activate the expand mode if DEBUG is anything but empty.
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
# Common bash
|
# Common bash
|
||||||
|
|
||||||
if [[ ! -z ${DEBUG} ]]
|
if [[ ! -z ${DEBUG_SHELL} ]]
|
||||||
then
|
then
|
||||||
set -x # Activate the expand mode if DEBUG is anything but empty.
|
set -x # Activate the expand mode if DEBUG is anything but empty.
|
||||||
fi
|
fi
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
# Common bash
|
# Common bash
|
||||||
|
|
||||||
if [[ ! -z ${DEBUG} ]]
|
if [[ ! -z ${DEBUG_SHELL} ]]
|
||||||
then
|
then
|
||||||
set -x # Activate the expand mode if DEBUG is anything but empty.
|
set -x # Activate the expand mode if DEBUG is anything but empty.
|
||||||
fi
|
fi
|
||||||
|
@ -5,6 +5,8 @@
|
|||||||
|
|
||||||
PROJECT_NAME := unit-test-app
|
PROJECT_NAME := unit-test-app
|
||||||
|
|
||||||
|
NON_INTERACTIVE_TARGET += ut-apply-config-% ut-clean-%
|
||||||
|
|
||||||
include $(IDF_PATH)/make/project.mk
|
include $(IDF_PATH)/make/project.mk
|
||||||
|
|
||||||
# List of unit-test-app configurations.
|
# List of unit-test-app configurations.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user