Re: tests fail on windows with default git settings

From: Andres Freund <andres(at)anarazel(dot)de>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org, Dave Page <dpage(at)pgadmin(dot)org>
Subject: Re: tests fail on windows with default git settings
Date: 2024-07-08 20:16:49
Message-ID: 20240708201649.qaqllje7vc7eyiix@awork3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2024-07-07 06:30:57 -0400, Andrew Dunstan wrote:
>
> On 2024-07-07 Su 1:26 AM, Tom Lane wrote:
> > Andres Freund <andres(at)anarazel(dot)de> writes:
> > > Do we want to support checking out with core.autocrlf?
> > -1. It would be a constant source of breakage, and you could never
> > expect that (for example) making a tarball from such a checkout
> > would match anyone else's results.

> Yeah, totally agree.
>
>
> > > If we do not want to support that, ISTM we ought to raise an error somewhere?
> > +1, if we can figure out how.
> >
> >
>
>
>
> ISTM the right fix is probably to use PG_BINARY_R mode instead of "r" when
> opening the files, at least in the case if the test_json_parser tests.

That does seem like it'd fix this issue, assuming the parser can cope with
\r\n.

I'm actually mildly surprised that the tests don't fail when *not* using
autocrlf, because afaict test_json_parser_incremental.c doesn't set stdout to
binary and thus we presumably end up with \r\n in the output? Except that that
can't be true, because the test does pass on repos without autocrlf...

That approach does seem to mildly conflict with Tom and your preference for
fixing this by disallowing core.autocrlf? If we do so, the test never ought to
see a crlf?

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2024-07-08 20:18:01 Re: Interrupts vs signals
Previous Message Andres Freund 2024-07-08 20:07:53 Re: Should we work around msvc failing to compile tab-complete.c?