From c81b08c4bac7f5de285fb14c84db4cd5e908f288 Mon Sep 17 00:00:00 2001 From: Yu-Ping Wu Date: Fri, 16 May 2025 14:10:17 +0800 Subject: [PATCH] util/abuild: Fix building ChromeOS boards The commit 49ae935b3778 ("util/abuild: Change [...] to [[...]] for consistency") [1] accidentally replaced "\>" with ">" in a grep pattern, causing all boards to be considered not supporting ChromeOS. The commit f66c7c1037e9 ("util/abuild: Update echo to printf for consistency") [2] replaced @echo $(foreach arch,$(REQUIRED_ARCHES),\ $(if $(filter $(arch),$(SUBARCH_SUPPORTED)),,$(arch))) with @printf "%s\n" "$(foreach arch,$(REQUIRED_ARCHES),\ $(if $(filter $(arch),$(SUBARCH_SUPPORTED)),,$(arch)))" and caused an additional whitespace character to be printed when all required archs are supported. The result of the `missing_arches` shell variable would be " ", and hence the `[[ -n "$missing_arches" ]]` check would be wrong. Fix this by using `-z`. [1] CB:87367 [2] CB:87368 Change-Id: Ib77566e70ac8b3717f3b29433ce9ae0a1fc69cce Signed-off-by: Yu-Ping Wu Reviewed-on: https://review.coreboot.org/c/coreboot/+/87708 Tested-by: build bot (Jenkins) Reviewed-by: Jakub "Kuba" Czapiga Reviewed-by: Paul Menzel Reviewed-by: Yidi Lin --- util/abuild/abuild | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/abuild/abuild b/util/abuild/abuild index 66316e2eac..007ced4ed8 100755 --- a/util/abuild/abuild +++ b/util/abuild/abuild @@ -510,7 +510,7 @@ build_config() export HOSTCC='gcc' - if [[ "${chromeos}" = true ]] && [[ "$(grep -c "^[[:space:]]*select[[:space:]]*MAINBOARD_HAS_CHROMEOS>" "${ROOT}/src/mainboard/${board_srcdir}/Kconfig")" -eq 0 ]]; then + if [[ "${chromeos}" = true ]] && [[ "$(grep -c "^[[:space:]]*select[[:space:]]*MAINBOARD_HAS_CHROMEOS\>" "${ROOT}/src/mainboard/${board_srcdir}/Kconfig")" -eq 0 ]]; then printf "%s doesn't support ChromeOS, skipping.\n" "${BUILD_NAME}" return fi @@ -598,7 +598,7 @@ EOF exit 1 fi - if [[ -n "${missing_arches}" ]]; then + if [[ -z "${missing_arches}" ]]; then printf "skipping %s because we're missing compilers for (%s)\n" "${BUILD_NAME}" "${missing_arches}" return fi