Coccinelle for PostgreSQL development [2/N]: autoconf support [RESEND]

Started by Mats Kindahlover 1 year ago5 messageshackers
Beta feature

Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.

appliessuccessCI history

You can run a PostgreSQL built from this patch straight from Docker, with no checkout and no build:

docker run --rm -p 5432:5432 ghcr.io/hackorum-dev/postgres-patch:t50865
psql -h localhost -U postgres

Built from patchset v1 (message #1), September 20, 2026 at 03:58 AM.

Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:

git clone --branch t50865_1 https://github.com/hackorum-dev/postgres.git

In a checkout you already have, add the fork once:

git remote add hackorum https://github.com/hackorum-dev/postgres.git

then, for this patchset and every later one:

git fetch hackorum t50865_1 && git checkout t50865_1

Patchset v1 (message #1) is on t50865_1

Jump to latest
#1Mats Kindahl
mats@timescale.com

Missed the patch in the previous mail. Please ignore.

This second patch adds support for coccicheck to configure.ac and related
files (in particular Makefile.global.in). At this point, I have
deliberately not added support for pgxs so extensions cannot use coccicheck
through the PostgreSQL installation.

The semantic patches are expected to live in cocci/ directory under the
root and the patch uses the pattern cocci/**/*.cocci to find all semantic
patches. Right now there are no subdirectories for the semantic patches,
but this might be something we want to add.

The coccicheck target is used in the same way as for the Linux kernel, that
is, to generate a patch with all changes suggested by the semantic patches,
you type:

make coccicheck MODE=patch

Linux as support for a few more variables: V to set the verbosity, J to use
multiple jobs for processing the semantic patches, M to select a different
directory to apply the semantic patches to, and COCCI to use a single
specific semantic patch rather than all available. I have not added support
for this right now, but if you think this is valuable, it should be
straightforward to add.
--
Best wishes,
Mats Kindahl, Timescale

Attachments:

t50865_1
0002-Create-coccicheck-target-for-autoconf.v1.patchtext/x-patch; charset=US-ASCII; name=0002-Create-coccicheck-target-for-autoconf.v1.patchDownload+131-7
#2Daniel Gustafsson
daniel@yesql.se
In reply to: Mats Kindahl (#1)
Re: Coccinelle for PostgreSQL development [2/N]: autoconf support [RESEND]

On 7 Jan 2025, at 20:47, Mats Kindahl <mats@timescale.com> wrote:

This second patch adds support for coccicheck

Forgive me if I'm daft, but I feel there is a slight lack of context here.
What is coccicheck, what would it do and why would it benefit us to have it?

--
Daniel Gustafsson

#3Mats Kindahl
mats@timescale.com
In reply to: Daniel Gustafsson (#2)
Re: Coccinelle for PostgreSQL development [2/N]: autoconf support [RESEND]

On Tue, Jan 7, 2025 at 8:51 PM Daniel Gustafsson <daniel@yesql.se> wrote:

On 7 Jan 2025, at 20:47, Mats Kindahl <mats@timescale.com> wrote:

This second patch adds support for coccicheck

Forgive me if I'm daft, but I feel there is a slight lack of context here.
What is coccicheck, what would it do and why would it benefit us to have
it?

There is a first email that just gives a basic description of what it is,
with the "[1/N]" in the title. I am not sure if that explains things better.
--
Best wishes,
Mats Kindahl, Timescale

#4Daniel Gustafsson
daniel@yesql.se
In reply to: Mats Kindahl (#3)
Re: Coccinelle for PostgreSQL development [2/N]: autoconf support [RESEND]

On 7 Jan 2025, at 20:54, Mats Kindahl <mats@timescale.com> wrote:

On Tue, Jan 7, 2025 at 8:51 PM Daniel Gustafsson <daniel@yesql.se <mailto:daniel@yesql.se>> wrote:

On 7 Jan 2025, at 20:47, Mats Kindahl <mats@timescale.com <mailto:mats@timescale.com>> wrote:

This second patch adds support for coccicheck

Forgive me if I'm daft, but I feel there is a slight lack of context here.
What is coccicheck, what would it do and why would it benefit us to have it?

There is a first email that just gives a basic description of what it is, with the "[1/N]" in the title. I am not sure if that explains things better.

Thanks, went looking and found it in my spam folder, sorry for the noise.

--
Daniel Gustafsson

#5Mats Kindahl
mats@timescale.com
In reply to: Daniel Gustafsson (#4)
Re: Coccinelle for PostgreSQL development [2/N]: autoconf support [RESEND]

On Tue, Jan 7, 2025 at 8:56 PM Daniel Gustafsson <daniel@yesql.se> wrote:

On 7 Jan 2025, at 20:54, Mats Kindahl <mats@timescale.com> wrote:

On Tue, Jan 7, 2025 at 8:51 PM Daniel Gustafsson <daniel@yesql.se> wrote:

On 7 Jan 2025, at 20:47, Mats Kindahl <mats@timescale.com> wrote:

This second patch adds support for coccicheck

Forgive me if I'm daft, but I feel there is a slight lack of context here.
What is coccicheck, what would it do and why would it benefit us to have
it?

There is a first email that just gives a basic description of what it is,
with the "[1/N]" in the title. I am not sure if that explains things better.

Thanks, went looking and found it in my spam folder, sorry for the noise.

Great that you found it. :)
--
Best wishes,
Mats Kindahl, Timescale