I've produced the refinement of my little shell script anticipated by my last e-mail (using sed to remove irrelevant variations in __func__.12345 type symbol names). I decided to test it for:
1. Detecting behavioural changes when removing existing "pgrminclude ignore" files (Basically headers that won't break the build if removed, but will break Postgres). I stuck with .c files here for the sake of convenience. 2. False positives by including a bunch of random headers. Fist file tested was pl_comp.c. The script detected the change in behaviour due to the omission of that header (incidentally, the way the header is used there strikes me as a bit ugly). The script did not produce false positives with the addition of these headers: #include "commands/portalcmds.h" #include "commands/conversioncmds.h" #include "commands/defrem.h" #include "commands/proclang.h" #include "commands/tablecmds.h" #include "commands/tablespace.h" #include "commands/typecmds.h" #include "commands/collationcmds.h" #include "commands/prepare.h" #include "commands/explain.h" #include "commands/comment.h" #include "commands/cluster.h" #include "commands/discard.h" #include "commands/trigger.h" #include "commands/user.h" #include "commands/view.h" #include "commands/sequence.h" #include "commands/dbcommands.h" #include "commands/async.h" #include "commands/lockcmds.h" #include "commands/vacuum.h" The second file tested was regerror.c . Similarly, the omission was detected, and the addition of the same headers did not produce a false positive. It's very difficult or impossible to anticipate how effective the tool will be in practice, but when you consider that it works and does not produce false positives for the first 3 real-world cases tested, it seems reasonable to assume that it's at least worth having around. Tom recently said of a previous pgrminclude campaign in July 2006 that "It took us two weeks to mostly recover, but we were still dealing with some fallout in December". I think that makes the case for adding this tool or some refinement as a complement to pgrminclude in src/tools fairly compelling. -- Peter Geoghegan http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training and Services
nm-diff.sh
Description: Bourne shell script
-- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers