Re: tests fail on windows with default git settings

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Andres Freund <andres(at)anarazel(dot)de>
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-09 10:26:12
Message-ID: 43a33919-04a3-4a57-afcb-77d5a55ab7ed@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 2024-07-08 Mo 5:44 PM, Andres Freund wrote:
>> What I suggest (see attached) is we run the diff command with
>> --strip-trailing-cr on Windows. Then we just won't care if the expected file
>> and/or the output file has CRs.
> I was wondering about that too, but I wasn't sure we can rely on that flag
> being supported...
>

Well, my suggestion was to use it only on Windows. I'm using the
diffutils from chocolatey, which has it, as does Msys2 diff. Not sure
what you have in the CI setup.

>> Not sure what the issue is with pg_bsd_indent, though.
> I think it's purely that we *read* with fopen("r") and write with
> fopen("wb"). Which means that any \r\n in the input will be converted to \n in
> the output. That's not a problem if the repo has been cloned without autocrlf,
> as there are no crlf in the expected files, but if autocrlf has been used, the
> expected files don't match.
>
> It doesn't look like it'd be trivial to make indent remember what was used in
> the input. So I think for now the best path is to just use .gitattributes to
> exclude the expected files from crlf conversion. If we don't want to do so
> repo wide, we can do so just for these files.
>

either that or we could use the --strip-trailing-cr gadget here too.

cheers

andrew

--
Andrew Dunstan
EDB:https://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bertrand Drouvot 2024-07-09 10:44:05 Re: Restart pg_usleep when interrupted
Previous Message Amit Langote 2024-07-09 10:18:28 Re: Address the -Wuse-after-free warning in ATExecAttachPartition()