Re: Remove MSVC scripts from the tree

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Peter Eisentraut <peter(at)eisentraut(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>, Daniel Gustafsson <daniel(at)yesql(dot)se>, Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Remove MSVC scripts from the tree
Date: 2023-12-22 14:07:21
Message-ID: 0af80388-6610-bcbf-7810-ebc217c6194f@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 2023-12-21 Th 18:20, Michael Paquier wrote:
> On Thu, Dec 21, 2023 at 03:43:32PM -0500, Andrew Dunstan wrote:
>> On 2023-12-21 Th 03:01, Michael Paquier wrote:
>>> Andrew, was the original target of pgperlsyncheck committers and
>>> hackers who played with the MSVC scripts but could not run sanity
>>> checks on Windows (see [1])?
>>
>> yes.
> Okay, thanks. Wouldn't it be better to remove it at the end? With
> the main use case behind its introduction being gone, it is less
> attractive to keep maintaining it. If some people have been using it
> in their workflows, I'm OK to keep it but the rest of the tree can be
> checked at runtime as well.
>
>> I'm actually a bit dubious about win32tzlist.pl. Win32::Registry is not
>> present in a recent Strawberry Perl installation, and its latest version
>> says it is obsolete, although it's still included in the cpan bundle
>> libwin32.
>>
>> I wonder who has actually run the script any time recently?
> Hmm... I've never run it with meson on Win32.

Turns out I was wrong - Windows sometimes doesn't find files nicely. It
is present in my Strawberry installation.

>
>> In any case, we can probably work around the syncheck issue by making the
>> module a runtime requirement rather than a compile time requirement, by
>> using "require" instead of "use".
> Interesting. Another trick would be needed for HKEY_LOCAL_MACHINE,
> like what the dummylib but local to win32tzlist.pl. Roughly among
> these lines:
> -use Win32::Registry;
> +use Config;
> +
> +require Win32::Registry;
>
> my $tzfile = 'src/bin/initdb/findtimezone.c';
>
> +if ($Config{osname} ne 'MSWin32' && $Config{osname} ne 'msys')
> +{
> + use vars qw($HKEY_LOCAL_MACHINE);
> +}

I've done it a bit differently, but the same idea. I have tested that
what I committed passes checks on Unix and works on Windows.

cheers

andrew

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message John Naylor 2023-12-22 14:09:33 Re: [PoC] Improve dead tuple storage for lazy vacuum
Previous Message Andrey M. Borodin 2023-12-22 13:14:17 Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock