From f810eb7a39b4ec9d531ff6407317878b5bb1bcef Mon Sep 17 00:00:00 2001 From: "Michael (XIAO Xufeng)" Date: Tue, 25 Oct 2022 21:47:13 +0800 Subject: [PATCH] ci: Fix environment variable IDF_CI_BUILD is not set --- .gitlab-ci.yml | 2 ++ Kconfig | 4 ++++ components/esp_common/include/esp_attr.h | 2 +- components/esp_hw_support/test/test_rtc_clk.c | 4 ++-- tools/ci/configure_ci_environment.sh | 2 +- 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d70f12efbc..0e10cecd39 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -68,6 +68,8 @@ variables: # target test repo parameters TEST_ENV_CONFIG_REPO: "https://gitlab-ci-token:${BOT_TOKEN}@${CI_SERVER_HOST}:${CI_SERVER_PORT}/qa/ci-test-runner-configs.git" + IDF_CI_BUILD: 1 + .setup_tools_unless_target_test: &setup_tools_unless_target_test | if [[ -n "$IDF_DONT_USE_MIRRORS" ]]; then export IDF_MIRROR_PREFIX_MAP= diff --git a/Kconfig b/Kconfig index 928d274106..d584399954 100644 --- a/Kconfig +++ b/Kconfig @@ -13,6 +13,10 @@ mainmenu "Espressif IoT Development Framework Configuration" bool option env="IDF_ENV_FPGA" + config IDF_CI_BUILD + bool + default y if "$(IDF_CI_BUILD)" = "y" || "$(IDF_CI_BUILD)" = 1 + config IDF_TARGET_ARCH_RISCV bool default "n" diff --git a/components/esp_common/include/esp_attr.h b/components/esp_common/include/esp_attr.h index d65b9dae9d..319415e41f 100644 --- a/components/esp_common/include/esp_attr.h +++ b/components/esp_common/include/esp_attr.h @@ -154,7 +154,7 @@ FORCE_INLINE_ATTR TYPE& operator<<=(TYPE& a, int b) { a = a << b; return a; } /* Use IDF_DEPRECATED attribute to mark anything deprecated from use in ESP-IDF's own source code, but not deprecated for external users. */ -#ifdef IDF_CI_BUILD +#ifdef CONFIG_IDF_CI_BUILD #define IDF_DEPRECATED(REASON) __attribute__((deprecated(REASON))) #else #define IDF_DEPRECATED(REASON) diff --git a/components/esp_hw_support/test/test_rtc_clk.c b/components/esp_hw_support/test/test_rtc_clk.c index 10fa7cc114..a04d90e3dc 100644 --- a/components/esp_hw_support/test/test_rtc_clk.c +++ b/components/esp_hw_support/test/test_rtc_clk.c @@ -177,7 +177,7 @@ TEST_CASE("Test fast switching between PLL and XTAL", "[rtc_clk]") /* In CI environments, the 32kXTAL runners don't have 8MB psram for bank switching. So can only test one config or the other. */ -#if !IDF_CI_BUILD || !CONFIG_SPIRAM_BANKSWITCH_ENABLE +#if !defined(CONFIG_IDF_CI_BUILD) || !CONFIG_SPIRAM_BANKSWITCH_ENABLE #define COUNT_TEST 3 #define TIMEOUT_TEST_MS (5 + CONFIG_ESP32_RTC_CLK_CAL_CYCLES / 16) @@ -322,7 +322,7 @@ TEST_CASE("Test starting 'External 32kHz XTAL' on the board without it.", "[rtc_ start_freq(RTC_SLOW_FREQ_RTC, 0); } -#endif // !IDF_CI_BUILD || !CONFIG_SPIRAM_BANKSWITCH_ENABLE +#endif // !defined(CONFIG_IDF_CI_BUILD) || !CONFIG_SPIRAM_BANKSWITCH_ENABLE #endif // !TEMPORARY_DISABLED_FOR_TARGETS(ESP32S2, ESP32S3, ESP32C3) diff --git a/tools/ci/configure_ci_environment.sh b/tools/ci/configure_ci_environment.sh index d3617bd057..1a6c1920b2 100644 --- a/tools/ci/configure_ci_environment.sh +++ b/tools/ci/configure_ci_environment.sh @@ -16,7 +16,7 @@ DEBUG_SHELL=${DEBUG_SHELL:-"0"} # Compiler flags to thoroughly check the IDF code in some CI jobs # (Depends on default options '-Wno-error=XXX' used in the IDF build system) -PEDANTIC_FLAGS="-DIDF_CI_BUILD -Werror -Werror=deprecated-declarations -Werror=unused-variable -Werror=unused-but-set-variable -Werror=unused-function" +PEDANTIC_FLAGS="-Werror -Werror=deprecated-declarations -Werror=unused-variable -Werror=unused-but-set-variable -Werror=unused-function" export PEDANTIC_CFLAGS="${PEDANTIC_FLAGS} -Wstrict-prototypes" export PEDANTIC_CXXFLAGS="${PEDANTIC_FLAGS}"