pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #15065: ActivePerl 5.24.3 breaks PG compilation on Windows
3+ messages / 3 participants
[nested] [flat]

* BUG #15065: ActivePerl 5.24.3 breaks PG compilation on Windows
@ 2018-02-14 13:19  PG Bug reporting form <noreply@postgresql.org>
  0 siblings, 1 reply; 3+ messages in thread

From: PG Bug reporting form @ 2018-02-14 13:19 UTC (permalink / raw)
  To: pgsql-bugs@lists.postgresql.org; +Cc: heath.lord@crunchydata.com

The following bug has been logged on the website:

Bug reference:      15065
Logged by:          Heath Lord
Email address:      heath.lord@crunchydata.com
PostgreSQL version: 9.6.7
Operating system:   Windows
Description:        

   With the latest release of ActivePerl 5.24.3 they are installing both a
.a and a .lib with their installation.  While this normally wouldn't be an
issue, the logic that is being used in the PG source checks for one or the
other and if it finds both it will fail with an error stating that it could
not find them.  
   In the postgres/src/tools/msvc/Mkvcbuild.pm file the following logic
exists:

# ActivePerl 5.16 provided perl516.lib; 5.18 provided libperl518.a
                my @perl_libs =
                  grep { /perl\d+\.lib$|libperl\d+\.a$/ }
glob($perl_path);
                if (@perl_libs == 1)
                {
                        $plperl->AddLibrary($perl_libs[0]);
                }

  The issue is that with the latest ActivePerl release the if statement
results in a value of 2 which causes this to fail and it falls through to
the else which is the failure case.  This causes all of the Windows builds
to fail if using the latest version of ActivePerl.
    There are two possible solutions that I am proposing:

1) [msvc_perl_lib_check_for_two_use_second.patch] 
             Add an elsif clause and check if @perl_libs is 2 and then use
the libperl###.a which I have tested and everything compiles fine and passes
all tests.  

2) [msvc_perl_lib_check_inclusive_use_first_found.patch] 
       Change the if statement to check for 1 or more perl libs found and
then always use the first one that was found.  I have also built and tested
that this passes all regression.

   Both of these options work and have been built and tested.  The resulting
generated binaries are of identical size as well.  

    I am not sure given the fact that this breaks all windows builds using
this version of ActivePerl if this change needs to be backpatched or not? 
Thank you in advance for any help or assistance given to get one of these
fixes into the PG code base.

   I will be attaching the patches referenced above in a follow up reply
after the bug has been submitted.

-Heath



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: BUG #15065: ActivePerl 5.24.3 breaks PG compilation on Windows
@ 2018-02-14 13:27  Heath Lord <heath.lord@crunchydata.com>
  parent: PG Bug reporting form <noreply@postgresql.org>
  0 siblings, 1 reply; 3+ messages in thread

From: Heath Lord @ 2018-02-14 13:27 UTC (permalink / raw)
  To: Heath Lord <heath.lord@crunchydata.com>; pgsql-bugs@lists.postgresql.org

On Wed, Feb 14, 2018 at 8:19 AM, PG Bug reporting form <
noreply@postgresql.org> wrote:

> The following bug has been logged on the website:
>
> Bug reference:      15065
> Logged by:          Heath Lord
> Email address:      heath.lord@crunchydata.com
> PostgreSQL version: 9.6.7
> Operating system:   Windows
> Description:
>
>    With the latest release of ActivePerl 5.24.3 they are installing both a
> .a and a .lib with their installation.  While this normally wouldn't be an
> issue, the logic that is being used in the PG source checks for one or the
> other and if it finds both it will fail with an error stating that it could
> not find them.
>    In the postgres/src/tools/msvc/Mkvcbuild.pm file the following logic
> exists:
>
> # ActivePerl 5.16 provided perl516.lib; 5.18 provided libperl518.a
>                 my @perl_libs =
>                   grep { /perl\d+\.lib$|libperl\d+\.a$/ }
> glob($perl_path);
>                 if (@perl_libs == 1)
>                 {
>                         $plperl->AddLibrary($perl_libs[0]);
>                 }
>
>   The issue is that with the latest ActivePerl release the if statement
> results in a value of 2 which causes this to fail and it falls through to
> the else which is the failure case.  This causes all of the Windows builds
> to fail if using the latest version of ActivePerl.
>     There are two possible solutions that I am proposing:
>
> 1) [msvc_perl_lib_check_for_two_use_second.patch]
>              Add an elsif clause and check if @perl_libs is 2 and then use
> the libperl###.a which I have tested and everything compiles fine and
> passes
> all tests.
>
> 2) [msvc_perl_lib_check_inclusive_use_first_found.patch]
>        Change the if statement to check for 1 or more perl libs found and
> then always use the first one that was found.  I have also built and tested
> that this passes all regression.
>
>    Both of these options work and have been built and tested.  The
> resulting
> generated binaries are of identical size as well.
>
>     I am not sure given the fact that this breaks all windows builds using
> this version of ActivePerl if this change needs to be backpatched or not?
> Thank you in advance for any help or assistance given to get one of these
> fixes into the PG code base.
>
>    I will be attaching the patches referenced above in a follow up reply
> after the bug has been submitted.
>
> -Heath
>
>
   I am attaching the patch files that I have referenced above for your
review.  Thank you.

-Heath

Attachments: download all (2 files, .tar.gz)

