Re: pl/perl extension fails on Windows

From: Noah Misch <noah(at)leadboat(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Dave Page <dpage(at)postgresql(dot)org>, Sandeep Thakkar <sandeep(dot)thakkar(at)enterprisedb(dot)com>, Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pl/perl extension fails on Windows
Date: 2017-12-04 02:29:32
Message-ID: 20171204022932.GA3243163@rfd.leadboat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Nov 29, 2017 at 08:14:41PM -0800, Noah Misch wrote:
> 1. If $Config{gccversion} is nonempty, add _USE_32BIT_TIME_T. This will do
> the wrong thing if MinGW changes its default to match modern MSVC. It will
> do the wrong thing for a Perl built with "gcc -D__MINGW_USE_VC2005_COMPAT".
>
> 2. When configuring the build, determine whether to add _USE_32BIT_TIME_T by
> running a test program built with and without that symbol. Perhaps have
> the test program store and retrieve a PL_modglobal value. (PL_modglobal
> maps to a PerlInterpreter field that follows the fields sensitive to
> _USE_32BIT_TIME_T, and perlapi documents it since 5.8.0 or earlier.) This
> is more principled than (1), but it will be more code and may have weird
> interactions with rare Perl build options.
>
> I am inclined toward (2) if it takes no more than roughly a hundred lines of
> code, else (1). Opinions? I regret investing in 32-bit Windows. If there's
> any OS where a 32-bit PostgreSQL server makes sense today, it's not Windows.

Here's an implementation of (2). This is more intricate than I hoped. One
could argue for (1), but I estimate (2) wins by a nose. I successfully tested
http://strawberryperl.com/download/5.14.4.1/strawberry-perl-5.14.4.1-32bit.msi
(Perl 5.14.4; MinGW-built; must have -D_USE_32BIT_TIME_T) and
http://get.enterprisedb.com/languagepacks/edb-languagepack-10-3-windows.exe
(Perl 5.24.0; MSVC-built; must not have -D_USE_32BIT_TIME_T). I also tried
http://strawberryperl.com/download/5.8.9/strawberry-perl-5.8.9.5.msi, which
experienced a StackHash_0a9e crash during PERL_SYS_INIT3(), with or without
-D_USE_32BIT_TIME_T. I expect that breakage is orthogonal. I didn't have
ready access to obsolete MSVC-built Perl, so it will be interesting to see how
the buildfarm likes this.

Attachment Content-Type Size
time_t-msvc-v1.patch text/plain 10.3 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2017-12-04 03:08:53 Re: Partition pruning for Star Schema
Previous Message Ashutosh Bapat 2017-12-04 02:14:43 Re: [HACKERS] Partition-wise aggregation/grouping