Check generated QPDFJob files in CI

This is to catch pull requests that make changes that would affect
automatically generated job files without including those
modifications.
This commit is contained in:
Jay Berkenbilt 2022-02-08 09:31:54 -05:00
parent cb769c62e5
commit 511d70166d
3 changed files with 33 additions and 1 deletions

View File

@ -1,4 +1,21 @@
#!/bin/bash
set -e
cd $(dirname $0)/..
if ! ./generate_auto_job --check; then
cat 1>&2 <<EOF
******************************
An input or output file of generate_auto_job was modified without
rerunning ./generate_auto_job. If you are seeing this in your pull
request, you should pass --enable-maintainer-mode to ./configure if
possible, or if not, run "./generate_auto_job --generate" and include
any changed files in your commit.
******************************
EOF
exit 2
fi
build-scripts/build-doc
build-scripts/download-external-libs

View File

@ -247,6 +247,21 @@ class Main:
if m:
old_hashes[m.group(1)] = m.group(2)
match = old_hashes == hashes
if not match:
# Write to stdout, not stderr. What we write to stderr
# is visible in a normal build. Writing to stdout will
# hide it in that case but expose it if you directly
# run ./generate_auto_job --check as in CI.
print(f'*** {whoami} hash mismatches ***')
match = False
for k, v in hashes.items():
if k not in old_hashes:
print(f' {k} is not in job.sums')
elif v != old_hashes[k]:
print(f' {k} was modified')
for k in old_hashes:
if k not in hashes:
print(f' {k} disappeared')
except Exception:
pass
return match

View File

@ -1,5 +1,5 @@
# Generated by generate_auto_job
generate_auto_job 751021df2a7f03c5d9a6a0ae07277004a89b9b20fa951fa4097212c72fc982a9
generate_auto_job 464f660527880d5213ada3f5be5bdab05a425610044dbe0a2a918bc1e268726a
include/qpdf/auto_job_c_att.hh 1f5d589ccf6684b09a203da261c31fc90a866e6eefe906b673e2d6d5a08ef753
include/qpdf/auto_job_c_copy_att.hh 65bdce5382a60f1815214297cf005072f17556ec4a15317b600f9ecc9cb89ea4
include/qpdf/auto_job_c_enc.hh 37ca99a124a34bb613f154c6c8934761bd7e7cc5a2719798ccec7edf05b4aeb9