util/abuild: Fix checking of missing_arches

The commit f66c7c1037 ("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 c81b08c4ba ("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 <yupingso@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/87809
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
This commit is contained in:
Yu-Ping Wu 2025-05-23 12:58:19 +08:00 committed by Felix Singer
commit da45a88dd3

View file

@ -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