Subject: Re: tests fail on windows with default git settings

From: Dave Page <[email-masked]>
Date: Wed, 10 Jul 2024 12:17:50 +0100

On Wed, 10 Jul 2024 at 12:12, Andrew Dunstan <[email-masked]> wrote:

>
> On 2024-07-09 Tu 11:34 AM, Andrew Dunstan wrote:
>
>
> On 2024-07-09 Tu 9:52 AM, Dave Page 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...
>>
>
> I have 4 different diff.exe's on my ~6 week old build VM (not counting
> shims), all of which seem to support --strip-trailing-cr. Those builds came
> with:
>
> - git
> - VC++
> - diffutils (installed by chocolatey)
> - vcpkg
>
> I think it's reasonable to assume it'll be supported.
>
>
>
> Ok, cool. So I propose to patch the test_json_parser and pg_bsd_indent
> tests to use it on Windows, later today unless there's some objection.
>
>
>
>
> As I was looking at this I wondered if there might be anywhere else that
> needed adjustment. One thing that occurred to me was that that maybe we
> should replace the use of "-w" in pg_regress.c with this rather less
> dangerous flag, so instead of ignoring any white space difference we would
> only ignore line end differences. The use of "-w" apparently dates back to
> 2009.
>
That seems like a good improvement to me.

-- 
Dave Page
pgAdmin: https://www.pgadmin.org
PostgreSQL: https://www.postgresql.org
EDB: https://www.enterprisedb.com

---

From: Tom Lane <[email-masked]>
Date: Wed, 10 Jul 2024 09:25:25 -0400

> That seems like a good improvement to me.

+1

			regards, tom lane

---

From: Andrew Dunstan <[email-masked]>
Date: Wed, 10 Jul 2024 10:03:50 -0400

>> That seems like a good improvement to me.

OK, done.

cheers

andrew

--
Andrew Dunstan

---

From: Nazir Bilal Yavuz <[email-masked]>
Date: Thu, 11 Jul 2024 11:59:57 +0300

Hi,

> >> That seems like a good improvement to me.

It looks like Postgres CI did not like this change. 'Windows - Server
2019, VS 2019 - Meson & ninja' [1] task started to fail after this
commit, there is one extra space at the end of line in regress test's
output.

[1] https://cirrus-ci.com/task/6753781205958656

-- 
Regards,
Nazir Bilal Yavuz
Microsoft

---

From: Andrew Dunstan <[email-masked]>
Date: Thu, 11 Jul 2024 07:29:30 -0400

> [1] https://cirrus-ci.com/task/6753781205958656

Oh, that's annoying. Will investigate. Thanks for the heads up.

cheers

andrew

---

From: Andrew Dunstan <[email-masked]>
Date: Thu, 11 Jul 2024 09:56:41 -0400

> Oh, that's annoying. Will investigate. Thanks for the heads up.

I have reverted the pg_regress.c portion of the patch. I will 
investigate non line-end differences on Windows further.

cheers

andrew