From da45a88dd33e88aa59c2669f64a4ae7490dfc199 Mon Sep 17 00:00:00 2001 From: Yu-Ping Wu Date: Fri, 23 May 2025 12:58:19 +0800 Subject: [PATCH] util/abuild: Fix checking of missing_arches The commit f66c7c1037e9 ("util/abuild: Update echo to printf for consistency") accidentally added whitespaces to the missing_arches variable, causing the [[ -n "${missing_arches}" ]] check to fail. The commit c81b08c4bac7 ("util/abuild: Fix building ChromeOS boards") intended to fix it, but did it the wrong way. Now, really fix the problem from the Makefile snippet that is causing the whitespace issue. Change-Id: I5e417e851840bad000492bf737fc8e25063fe0c4 Signed-off-by: Yu-Ping Wu Reviewed-on: https://review.coreboot.org/c/coreboot/+/87809 Tested-by: build bot (Jenkins) Reviewed-by: Felix Singer Reviewed-by: Matt DeVillier --- util/abuild/abuild | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/util/abuild/abuild b/util/abuild/abuild index 007ced4ed8..faac3eb347 100755 --- a/util/abuild/abuild +++ b/util/abuild/abuild @@ -586,10 +586,11 @@ build_config() missing_arches="$(${MAKE} --no-print-directory -f - \ REQUIRED_ARCHES="${required_arches}" <<'EOF' include $(xcompile) -.PHONY: missing_arches -missing_arches: +MISSING_ARCHES=$(foreach arch,$(REQUIRED_ARCHES),$(if $(filter $(arch),$(SUBARCH_SUPPORTED)),,$(arch))) +.PHONY: check_missing_arches +check_missing_arches: $(if $(XCOMPILE_COMPLETE),,$(error $(xcompile) is invalid.)) - @printf "%s\n" "$(foreach arch,$(REQUIRED_ARCHES),$(if $(filter $(arch),$(SUBARCH_SUPPORTED)),,$(arch)))" + @printf "%s\n" "$(strip $(MISSING_ARCHES))" EOF )" # shellcheck disable=SC2181 @@ -598,7 +599,7 @@ EOF exit 1 fi - if [[ -z "${missing_arches}" ]]; then + if [[ -n "${missing_arches}" ]]; then printf "skipping %s because we're missing compilers for (%s)\n" "${BUILD_NAME}" "${missing_arches}" return fi