Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/50494 )
Change subject: util/abuild: Ensure that non-Chrome OS builds are non-Chrome OS ......................................................................
util/abuild: Ensure that non-Chrome OS builds are non-Chrome OS
Sometimes boards enable it by default, making the Kconfig option impossible to disable without messing with the Kconfig files. This shouldn't happen, so report on such occurrences early.
TEST=Tried building GOOGLE_KOHAKU through abuild with -x, without -x and both cases after having added a "select CHROMEOS" for testing and it failed in the "without -x with select" scenario while properly configuring and passing all other builds.
Change-Id: Ieb6bcbf3e9ca8cd4ced85c7c9ffaa39505f5a9b7 Signed-off-by: Patrick Georgi pgeorgi@google.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/50494 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Angel Pons th3fanbus@gmail.com --- M util/abuild/abuild 1 file changed, 24 insertions(+), 5 deletions(-)
Approvals: build bot (Jenkins): Verified Angel Pons: Looks good to me, approved
diff --git a/util/abuild/abuild b/util/abuild/abuild index 408de12..0b7b05c 100755 --- a/util/abuild/abuild +++ b/util/abuild/abuild @@ -330,14 +330,23 @@ local BUILD_DIR="$1" local TEST_TYPE="$2" local TEST_STRING="$3" + local NEGATE="$4"
local CONFIG_FILE="$BUILD_DIR/config.build" local CONFIG_LOG="$BUILD_DIR/config.log"
- if ! grep -q "$TEST_STRING" "$CONFIG_FILE"; then - echo "config file: $CONFIG_FILE has incorrect $TEST_TYPE" - echo "Error: Expected '$TEST_STRING' in config file." >> "$CONFIG_LOG" - return 1 + if [ -z "$NEGATE" ]; then + if ! grep -q "$TEST_STRING" "$CONFIG_FILE"; then + echo "config file: $CONFIG_FILE has incorrect $TEST_TYPE" + echo "Error: Expected '$TEST_STRING' in config file." >> "$CONFIG_LOG" + return 1 + fi + else + if grep -q "$TEST_STRING" "$CONFIG_FILE"; then + echo "config file: $CONFIG_FILE has incorrect $TEST_TYPE" + echo "Error: Expected not to see '$TEST_STRING' in config file." >> "$CONFIG_LOG" + return 1 + fi fi
return 0 @@ -443,7 +452,17 @@ check_config "$build_dir" "vendor" "CONFIG_VENDOR_$(mainboard_vendor "${MAINBOARD}")=y" local VENDOR_OK=$?
- if [ $BUILDENV_CREATED -ne 0 ] || [ $MAINBOARD_OK -ne 0 ] || [ $VENDOR_OK -ne 0 ]; then + if [ "$chromeos" = false ]; then + # Skip this rule for configs created from templates that already + # come with CHROMEOS enabled. + grep -q "^CONFIG_CHROMEOS=y" ${config_file:-/dev/null} || \ + check_config "$build_dir" "Chrome OS" "CONFIG_CHROMEOS=y" negate + local FORCE_ENABLED_CROS=$? + else + local FORCE_ENABLED_CROS=0 + fi + + if [ $BUILDENV_CREATED -ne 0 ] || [ $MAINBOARD_OK -ne 0 ] || [ $VENDOR_OK -ne 0 ] || [ $FORCE_ENABLED_CROS -eq 1 ]; then junit " <testcase classname='board${testclass/#/.}' name='$BUILD_NAME' >"
junit "<failure type='BuildFailed'>"