[libcxx-commits] [libcxx] bf72f6b - [libc++][CI] Fix check-generated-output.

Mark de Wever via libcxx-commits libcxx-commits at lists.llvm.org
Wed Apr 28 10:14:15 PDT 2021


Author: Mark de Wever
Date: 2021-04-28T19:13:53+02:00
New Revision: bf72f6baccfe7d39a12f9319d108d6d55aefeeef

URL: https://github.com/llvm/llvm-project/commit/bf72f6baccfe7d39a12f9319d108d6d55aefeeef
DIFF: https://github.com/llvm/llvm-project/commit/bf72f6baccfe7d39a12f9319d108d6d55aefeeef.diff

LOG: [libc++][CI] Fix check-generated-output.

Before the script detected non-ASCII characters but let them pass. This
fixes the issue. I had a way to solve the issue, during review @Quuxplusone
suggested a better alternative. The patch has been changed to use this alternative.

Intended failed builds:
- Not updated generated files https://buildkite.com/llvm-project/libcxx-ci/builds/2822
- Not updated generated files and non-ASCII usage https://buildkite.com/llvm-project/libcxx-ci/builds/2835
- Non-ASCII usage https://buildkite.com/llvm-project/libcxx-ci/builds/2836

Reviewed By: #libc, Quuxplusone, curdeius

Differential Revision: https://reviews.llvm.org/D101303

Added: 
    

Modified: 
    libcxx/utils/ci/run-buildbot

Removed: 
    


################################################################################
diff  --git a/libcxx/utils/ci/run-buildbot b/libcxx/utils/ci/run-buildbot
index a327b938d7a0e..e7b81799bdcd8 100755
--- a/libcxx/utils/ci/run-buildbot
+++ b/libcxx/utils/ci/run-buildbot
@@ -133,18 +133,20 @@ check-format)
     ! grep -q '^--- a' ${BUILD_DIR}/clang-format.patch
 ;;
 check-generated-output)
+    # `! foo` doesn't work properly with `set -e`, use `! foo || false` instead.
+    # https://stackoverflow.com/questions/57681955/set-e-does-not-respect-logical-not
     clean
     echo "+++ Checking the output of the generator scripts"
     mkdir -p ${BUILD_DIR}
-    # Reject patches that introduce non-ASCII characters or hard tabs.
-    ! grep -rn '[^ -~]' libcxx/include/
     # Reject patches that don't update the generated output correctly.
     python3 libcxx/utils/generate_feature_test_macro_components.py
     python3 libcxx/utils/generate_header_inclusion_tests.py
     python3 libcxx/utils/generate_header_tests.py
     git 
diff  | tee ${BUILD_DIR}/generated_output.patch
     # Check if the 
diff s are empty, fail otherwise.
-    ! grep -q '^--- a' ${BUILD_DIR}/generated_output.patch
+    ! grep -q '^--- a' ${BUILD_DIR}/generated_output.patch || false
+    # Reject patches that introduce non-ASCII characters or hard tabs.
+    ! grep -rn '[^ -~]' libcxx/include/ || false
     # Check that no dependency cycles have been introduced.
     python3 libcxx/utils/graph_header_deps.py >/dev/null
 ;;


        


More information about the libcxx-commits mailing list