Skip to contentSkip to conversation

CI: Print out unmigrated symbols when failing

PATCH In review Tom Rini 1 participant 2 messages Apr 11, 2022 – Apr 15, 2022

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH 1/1 CI: Print out unmigrated symbols when failing

To make addressing the problem of migrated symbols being present in board config header files, update the CI test to them print what symbols are causing it to fail. Also report all failures in the tree, rather than stopping at the first failing file.

---
 .azure-pipelines.yml | 7 +++++--
 .gitlab-ci.yml       | 9 ++++++---
 2 files changed, 11 insertions(+), 5 deletions(-)
.azure-pipelines.yml +5 -2
index 314d27718926..ec77c7ab5fcf 100644
@@ -63,6 +63,7 @@ stages:
       - 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' \
@@ -76,10 +77,12 @@ stages:
              NUM=`comm -123 --total --output-delimiter=, ${KSYMLST} ${KUSEDLST} | \
                 cut -d , -f 3`
              if [[ $NUM -ne 0 ]]; then
-                echo "Unmigrated symbols found in $CFG"
-                exit 1
+                echo "Unmigrated symbols found in $CFG:"
+                comm -12 ${KSYMLST} ${KUSEDLST}
+                RET=1
              fi
           done
+          exit $RET
 
   - job: cppcheck
     displayName: 'Static code analysis with cppcheck'
.gitlab-ci.yml +6 -3
index 43fe8c64991c..f193ffd3cbc4 100644
@@ -124,6 +124,7 @@ check for migrated symbols in board header:
   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'
@@ -137,10 +138,12 @@ check for migrated symbols in board header:
          NUM=`comm -123 --total --output-delimiter=, ${KSYMLST} ${KUSEDLST} |
             cut -d , -f 3`;
          if [[ $NUM -ne 0 ]]; then
-            echo "Unmigrated symbols found in $CFG";
-            exit 1;
+            echo "Unmigrated symbols found in $CFG:";
+            comm -12 ${KSYMLST} ${KUSEDLST};
+            RET=1;
          fi;
-      done
+      done;
+      exit $RET
 
 # QA jobs for code analytics
 # static code analysis with cppcheck (we can add --enable=all later)
Signature · 1 line
2.25.1
author
#1 lore raw
Quoted 6 lines · Tom Rini

To make addressing the problem of migrated symbols being present in board config header files, update the CI test to them print what symbols are causing it to fail. Also report all failures in the tree, rather than stopping at the first failing file.

Applied to u-boot/master, thanks!

Signature · 1 line
Tom