pgindent vs dtrace on macos

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

pgindent vs dtrace on macos

Peter Eisentraut-6
If I run pgindent on a built tree on macos, I get this error

Failure in ./src/backend/utils/probes.h: Error@375: Stuff missing from
end of file

The file in question is built by the dtrace command.  I have attached it
here.

Is this something to fix in pgindent?  Or should this file be excluded,
since it's generated?

--
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

probes.h (62K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: pgindent vs dtrace on macos

Daniel Gustafsson
> On 20 May 2020, at 11:52, Peter Eisentraut <[hidden email]> wrote:

> Or should this file be excluded, since it's generated?

That would get my vote.  Generated files where we don't control the generator
can be excluded.

cheers ./daniel

Reply | Threaded
Open this post in threaded view
|

Re: pgindent vs dtrace on macos

Tom Lane-2
In reply to this post by Peter Eisentraut-6
Peter Eisentraut <[hidden email]> writes:
> If I run pgindent on a built tree on macos, I get this error
> Failure in ./src/backend/utils/probes.h: Error@375: Stuff missing from
> end of file
> The file in question is built by the dtrace command.  I have attached it
> here.
> Is this something to fix in pgindent?  Or should this file be excluded,
> since it's generated?

Hm, there's nothing obviously wrong with the file.  But since it's
generated by code not under our control, we should exclude it.
And given that, it's probably not worth figuring out why it breaks
pgindent.

On a closely related point: I was confused for awhile on Monday
afternoon, wondering why the built tarballs didn't match my local
tree.  I eventually realized that when I'd run pgindent on Saturday,
it had reformatted some generated files such as
src/bin/psql/sql_help.h, causing those not to match the freshly-made
ones in the tarball.  I wonder if we should make an effort to ensure
that our generated .h and .c files always satisfy pgindent.  If not,
we probably should exclude them too.

                        regards, tom lane


Reply | Threaded
Open this post in threaded view
|

Re: pgindent vs dtrace on macos

Peter Eisentraut-6
On 2020-05-20 15:56, Tom Lane wrote:
> On a closely related point: I was confused for awhile on Monday
> afternoon, wondering why the built tarballs didn't match my local
> tree.  I eventually realized that when I'd run pgindent on Saturday,
> it had reformatted some generated files such as
> src/bin/psql/sql_help.h, causing those not to match the freshly-made
> ones in the tarball.  I wonder if we should make an effort to ensure
> that our generated .h and .c files always satisfy pgindent.

We should generally try to do that, if only so that they don't appear
weird and random when looking at them.

I think in the past it would have been very difficult for a generation
script to emulate pgindent's weird un-indentation logic on trailing
lines, but that shouldn't be a problem anymore.

--
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services