]> git.ipfire.org Git - thirdparty/squid.git/commit
Maintenance: Improve stability of gperf-generated sources (#1099)
authorAlex Rousskov <rousskov@measurement-factory.com>
Tue, 2 Aug 2022 23:24:40 +0000 (23:24 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Thu, 4 Aug 2022 17:38:40 +0000 (17:38 +0000)
commit761dced3f5da32e0a54944c9c11b77f0ff72928b
tree2d76e1c5345de1f69e2239471d8ba797fbc2f95d
parentc23885c1923c1b7d7fd6d503aa67d12d0254f629
Maintenance: Improve stability of gperf-generated sources (#1099)

Control gperf from source-maintenance.sh: Existing Makefile rule did not
use (and should not use) primary "make" functionality -- we do not want
to automatically trigger RegisteredHeadersHash.cci regeneration based on
file timestamps alone because most users will not have (the right
version of) gperf and (the right version of) astyle available. The rule
did use Makefile variables, but that resulted in unstable gperf output
because variables like $src change depending on the developer build
environment. This change finishes the move started by commit 3d50bea.

Simplify formater.pl, making its interface similar to other formatting
tools used by source-maintenance.sh: The script now sends its results to
stdout. Renamed the script to reduce surprises, fix the old naming typo,
and to improve consistency with format-makefile-am.pl. The script needs
more polishing; we avoided otherwise unmodified lines except removing an
unused buggy $pfx line that triggered warnings.

Move "astyle did not corrupt code" checks from source-maintenance.sh to
formater.pl, where they belong and are easier to implement. This move
simplifies reuse of the Perl script inside source-maintenance.sh. It
also removes dependency on md5sum/etc. $CppFormatter now contains the
exact command to (re)use.

Fix "Generated by.." marker. Its old location in .cci was hard to
notice. The marker was also present in hand-edited .gperf file!

Report RegisteredHeadersHash.cci changes.

Also stopped stripping "register" from gperf output. Gperf v3.1 stopped
adding "register" to C++ output. We (should) use that gperf version.
Removing "register" complicated gperf error handling because a pipe to
sed ate gperf exit code.
scripts/format-cpp.pl [moved from scripts/formater.pl with 59% similarity]
scripts/source-maintenance.sh
src/http/Makefile.am
src/http/RegisteredHeadersHash.cci
src/http/RegisteredHeadersHash.gperf