Proposal: common explicit lists for installed headers - Mailing list pgsql-hackers

From Zsolt Parragi
Subject Proposal: common explicit lists for installed headers
Date
Msg-id CAN4CZFN=NaOVXmoPXpW11K93ZgZFUp_20BOU7Jj3vWJJepdfdQ@mail.gmail.com
Whole thread Raw
Responses Re: Proposal: common explicit lists for installed headers
List pgsql-hackers
Hello

This patch is based on an idea in the recent headerscheck for meson
discussion[1]:
What if, instead of the current completely different ways we handle
installed headers in the make and meson builds, we used a common list
as the source of truth, explicitly listing all files that need to be
installed?

This has several advantages:

* removes the questionable install_subdir usage in meson
* removes the also questionable glob usage in make
* provides a clear list of includes we need in the installation directory
* this list could also later be used by headerscheck, which could then
work the same way in both meson and make

I have currently split this into three separate patches:

* the first one is the bulk of the changes, it handles everything in src/include
* the second adds the remaining src directories not included in the
first one. This is less useful for the unification goal, but it would
help with the headerscheck goal
* the third one is a completely optional unification. With the first
two patches, the public and internal headers are defined in two
separate lists because they come from different source directories.
This patch moves them into a single file instead, but with the
downside that the file now references headers in a different
directory. This is definitely questionable, I included it only as a
possible alternative, and ignoring it is probably better

What isn't included:

* contrib modules are unchanged - I didn't want to include them in a
common list, and adding separate list files per target would just add
complexity
* generated headers are similarly already listed explicitly in both
meson and make, I didn't change that

This could be a later question for headerscheck if we go in this
direction and want it to check these headers - but for now, manually
replicating them into lists doesn't seem practical.

I verified with a few different configurations that these changes
result in the same installed headers in both the make and meson builds
as before.

Thoughts? Would this be a useful refactoring?

[1]: https://www.postgresql.org/message-id/33wusv6jgyvm4tqw7ibjsh5vutnh3gyleyerkdzcv4mhf2ijmh%40wkirx27m67ku

Attachment

pgsql-hackers by date:

Previous
From: Mahendra Singh Thalor
Date:
Subject: Re: Adding pg_dump flag for parallel export to pipes
Next
From: KAZAR Ayoub
Date:
Subject: Re: Speed up COPY TO text/CSV parsing using SIMD