Обсуждение: compiling pg_bsd_indent
While $SUBJECT today -- using the sources from https://git.postgresql.org/git/pg_bsd_indent.git -- I ran into some problems. I got errors due to the replacement of pg_attribute_noreturn() with pg_return(), and warnings due to variable definitions with no previous extern declaration. Here's a quick and dirty patch. -- Robert Haas EDB: http://www.enterprisedb.com
Вложения
Hi, On 2025-10-09 11:43:57 -0400, Robert Haas wrote: > While $SUBJECT today -- using the sources from > https://git.postgresql.org/git/pg_bsd_indent.git -- I ran into some > problems. I got errors due to the replacement of > pg_attribute_noreturn() with pg_return(), and warnings due to variable > definitions with no previous extern declaration. Here's a quick and > dirty patch. I thought we basically only used the in-tree pg_bsd_indent these days? Greetings, Andres
On Thu, Oct 9, 2025 at 11:49 AM Andres Freund <andres@anarazel.de> wrote: > I thought we basically only used the in-tree pg_bsd_indent these days? Oh, I missed the fact that we'd moved it into the tree. But it looks like you can't build it with meson? -- Robert Haas EDB: http://www.enterprisedb.com
Robert Haas <robertmhaas@gmail.com> writes: > While $SUBJECT today -- using the sources from > https://git.postgresql.org/git/pg_bsd_indent.git -- I ran into some > problems. I got errors due to the replacement of > pg_attribute_noreturn() with pg_return(), and warnings due to variable > definitions with no previous extern declaration. Here's a quick and > dirty patch. I don't think we're bothering to maintain that repo anymore, now that pg_bsd_indent is in-tree (see src/tools/pg_bsd_indent). The fixes you mention seem to be applied already to that copy. regards, tom lane
On Thu, Oct 09, 2025 at 11:49:31AM -0400, Andres Freund wrote: > On 2025-10-09 11:43:57 -0400, Robert Haas wrote: >> While $SUBJECT today -- using the sources from >> https://git.postgresql.org/git/pg_bsd_indent.git -- I ran into some >> problems. I got errors due to the replacement of >> pg_attribute_noreturn() with pg_return(), and warnings due to variable >> definitions with no previous extern declaration. Here's a quick and >> dirty patch. > > I thought we basically only used the in-tree pg_bsd_indent these days? That's what I thought, too (see commit 4e831f4). FWIW the problem in err.h was fixed in-tree in the same way as your patch by commit 3691edf. The missing-externs ones were fixed by adding -Wmissing-variable-declarations, per commit 6618891. -- nathan
On 2025-10-09 11:51:15 -0400, Robert Haas wrote: > On Thu, Oct 9, 2025 at 11:49 AM Andres Freund <andres@anarazel.de> wrote: > > I thought we basically only used the in-tree pg_bsd_indent these days? > > Oh, I missed the fact that we'd moved it into the tree. But it looks > like you can't build it with meson? It can be built with meson - in fact it should be built by default...
On Thu, Oct 9, 2025 at 11:51 AM Robert Haas <robertmhaas@gmail.com> wrote: > On Thu, Oct 9, 2025 at 11:49 AM Andres Freund <andres@anarazel.de> wrote: > > I thought we basically only used the in-tree pg_bsd_indent these days? > > Oh, I missed the fact that we'd moved it into the tree. But it looks > like you can't build it with meson? No, I'm wrong about that, too. I don't seem to see it installing by default, but maybe I am also wrong about that. -- Robert Haas EDB: http://www.enterprisedb.com
On Thu, Oct 9, 2025 at 11:49:31AM -0400, Andres Freund wrote: > Hi, > > On 2025-10-09 11:43:57 -0400, Robert Haas wrote: > > While $SUBJECT today -- using the sources from > > https://git.postgresql.org/git/pg_bsd_indent.git -- I ran into some > > problems. I got errors due to the replacement of > > pg_attribute_noreturn() with pg_return(), and warnings due to variable > > definitions with no previous extern declaration. Here's a quick and > > dirty patch. > > I thought we basically only used the in-tree pg_bsd_indent these days? The last commit in that branch says: commit 681a370 (HEAD -> master, origin/master, origin/HEAD) Author: Tom Lane <tgl@sss.pgh.pa.us> Date: Sun Apr 23 10:38:15 2023 -0400 Mark this git repo as obsolete. Add a README note explaining that we've pulled pg_bsd_indent into the main Postgres source tree. This copy will not be maintained anymore. Might be nice if we could just remove it. It was created by Tom Lane in 2017. The in-tree ./src/tools/pg_bsd_indent/ doesn't give me any warnings on gcc 14.2.0. -- Bruce Momjian <bruce@momjian.us> https://momjian.us EDB https://enterprisedb.com Do not let urgent matters crowd out time for investment in the future.
Robert Haas <robertmhaas@gmail.com> writes: > No, I'm wrong about that, too. I don't seem to see it installing by > default, but maybe I am also wrong about that. No, we don't install it at all. If you choose, you can manually copy it to someplace in your $PATH. regards, tom lane
On 2025-Oct-09, Bruce Momjian wrote: > Might be nice if we could just remove it. It was created by Tom Lane in > 2017. I think it would be a bad idea to lose the history there, so -1 on that from me. In particular, older branches (12 and back) require a version of pg_bsd_indent that would no longer be available. Do I use that often? Not really, but who knows. I'd rather have it there. Maybe we could make the obsolence more obvious, such as by making the Makefile emit a note about it. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/
On Thu, Oct 9, 2025 at 06:12:59PM +0200, Álvaro Herrera wrote: > On 2025-Oct-09, Bruce Momjian wrote: > > > Might be nice if we could just remove it. It was created by Tom Lane in > > 2017. > > I think it would be a bad idea to lose the history there, so -1 on that > from me. In particular, older branches (12 and back) require a version > of pg_bsd_indent that would no longer be available. Do I use that > often? Not really, but who knows. I'd rather have it there. > > Maybe we could make the obsolence more obvious, such as by making the > Makefile emit a note about it. Makes sense. -- Bruce Momjian <bruce@momjian.us> https://momjian.us EDB https://enterprisedb.com Do not let urgent matters crowd out time for investment in the future.