Re: pgsql: Merge catalog/pg_foo_fn.h headers back into pg_foo.h headers.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Postgres hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pgsql: Merge catalog/pg_foo_fn.h headers back into pg_foo.h headers.
Date: 2018-04-09 17:21:49
Message-ID: 6629.1523294509@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Michael Paquier <michael(at)paquier(dot)xyz> writes:
> On Sun, Apr 08, 2018 at 11:05:09PM -0400, Tom Lane wrote:
>> Hm. I'd tested "make -j all", but not going directly to "install".
>> Does it help if you add
>> $(SUBDIRS:%=install-%-recurse): | submake-generated-headers
>> to src/Makefile?

> That takes care of the problem from the root of the directory, but when
> doing the same from src/bin/ then the same issue shows up even if
> src/Makefile is patched to handle install targets.

Hm. Not sure how far we want to go in that direction. It's never really
been the case that you could configure a maintainer-clean tree and then
go and build in any random subdirectory without taking care of the
generated headers. In principle, we could do something like the hack
Peter did with temp-install, where it's basically forced to be a
prerequisite of "make check" in EVERY subdirectory and then we buy back
some of the inefficiency by making it a no-op in child make runs. Not
sure that's a good thing though.

Independently of that, though, I noticed that part of the issue in your
"make install" example is that relpath.c, along with some other frontend
code, includes catalog/catalog.h which includes pg_class.h (and thereby
now pg_class_d.h). Since src/common/Makefile thinks the only generated
header it needs to worry about is errcodes.h, building src/common first
now falls over. But allowing frontend code to include catalog.h is
pretty insane: that pulls in relcache.h as well, and surely we don't
want to tie our hands to the point that relcache.h has to be frontend
clean.

What we need to do is take OIDCHARS and TABLESPACE_VERSION_DIRECTORY
out of catalog.h and put them in some more frontend-friendly header.
My first thought was pg_tablespace_d.h, but my second one is relpath.h.
Comments?

regards, tom lane

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2018-04-09 17:26:08 Re: pgsql: Revert "Allow on-line enabling and disabling of data checksums"
Previous Message Magnus Hagander 2018-04-09 17:06:59 pgsql: Revert "Allow on-line enabling and disabling of data checksums"

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2018-04-09 17:22:33 Re: Online enabling of checksums
Previous Message Magnus Hagander 2018-04-09 17:06:59 pgsql: Revert "Allow on-line enabling and disabling of data checksums"