Re: Why does pg_bsd_indent need to be installed?

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter(at)eisentraut(dot)org>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Why does pg_bsd_indent need to be installed?
Date: 2023-05-27 18:42:01
Message-ID: 20230527184201.2zdorrijg2inqt6v@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2023-05-25 13:05:57 -0400, Tom Lane wrote:
> Andres Freund <andres(at)anarazel(dot)de> writes:
> > On 2023-05-25 09:09:45 -0400, Tom Lane wrote:
> >> Peter Eisentraut <peter(at)eisentraut(dot)org> writes:
> >>> Why does pgindent require that pg_bsd_indent be installed in the path?
>
> > Isn't the situation actually *easier* in VPATH builds? There's no build
> > artifacts in the source tree, so you can just invoke the pg_bsd_indent built
> > in the build directory against the source tree, without any problems?
>
> Well, if you know where the build directory is, sure.

I'm imaginging adding make / meson targets 'indent-tree' and 'indent-head' or
such. Obviously the buildsystem knows where the source dir is, and you'd
invoke it in the build dir, so it'd know all that'd need to be known.

Attached is a prototype adding such meson targets. It's easier with a
parameter telling pgindent where the source tree is, so I addeded that too
(likely would need to be cleaned up some).

> Since pg_bsd_indent
> changes so seldom, keeping it in your PATH is at least as easy as any
> other solution, IMO.
>
> Another reason why I like to do it that way is that it supports running
> pgindent on files that aren't in the source tree at all, which suits
> some old habits of mine.

> But, as I said before, I'm open to adding support for other scenarios
> as long as we don't remove that one.

I can't imagine that we'd remove support for doing so...

Greetings,

Andres Freund

Attachment Content-Type Size
v1-0001-add-meson-target-to-run-pgindent.patch text/x-diff 2.2 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2023-05-27 18:47:13 Re: testing dist tarballs
Previous Message Andrew Dunstan 2023-05-27 12:52:24 session username in default psql prompt?