public inbox for [email protected]  
help / color / mirror / Atom feed
From: Thomas Munro <[email protected]>
To: Juan José Santamaría Flecha <[email protected]>
Cc: Noah Misch <[email protected]>
Cc: pgsql-hackers <[email protected]>
Subject: Re: Windows default locale vs initdb
Date: Mon, 20 Nov 2023 14:56:45 +1300
Message-ID: <CA+hUKGLsV3vTjPp7bOZBr3JTKp3Brkr9V0Qfmc7UvpWcmAQL4A@mail.gmail.com> (raw)
In-Reply-To: <CA+hUKG+Pa28J-SCsn6d5x8KkqgqdAQ7q-pTgMYrht9B-c0dD5w@mail.gmail.com>
References: <CA+hUKGJ=XThErgAQRoqfCy1bKPxXVuF0=2zDbB+SxDs59pv7Fw@mail.gmail.com>
	<[email protected]>
	<CAC+AXB2c7icYiXJCwv+4=Di=xZft0NxT=5LP3BcjFnF8ZuBhAg@mail.gmail.com>
	<CA+hUKGKrGP3BhS+h1zdLYRRvhtbyaz4bhjUyPktAQfH=uS2JXw@mail.gmail.com>
	<CA+hUKGK3zubzq_JZ8MU=zzjOLKKgdq_Knyf_Bra042nqj8gf3g@mail.gmail.com>
	<CAC+AXB0TWR2aFw2YoU9bgL3pNXhHn9eMD3N++50m6axa9gyxYw@mail.gmail.com>
	<CA+hUKGJZskvCh=Qm75UkHrY6c1QZUuC92Po9rponj1BbLmcMEA@mail.gmail.com>
	<CAC+AXB10p+mnJ6wrAEm6jb51+8=BfYzD=w6ftHRbMjMuSFN3kQ@mail.gmail.com>
	<CA+hUKG+zcZw7zmPw4nAQCv1b-78UBSxKifWjOYtCGu9KLKG7Xw@mail.gmail.com>
	<CA+hUKGKziSwNmeO3Bt2eVxWHssFMi0KWDurtTbaq6pU+M+HVVQ@mail.gmail.com>
	<CA+hUKG+Pa28J-SCsn6d5x8KkqgqdAQ7q-pTgMYrht9B-c0dD5w@mail.gmail.com>

I clicked "Trigger" to get a Mingw test run of this, and it failed[1].
I see why: our function win32_langinfo() believes that it shouldn't
call GetLocaleInfoEx() on non-MSVC compilers, so we see 'initdb:
error: could not find suitable encoding for locale "en-US"'.  I think
it has fallback code that parses the ".1252" or whatever on the end of
the name, but "en-US" hasn't got one.  I don't know the first thing
about Mingw but it looks like a declaration for that function arrived
6 years ago[2], and deleting the "#if defined(_MSC_VER)" fixes the
problem and the tests pass[3].  As far as I know, we don't support any
Mingw but the very latest: it's not a target with real users who have
version requirements, it's just a developer [in]convenience, so if it
passes on CI and whatever MSYS version "fairywren" runs in the build
farm right now, that should be enough.

I could just do that in this patch, but I suppose that also means that
someone needs to go through pg_locale.c and other places that test
_MSC_VER not because they actually care about the compiler but because
they want to detect some crusty old Mingw version, and see what else
can be deleted as a result, possibly including a lot of fallback code.
It feels like a separate cleanup for a separate patch.

[1] https://cirrus-ci.com/task/5301814774464512
[2] https://github.com/mirror/mingw-w64/blame/eff726c461e09f35eeaed125a3570fa5f807f02b/mingw-w64-tools/w...
[3] https://cirrus-ci.com/task/6558569718349824






view thread (2+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Windows default locale vs initdb
  In-Reply-To: <CA+hUKGLsV3vTjPp7bOZBr3JTKp3Brkr9V0Qfmc7UvpWcmAQL4A@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox