[libcxx-commits] [libcxx] 1139fd4 - [libc++][ci] Detect not committed generated files.

Mark de Wever via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jul 26 07:42:05 PDT 2021


Author: Mark de Wever
Date: 2021-07-26T16:41:57+02:00
New Revision: 1139fd4270c7462a4bce8e1e91e6be174dcae88f

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

LOG: [libc++][ci] Detect not committed generated files.

The Generated output CI job only tests for modified files. This job
should also fail the generated output contains new files.

It would be possible to test modified and untracked files in one
execution of `git ls-files`. However the diff is stored as an artifact
so the execution of `git diff` would still be required.

Discussion: Would it be better to do `git ls-files -om` and remove the
excution of
`! grep -q '^--- a' ${BUILD_DIR}/generated_output.patch || false` ?
(Obviously then the name `generated_output.untracked` should change to
something like `generated_output.status`)

Reviewed By: #libc, ldionne

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

Added: 
    

Modified: 
    libcxx/utils/ci/buildkite-pipeline.yml
    libcxx/utils/ci/run-buildbot

Removed: 
    


################################################################################
diff  --git a/libcxx/utils/ci/buildkite-pipeline.yml b/libcxx/utils/ci/buildkite-pipeline.yml
index b1ac2007f0c7e..9465f0aa12fe8 100644
--- a/libcxx/utils/ci/buildkite-pipeline.yml
+++ b/libcxx/utils/ci/buildkite-pipeline.yml
@@ -40,6 +40,7 @@ steps:
     command: "libcxx/utils/ci/run-buildbot check-generated-output"
     artifact_paths:
       - "**/generated_output.patch"
+      - "**/generated_output.status"
     agents:
       queue: "libcxx-builders"
       os: "linux"

diff  --git a/libcxx/utils/ci/run-buildbot b/libcxx/utils/ci/run-buildbot
index e37f604c4d8b7..384b44d23ee12 100755
--- a/libcxx/utils/ci/run-buildbot
+++ b/libcxx/utils/ci/run-buildbot
@@ -170,7 +170,14 @@ check-generated-output)
     echo "+++ Making sure the generator scripts were run"
     ${NINJA} -vC "${BUILD_DIR}" libcxx-generate-files
     git 
diff  | tee ${BUILD_DIR}/generated_output.patch
+    git ls-files -o --exclude-standard | tee ${BUILD_DIR}/generated_output.status
     ! grep -q '^--- a' ${BUILD_DIR}/generated_output.patch || false
+    if [ -s ${BUILD_DIR}/generated_output.status ]; then
+        echo "It looks like not all the generator scripts were run,"
+        echo "did you forget to build the libcxx-generate-files target?"
+        echo "Did you add all new files it generated?"
+        false
+    fi
 
     # Reject patches that introduce non-ASCII characters or hard tabs.
     # Depends on LC_COLLATE set at the top of this script.


        


More information about the libcxx-commits mailing list