util/abuild: Fix building ChromeOS boards

The commit 49ae935b37 ("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 f66c7c1037 ("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 <yupingso@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/87708
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jakub "Kuba" Czapiga <czapiga@google.com>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Reviewed-by: Yidi Lin <yidilin@google.com>
This commit is contained in:
Yu-Ping Wu 2025-05-16 14:10:17 +08:00 committed by Yu-Ping Wu
commit c81b08c4ba

View file

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