Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4BE0DC4321E for ; Sun, 4 Dec 2022 15:33:57 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5BF04856CD; Sun, 4 Dec 2022 16:16:51 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="uf9qRvM8"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A68B38563B; Sun, 4 Dec 2022 16:15:35 +0100 (CET) Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 079CB85641 for ; Sun, 4 Dec 2022 16:15:28 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-ej1-x633.google.com with SMTP id td2so22295994ejc.5 for ; Sun, 04 Dec 2022 07:15:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=9GfOjIjNwMfHrhNKL7vWdTNbHHnvVQ/JZ48v6XQJnk8=; b=uf9qRvM8XhhZR89P4643lAUfso6oOCVP0W2Rs35YPXGGwuWLN1VsbmvkJ5IjGFeDxI mG6mSW+zYVxxf4T9rkpMIkRp3B6bs4GY2N/GBGYHQUVq83CttMRs6EZrmdCaKJRGhklj 7dekaziWZJIsZTx3+wMJuGKQomeBvGlQ15t3I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9GfOjIjNwMfHrhNKL7vWdTNbHHnvVQ/JZ48v6XQJnk8=; b=GQ9MBuzENU8k1m0ASlFrvHxXqJlDzB8Y71QLt6RuGCXEFwzsaZoPX51cqfcYtZCO+k LRVEIUfpyj/GDoV4H6jhEe4msLiyQdfbbRAtQzmpm22+MjQq3PO0QorxDWLDRZOidcyJ FITOIHxczwBcRBAnLIMLGGwEUILTjvvWqg4Pop1TuwjTn9N0a0kFqkaME13LODD3aEsS NPp+/kSRHRaLVgZ8V3vOdU/cs8wfnn4wQpnRBda9V20gojj6sW9S5tedLqcvGgNjBXqB dVHykRrROIAPKNEiUPwfBO1X7+3M6vwAcLcGzZqnJ/0VrCfYQ1HXjNimdUzcJHWSWrnU SUzg== X-Gm-Message-State: ANoB5pmAVnvkE9dhM0uHzhhdtFfWwDQBD9v4pN/+q1MqzPCDoYqEZ9fS BrSLyTPhM3fvI45dqwFczWZTHiOMM0aNRb2n X-Google-Smtp-Source: AA0mqf6q6uXmu8QvVh0/2YHrrGfuWmw1jDeXREU/AzGZO4jpHmyXCNV/QeKdnXPuTs+wAMUvuc50ig== X-Received: by 2002:a17:906:840e:b0:7c0:d94c:7384 with SMTP id n14-20020a170906840e00b007c0d94c7384mr5014105ejx.109.1670166927456; Sun, 04 Dec 2022 07:15:27 -0800 (PST) Received: from bill-the-cat.lan (2603-6081-7b00-6400-61c7-2644-b62d-0af3.res6.spectrum.com. [2603:6081:7b00:6400:61c7:2644:b62d:af3]) by smtp.gmail.com with ESMTPSA id b21-20020aa7c915000000b00461816beef9sm5174405edt.14.2022.12.04.07.15.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Dec 2022 07:15:27 -0800 (PST) From: Tom Rini To: u-boot@lists.denx.de Subject: [PATCH 144/149] CI: Replace unmigrated symbol test with non-Kconfig introduction test Date: Sun, 4 Dec 2022 10:14:15 -0500 Message-Id: <20221204151420.56851-54-trini@konsulko.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221204151420.56851-1-trini@konsulko.com> References: <20221202214251.3027264-41-trini@konsulko.com> <20221204151420.56851-1-trini@konsulko.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Now that all symbols have been migrated to Kconfig, or are part of the CFG namespace we do not need a complex check for unmigrated CONFIG symbols. Any instance of #define (or #undef) or a CONFIG value is wrong, so cause CI to fail. This test is not as strict as possible yet as we have more symbols that were not previously caught to deal with. Signed-off-by: Tom Rini --- .azure-pipelines.yml | 31 ++++++------------------------- .gitlab-ci.yml | 28 +++++----------------------- 2 files changed, 11 insertions(+), 48 deletions(-) diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index add8847225f0..e102f6bf2af8 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -53,37 +53,18 @@ stages: -j$(sysctl -n hw.logicalcpu) displayName: 'Perform tools-only build' - - job: check_for_migrated_symbols_in_board_header - displayName: 'Check for migrated symbols in board header' + - job: check_for_new_CONFIG_symbols_outside_Kconfig + displayName: 'Check for new CONFIG symbols outside Kconfig' pool: vmImage: $(ubuntu_vm) container: image: $(ci_runner_image) options: $(container_option) steps: - - script: | - KSYMLST=`mktemp` - KUSEDLST=`mktemp` - RET=0 - cat `find . -name "Kconfig*"` | \ - sed -n -e 's/^\s*config *\([A-Za-z0-9_]*\).*$/CONFIG_\1/p' \ - -e 's/^\s*menuconfig *\([A-Za-z0-9_]*\).*$/CONFIG_\1/p' \ - | sort -u > $KSYMLST - for CFG in `find include/configs -name "*.h"`; do - (grep '#define[[:blank:]]CONFIG_' $CFG | \ - sed -n 's/#define.\(CONFIG_[A-Za-z0-9_]*\).*/\1/p' ; \ - grep '#undef[[:blank:]]CONFIG_' $CFG | \ - sed -n 's/#undef.\(CONFIG_[A-Za-z0-9_]*\).*/\1/p') | \ - sort -u > ${KUSEDLST} || true - NUM=`comm -123 --total --output-delimiter=, ${KSYMLST} ${KUSEDLST} | \ - cut -d , -f 3` - if [[ $NUM -ne 0 ]]; then - echo "Unmigrated symbols found in $CFG:" - comm -12 ${KSYMLST} ${KUSEDLST} - RET=1 - fi - done - exit $RET + # If grep succeeds and finds a match the test fails as we should + # have no matches. + - script: git grep -E '^#[[:blank:]]*(define|undef)[[:blank:]]*CONFIG_' \ + include/configs `find arch -name config.h` && exit 1 || exit 0 - job: cppcheck displayName: 'Static code analysis with cppcheck' diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 91d5e0c4a8c8..f84d08a729e1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -124,31 +124,13 @@ build all other platforms: exit $ret; fi; -check for migrated symbols in board header: +check for new CONFIG symbols outside Kconfig: stage: testsuites script: - - KSYMLST=`mktemp`; - KUSEDLST=`mktemp`; - RET=0; - cat `find . -name "Kconfig*"` | - sed -n -e 's/^\s*config *\([A-Za-z0-9_]*\).*$/CONFIG_\1/p' - -e 's/^\s*menuconfig *\([A-Za-z0-9_]*\).*$/CONFIG_\1/p' - | sort -u > $KSYMLST; - for CFG in `find include/configs -name "*.h"`; do - (grep '#define[[:blank:]]CONFIG_' $CFG | - sed -n 's/#define.\(CONFIG_[A-Za-z0-9_]*\).*/\1/p' ; - grep '#undef[[:blank:]]CONFIG_' $CFG | - sed -n 's/#undef.\(CONFIG_[A-Za-z0-9_]*\).*/\1/p') | - sort -u > ${KUSEDLST} || true; - NUM=`comm -123 --total --output-delimiter=, ${KSYMLST} ${KUSEDLST} | - cut -d , -f 3`; - if [[ $NUM -ne 0 ]]; then - echo "Unmigrated symbols found in $CFG:"; - comm -12 ${KSYMLST} ${KUSEDLST}; - RET=1; - fi; - done; - exit $RET + # If grep succeeds and finds a match the test fails as we should + # have no matches. + - git grep -E '^#[[:blank:]]*(define|undef)[[:blank:]]*CONFIG_' + include/configs `find arch -name config.h` && exit 1 || exit 0 # QA jobs for code analytics # static code analysis with cppcheck (we can add --enable=all later) -- 2.25.1