Обсуждение: Inconsistency in installation of syscache_info.h

Поиск
Список
Период
Сортировка

Inconsistency in installation of syscache_info.h

От
Tom Lane
Дата:
I happened to notice that syscache_info.h is installed into
$installdir/include/server/catalog if you use a non-VPATH
autoconf build, but not if you use a VPATH build or meson.
This is not great IMO.

Just to confuse matters even more, meson builds install a copy of
src/include/catalog/README, which autoconf builds do not.

ISTM we need to get these things in sync.

You could argue that syscache_info.h could never be useful outside the
core server, but it'd be a bit painful to get the non-VPATH code to
not install it, because it just blindly installs everything matching
src/include/catalog/*.h.  So I'd vote for making the other two paths
install it too.

I've not looked into why meson is installing a copy of that
README, but it seems quite random to do so, so I'd vote for
not doing that if possible.

Thoughts?

            regards, tom lane



Re: Inconsistency in installation of syscache_info.h

От
Tom Lane
Дата:
I wrote:
> I happened to notice that syscache_info.h is installed into
> $installdir/include/server/catalog if you use a non-VPATH
> autoconf build, but not if you use a VPATH build or meson.
> This is not great IMO.

> Just to confuse matters even more, meson builds install a copy of
> src/include/catalog/README, which autoconf builds do not.

> ISTM we need to get these things in sync.

Here's a proposed patch for that.  I've confirmed we get identical
filesets from all three build methods with this.

Although this seems like clearly a bug, I'm not sure anyone would
thank us for changing the behavior in back branches; particularly
not packagers, who tend to pay close attention to the set of files
installed.  So I'm inclined to apply this to master only.

            regards, tom lane

diff --git a/src/include/catalog/Makefile b/src/include/catalog/Makefile
index c90022f7c57..24b527230d4 100644
--- a/src/include/catalog/Makefile
+++ b/src/include/catalog/Makefile
@@ -149,6 +149,7 @@ install: all installdirs
 ifeq ($(vpath_build),yes)
     $(INSTALL_DATA) schemapg.h '$(DESTDIR)$(includedir_server)'/catalog/schemapg.h
     $(INSTALL_DATA) syscache_ids.h '$(DESTDIR)$(includedir_server)'/catalog/syscache_ids.h
+    $(INSTALL_DATA) syscache_info.h '$(DESTDIR)$(includedir_server)'/catalog/syscache_info.h
     $(INSTALL_DATA) system_fk_info.h '$(DESTDIR)$(includedir_server)'/catalog/system_fk_info.h
     for file in $(GENERATED_HEADERS); do \
       $(INSTALL_DATA) $$file '$(DESTDIR)$(includedir_server)'/catalog/$$file || exit; \
@@ -160,7 +161,7 @@ installdirs:

 uninstall:
     rm -f $(addprefix '$(DESTDIR)$(datadir)'/, postgres.bki system_constraints.sql)
-    rm -f $(addprefix '$(DESTDIR)$(includedir_server)'/catalog/, schemapg.h syscache_ids.h system_fk_info.h
$(GENERATED_HEADERS))
+    rm -f $(addprefix '$(DESTDIR)$(includedir_server)'/catalog/, schemapg.h syscache_ids.h syscache_info.h
system_fk_info.h$(GENERATED_HEADERS)) 

 clean:
     rm -f bki-stamp $(GENBKI_OUTPUT_FILES)
diff --git a/src/include/catalog/meson.build b/src/include/catalog/meson.build
index b63cd584068..433bcc908ad 100644
--- a/src/include/catalog/meson.build
+++ b/src/include/catalog/meson.build
@@ -115,7 +115,7 @@ output_install = [
   dir_data,
   dir_include_server / 'catalog',
   dir_include_server / 'catalog',
-  false,
+  dir_include_server / 'catalog',
   dir_include_server / 'catalog',
 ]

diff --git a/src/include/meson.build b/src/include/meson.build
index b940c5cd3d6..7d734d92dab 100644
--- a/src/include/meson.build
+++ b/src/include/meson.build
@@ -173,6 +173,7 @@ install_subdir('catalog',
   exclude_files: [
     '.gitignore',
     'Makefile',
+    'README',
     'duplicate_oids',
     'meson.build',
     'reformat_dat_file.pl',

Re: Inconsistency in installation of syscache_info.h

От
Andres Freund
Дата:
Hi,

On 2026-02-16 14:01:38 -0500, Tom Lane wrote:
> I wrote:
> > I happened to notice that syscache_info.h is installed into
> > $installdir/include/server/catalog if you use a non-VPATH
> > autoconf build, but not if you use a VPATH build or meson.
> > This is not great IMO.

Indeed. If it were trivial to not install it, I'd have gone that way, but it
looks like it's not...


> > Just to confuse matters even more, meson builds install a copy of
> > src/include/catalog/README, which autoconf builds do not.
> 
> > ISTM we need to get these things in sync.
> 
> Here's a proposed patch for that.  I've confirmed we get identical
> filesets from all three build methods with this.

Nice.


> Although this seems like clearly a bug, I'm not sure anyone would
> thank us for changing the behavior in back branches; particularly
> not packagers, who tend to pay close attention to the set of files
> installed.  So I'm inclined to apply this to master only.

Agreed. Given that syscache_info.h should never be needed, it's not like it'll
bother anyone that it's not there.   And it looks like
src/include/catalog/README is new enough that the installation in meson
happens only on master anyway.

Greetings,

Andres Freund