From d16022bdd470a8aedbb0ba5c5c2646a040ff1a9a Mon Sep 17 00:00:00 2001 From: Martin Roth Date: Sun, 25 Jun 2017 14:21:09 -0600 Subject: [PATCH] util/abuild: Update abuild MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Improve logging - Add location of logfiles to failed board log. - Log when the shared utilities fail to build. - Log passing configs and print count of tested configs that passed. - Disable a couple of shellcheck warnings. - Remove some unused code. Change-Id: Ic2cf1c0a5f123d759aac7ce55092ad71314a8c9d Signed-off-by: Martin Roth Reviewed-on: https://review.coreboot.org/20359 Tested-by: build bot (Jenkins) Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Nico Huber --- util/abuild/abuild | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/util/abuild/abuild b/util/abuild/abuild index 6473fcf69a..6591edf443 100755 --- a/util/abuild/abuild +++ b/util/abuild/abuild @@ -274,9 +274,13 @@ function update_config # shellcheck disable=SC2059 printf "$configoptions" >> "${config_file}" + # shellcheck disable=SC2086 + # Disabling SC2086 for "$silent" only yes "" 2>/dev/null | $MAKE oldconfig $silent "DOTCONFIG=${config_file}" "obj=${build_dir}" "objutil=$TARGET/sharedutils" &> "${build_dir}/config.log" ; \ CONFIG_OK=$? if [ $CONFIG_OK -eq 0 ]; then + # shellcheck disable=SC2086 + # Disabling SC2086 for "$silent" only $MAKE savedefconfig $silent DEFCONFIG="${defconfig_file}" DOTCONFIG="${config_file}" obj="${build_dir}" objutil="$TARGET/sharedutils" &>> "${build_dir}/config.log" return $? else @@ -361,6 +365,7 @@ function compile_target junit "" printf "ok\n" > compile.status printf "%s built successfully. (took %ss)\n" "$BUILD_NAME" "${duration}" + echo "$BUILD_NAME" >> "$PASSED_BOARDS" else junit "" junitfile make.log @@ -368,7 +373,7 @@ function compile_target printf "failed\n" > compile.status printf "%s build FAILED after %ss!\nLog excerpt:\n" "$BUILD_NAME" "${duration}" tail -n $CONTEXT make.log 2> /dev/null || tail -$CONTEXT make.log - echo "$BUILD_NAME" >> "$FAILED_BOARDS" + echo "$BUILD_NAME - Log: ${TOP}/${build_dir}/make.log" >> "$FAILED_BOARDS" failed=1 fi cd "$CURR" || return $? @@ -440,11 +445,10 @@ function build_config tail -n $CONTEXT "$build_dir/config.log" 2> /dev/null || tail -$CONTEXT "$build_dir/config.log" junit "" - echo "$BUILD_NAME" >> "$FAILED_BOARDS" + echo "$BUILD_NAME - Log: ${TOP}/$build_dir/config.log" >> "$FAILED_BOARDS" return fi - required_arches=$(egrep "^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 @@ -718,9 +722,10 @@ if [ "$customizing" = "" ]; then fi FAILED_BOARDS="$TOP/$TARGET/failed_boards" +PASSED_BOARDS="$TOP/$TARGET/passing_boards" if [ "$recursive" = "false" ]; then - rm -f "$FAILED_BOARDS" + rm -f "$FAILED_BOARDS" "$PASSED_BOARDS" fi USE_XARGS=0 @@ -788,9 +793,7 @@ build_targets() junitfile "$TARGET/sharedutils/make.log" junit "" junit "" - return - fi - if [ $ret -eq 1 ]; then + echo "Shared Utilities - Log: ${TOP}/$TARGET/sharedutils/make.log" >> "$FAILED_BOARDS" return fi @@ -847,12 +850,13 @@ junit '' if [ "$recursive" = "false" ]; then - # Print the list of failed boards + # Print the list of failed configurations if [ -f "$FAILED_BOARDS" ]; then - printf "%s build(s) failed:\n" "$( wc -l < "$FAILED_BOARDS" )" + printf "%s configuration(s) failed:\n" "$( wc -l < "$FAILED_BOARDS" )" cat "$FAILED_BOARDS" + echo else - echo "All tested boards passed." + printf "All %s tested configurations passed.\n" "$( wc -l < "$PASSED_BOARDS" )" fi fi