msvc_perl_lib_check_for_two_use_second.patch (application/octet-stream, 767B) download diff --git a/src/tools/msvc/Mkvcbuild.pm b/src/tools/msvc/Mkvcbuild.pm index d8c279a..d5ec070 100644 --- a/src/tools/msvc/Mkvcbuild.pm +++ b/src/tools/msvc/Mkvcbuild.pm @@ -530,10 +530,14 @@ sub mkvcbuild { $plperl->AddLibrary($perl_libs[0]); } + elsif (@perl_libs ==2) + { + # With the new ActivePerl release 5.24.3 both the .a and the .lib are available. Use the .a + $plperl->AddLibrary($perl_libs[1]); + } else { - die -"could not identify perl library version matching pattern $perl_path\n"; + die "could not identify perl library version matching pattern $perl_path\n"; } # Add defines from Perl's ccflags; see PGAC_CHECK_PERL_EMBED_CCFLAGS
msvc_perl_lib_check_inclusive_use_first_found.patch (application/octet-stream, 847B) download diff --git a/src/tools/msvc/Mkvcbuild.pm b/src/tools/msvc/Mkvcbuild.pm index d8c279a..31a8346 100644 --- a/src/tools/msvc/Mkvcbuild.pm +++ b/src/tools/msvc/Mkvcbuild.pm @@ -526,14 +526,14 @@ sub mkvcbuild # ActivePerl 5.16 provided perl516.lib; 5.18 provided libperl518.a my @perl_libs = grep { /perl\d+\.lib$|libperl\d+\.a$/ } glob($perl_path); - if (@perl_libs == 1) + if (@perl_libs > 0) { + # With the new ActivePerl release 5.24.3 both the .a and the .lib are available. Use the .lib if both are found $plperl->AddLibrary($perl_libs[0]); } else { - die -"could not identify perl library version matching pattern $perl_path\n"; + die "could not identify perl library version matching pattern $perl_path\n"; } # Add defines from Perl's ccflags; see PGAC_CHECK_PERL_EMBED_CCFLAGS
^ permalink raw reply [nested|flat] 3+ messages in thread

* Re: BUG #15065: ActivePerl 5.24.3 breaks PG compilation on Windows
@ 2018-03-02 11:42  Magnus Hagander <magnus@hagander.net>
  parent: Heath Lord <heath.lord@crunchydata.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Magnus Hagander @ 2018-03-02 11:42 UTC (permalink / raw)
  To: Heath Lord <heath.lord@crunchydata.com>; +Cc: pgsql-bugs@lists.postgresql.org

On Wed, Feb 14, 2018 at 2:27 PM, Heath Lord <heath.lord@crunchydata.com>
wrote:

>
> On Wed, Feb 14, 2018 at 8:19 AM, PG Bug reporting form <
> noreply@postgresql.org> wrote:
>
>> The following bug has been logged on the website:
>>
>> Bug reference:      15065
>> Logged by:          Heath Lord
>> Email address:      heath.lord@crunchydata.com
>> PostgreSQL version: 9.6.7
>> Operating system:   Windows
>> Description:
>>
>>    With the latest release of ActivePerl 5.24.3 they are installing both a
>> .a and a .lib with their installation.  While this normally wouldn't be an
>> issue, the logic that is being used in the PG source checks for one or the
>> other and if it finds both it will fail with an error stating that it
>> could
>> not find them.
>>    In the postgres/src/tools/msvc/Mkvcbuild.pm file the following logic
>> exists:
>>
>> # ActivePerl 5.16 provided perl516.lib; 5.18 provided libperl518.a
>>                 my @perl_libs =
>>                   grep { /perl\d+\.lib$|libperl\d+\.a$/ }
>> glob($perl_path);
>>                 if (@perl_libs == 1)
>>                 {
>>                         $plperl->AddLibrary($perl_libs[0]);
>>                 }
>>
>>   The issue is that with the latest ActivePerl release the if statement
>> results in a value of 2 which causes this to fail and it falls through to
>> the else which is the failure case.  This causes all of the Windows builds
>> to fail if using the latest version of ActivePerl.
>>     There are two possible solutions that I am proposing:
>>
>> 1) [msvc_perl_lib_check_for_two_use_second.patch]
>>              Add an elsif clause and check if @perl_libs is 2 and then use
>> the libperl###.a which I have tested and everything compiles fine and
>> passes
>> all tests.
>>
>> 2) [msvc_perl_lib_check_inclusive_use_first_found.patch]
>>        Change the if statement to check for 1 or more perl libs found and
>> then always use the first one that was found.  I have also built and
>> tested
>> that this passes all regression.
>>
>>    Both of these options work and have been built and tested.  The
>> resulting
>> generated binaries are of identical size as well.
>>
>>     I am not sure given the fact that this breaks all windows builds using
>> this version of ActivePerl if this change needs to be backpatched or not?
>> Thank you in advance for any help or assistance given to get one of these
>> fixes into the PG code base.
>>
>>    I will be attaching the patches referenced above in a follow up reply
>> after the bug has been submitted.
>>
>> -Heath
>>
>>
>    I am attaching the patch files that I have referenced above for your
> review.  Thank you.
>
>
I think the second one is definitely the cleaner way to do it. Thus, I've
applied that one, after moving the comments around a bit.

I also removed the part where you changed the whitespace in the error
message :) perltidy would likely just put that right back.

-- 
 Magnus Hagander
 Me: https://www.hagander.net/ <http://www.hagander.net/;
 Work: https://www.redpill-linpro.com/ <http://www.redpill-linpro.com/;

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2018-03-02 11:42 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-02-14 13:19 BUG #15065: ActivePerl 5.24.3 breaks PG compilation on Windows PG Bug reporting form <noreply@postgresql.org>
2018-02-14 13:27 ` Heath Lord <heath.lord@crunchydata.com>
2018-03-02 11:42   ` Magnus Hagander <magnus@hagander.net>

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