diff options
author | Mark de Wever <koraq@xs4all.nl> | 2021-07-22 11:17:53 +0200 |
---|---|---|
committer | Mark de Wever <koraq@xs4all.nl> | 2021-07-26 16:41:57 +0200 |
commit | 1139fd4270c7462a4bce8e1e91e6be174dcae88f (patch) | |
tree | 7a66d962e6918da20616a3c335cabd560b230584 /libcxx | |
parent | 33146857e9840a92840d48bbc3483e34ea545fc7 (diff) | |
download | llvm-1139fd4270c7462a4bce8e1e91e6be174dcae88f.zip llvm-1139fd4270c7462a4bce8e1e91e6be174dcae88f.tar.gz llvm-1139fd4270c7462a4bce8e1e91e6be174dcae88f.tar.bz2 |
[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
Diffstat (limited to 'libcxx')
-rw-r--r-- | libcxx/utils/ci/buildkite-pipeline.yml | 1 | ||||
-rwxr-xr-x | libcxx/utils/ci/run-buildbot | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/libcxx/utils/ci/buildkite-pipeline.yml b/libcxx/utils/ci/buildkite-pipeline.yml index b1ac200..9465f0a 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 e37f604..384b44d 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. |