Re: improving on pgrminclude / pgcompinclude ?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: improving on pgrminclude / pgcompinclude ?
Date: 2016-10-05 16:28:20
Message-ID: 2788.1475684900@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> I wonder if we can do better. The attached patch is the rest of a
> couple of hours of hacking on a "see whether all of our includes
> compile separately" project. Directions:

Don't we have more or less that already in src/tools/pginclude/cpluspluscheck?

> It strikes me that if we could make this robust enough to include in
> the buidlfarm, that would be good. And maybe we could then have a
> pgrminclude tool which is a bit smarter also, and something that
> anyone can easily run. I don't think pgrminclude should be part of
> the buildfarm, but being able to run it every release cycle with
> relatively minimal pain instead of every 5 years with extensive
> fallout seems like it would be a win.

I do not think that pgrminclude will *ever* be something that can be
quasi-automatic or work without close adult supervision. In the
first place, whether a given reference is required or not can easily
vary depending on platform and compile options. In the second place,
when there is something removable it's often because there are multiple
inclusion pathways reaching the same header file, and figuring out
which one is most appropriate to keep is a judgment call that requires
some understanding of what we think the system structure ought to be.

In fact, undoing the mess that the last pgrminclude run created was
sufficiently painful that I'm not sure I want to see it run again ever.
A few unnecessary includes isn't that big a problem.

Having said that, part of the reason for the carnage was that someone
had previously created a circular #include loop. It would be good to
have a tool that would whine about that; or at least fix pgrminclude
so it would refuse to do anything if it found one.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mithun Cy 2016-10-05 16:34:41 Re: Cache Hash Index meta page.
Previous Message Robert Haas 2016-10-05 16:14:09 improving on pgrminclude / pgcompinclude ?