summaryrefslogtreecommitdiff
path: root/util/abuild
diff options
context:
space:
mode:
authorRaul E Rangel <rrangel@chromium.org>2019-07-10 12:49:24 -0600
committerMartin Roth <martinroth@google.com>2019-08-08 03:42:24 +0000
commitcccb815c5e4d908db9a668643eda241a740923f2 (patch)
treedf24d70e690040ff1ec261c75ad1f1af3000b900 /util/abuild
parentf4d2c8714f9910def04243731818ca7449d0afa1 (diff)
util/abuild: Clean up the missing_arches check
This change adds the following improvements: * Easier to read. * Checks to see if .xcompile is complete. * Checks the make return code. This will catch if .xcompile is missing. BUG=b:112267918 TEST=Modified my .xcompile and ran abuild and verified that missing_arches got set correctly. Also deleted .xcompile and verified there was a failure. Change-Id: I7604d431f398fc0c80a857a0c7c21e164004cc99 Signed-off-by: Raul E Rangel <rrangel@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/34241 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Martin Roth <martinroth@google.com>
Diffstat (limited to 'util/abuild')
-rwxr-xr-xutil/abuild/abuild20
1 files changed, 18 insertions, 2 deletions
diff --git a/util/abuild/abuild b/util/abuild/abuild
index 03be0d412e..ef4e46b8ed 100755
--- a/util/abuild/abuild
+++ b/util/abuild/abuild
@@ -462,10 +462,26 @@ function build_config
return
fi
+ local required_arches
+
required_arches=$(grep -E "^CONFIG_ARCH_(BOOTBLOCK|R.MSTAGE|VERSTAGE)" "$TARGET/${BUILD_NAME}/config.build" | \
sed "s,^CONFIG_ARCH_[^_]*_\([^=]*\)=.*$,\1," |sort -u |tr 'A-Z\n\r' 'a-z ')
- # shellcheck disable=SC2016,SC2059
- missing_arches=$(printf 'include .xcompile\nall: ; @echo $(foreach arch,'"$required_arches"',$(if $(filter $(arch),$(SUBARCH_SUPPORTED)),,$(arch)))' | $MAKE --no-print-directory -f -)
+
+ missing_arches="$($MAKE --no-print-directory -f - \
+ REQUIRED_ARCHES="$required_arches" <<'EOF'
+include .xcompile
+.PHONY: missing_arches
+missing_arches:
+ $(if $(XCOMPILE_COMPLETE),,$(error .xcompile is invalid.))
+ @echo $(foreach arch,$(REQUIRED_ARCHES),$(if $(filter $(arch),$(SUBARCH_SUPPORTED)),,$(arch)))
+EOF
+)"
+ # shellcheck disable=SC2181
+ if [[ $? -ne 0 ]]; then
+ echo "Calculating missing_arches failed" >&2
+ exit 1
+ fi
+
if [ -n "$missing_arches" ]; then
printf "skipping %s because we're missing compilers for (%s)\n" "$BUILD_NAME" "$missing_arches"
return