Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1elx5j-00021y-Fw for pgsql-bugs@arkaria.postgresql.org; Wed, 14 Feb 2018 13:27:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1elx5i-0003xO-Ck for pgsql-bugs@arkaria.postgresql.org; Wed, 14 Feb 2018 13:27:18 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1elx5h-0003xA-R7 for pgsql-bugs@lists.postgresql.org; Wed, 14 Feb 2018 13:27:18 +0000 Received: from mail-wm0-x229.google.com ([2a00:1450:400c:c09::229]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1elx5d-0002RB-Sm for pgsql-bugs@lists.postgresql.org; Wed, 14 Feb 2018 13:27:16 +0000 Received: by mail-wm0-x229.google.com with SMTP id x4so17776627wmc.0 for ; Wed, 14 Feb 2018 05:27:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crunchydata-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=T1ea1JDlNPYtWw1h2pb5dYAnfJ64zE1bqUjkaflIA3o=; b=S9pi7BnuY0vo7MyJ9ji4gD8PvhH4vUaJFUrfyFG7DmjyQMaSOhyGNsa0VNGW7MyNTC olYx9ulM3VHLfZ4C4qy6xDFEjMwUNKHjVPA2EPWpmsG3CaLTk6dZphGRWHTS937P0G45 vMfGM4CGFc2YI0lrZGJbUhZA+0n1Ve1Md8DarMb8Rf98HX1mnj8RVMsC2GfrCBip4cKt RWfGoZbIRNAeaMgc9PPQgHe9vzO+f42fb13kdR82MyfTE9lelJpTKuL7DMwtn/8cxnyB Io9539qddEvoVWVG8qSgUwYzA72mDQ7IELrauG6dC5aYJWYVpllDvC+fY6ngQawVouVq u3Lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=T1ea1JDlNPYtWw1h2pb5dYAnfJ64zE1bqUjkaflIA3o=; b=UVNqVoRYuy5M+NtgXES5kRDbySUoF0y5dIpKl6AHiRHpKFjYTQZr0EL0GG2OXp0d6P WszJnWZUg1OLM8/ciuZ66Sf5nvokqWZjmMEHkxlMPhLCYA9jEqeaeBe/Eu+7PpZL78Bf TzmmmBcL21HUYRedWzOHLuEXauZaZxbQXiItUjuHIbSA9bk2C4AdWjxraDBfrMWJEUB9 KmrdIbAQX6Gz8tLJXNxCXGSekhDhAQjVtzs2uFnwPBA9MueWDBmFsqd2MXrEVr5Nebfd T2ewn27h2SdaMKxd/ChfAy5/Dqr/Z0eXWZP5VxbL9F+IsI0S2J7aI1yCpu2LogeOykRV K67w== X-Gm-Message-State: APf1xPDhGNFlx41EkBK7SpUtLGUl+yenjSslvPl+/tStkKI/P0zwrpJY mJWp1+GZNWMYvMh9Eg4p6E8TM02YpHSLnsblY9D2 X-Google-Smtp-Source: AH8x225punM00Pg+EYO3Jg10JwJyIpah40n98ljjgSjYshPZnCpKGRC8KnCaXh/my288cD38ocSVDgU8HYhzvsG49N4= X-Received: by 10.80.186.5 with SMTP id g5mr6889330edc.12.1518614829901; Wed, 14 Feb 2018 05:27:09 -0800 (PST) MIME-Version: 1.0 Received: by 10.80.230.26 with HTTP; Wed, 14 Feb 2018 05:27:09 -0800 (PST) In-Reply-To: <151861437507.1449.1024662815700270598@wrigleys.postgresql.org> References: <151861437507.1449.1024662815700270598@wrigleys.postgresql.org> From: Heath Lord Date: Wed, 14 Feb 2018 08:27:09 -0500 Message-ID: Subject: Re: BUG #15065: ActivePerl 5.24.3 breaks PG compilation on Windows To: Heath Lord , pgsql-bugs@lists.postgresql.org Content-Type: multipart/mixed; boundary="f403045c4cfa7cf69c05652c1164" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --f403045c4cfa7cf69c05652c1164 Content-Type: multipart/alternative; boundary="f403045c4cfa7cf69805652c1162" --f403045c4cfa7cf69805652c1162 Content-Type: text/plain; charset="UTF-8" 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 --f403045c4cfa7cf69805652c1162 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

= On Wed, Feb 14, 2018 at 8:19 AM, PG Bug reporting form &l= t;noreply@postg= resql.org> wrote:
The foll= owing bug has been logged on the website:

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

=C2=A0 =C2=A0With the latest release of ActivePerl 5.24.3 they are installi= ng both a
.a and a .lib with their installation.=C2=A0 While this normally wouldn'= ;t be an
issue, the logic that is being used in the PG source checks for one or the<= br> other and if it finds both it will fail with an error stating that it could=
not find them.
=C2=A0 =C2=A0In the postgres/src/tools/msvc/Mkvcbuild.pm file the foll= owing logic
exists:

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

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

1) [msvc_perl_lib_check_for_two_use_second.patch]
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Add an elsif clause and che= ck if @perl_libs is 2 and then use
the libperl###.a which I have tested and everything compiles fine and passe= s
all tests.

2) [msvc_perl_lib_check_inclusive_use_first_found.patch]
=C2=A0 =C2=A0 =C2=A0 =C2=A0Change the if statement to check for 1 or more p= erl libs found and
then always use the first one that was found.=C2=A0 I have also built and t= ested
that this passes all regression.

=C2=A0 =C2=A0Both of these options work and have been built and tested.=C2= =A0 The resulting
generated binaries are of identical size as well.

=C2=A0 =C2=A0 I am not sure given the fact that this breaks all windows bui= lds 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.

=C2=A0 =C2=A0I will be attaching the patches referenced above in a follow u= p reply
after the bug has been submitted.

-Heath


=C2=A0 =C2=A0I am a= ttaching the patch files that I have referenced above for your review.=C2= =A0 Thank you.

-Heath
--f403045c4cfa7cf69805652c1162-- --f403045c4cfa7cf69c05652c1164 Content-Type: application/octet-stream; name="msvc_perl_lib_check_for_two_use_second.patch" Content-Disposition: attachment; filename="msvc_perl_lib_check_for_two_use_second.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_jdn41gha0 ZGlmZiAtLWdpdCBhL3NyYy90b29scy9tc3ZjL01rdmNidWlsZC5wbSBiL3NyYy90b29scy9tc3Zj L01rdmNidWlsZC5wbQppbmRleCBkOGMyNzlhLi5kNWVjMDcwIDEwMDY0NAotLS0gYS9zcmMvdG9v bHMvbXN2Yy9Na3ZjYnVpbGQucG0KKysrIGIvc3JjL3Rvb2xzL21zdmMvTWt2Y2J1aWxkLnBtCkBA IC01MzAsMTAgKzUzMCwxNCBAQCBzdWIgbWt2Y2J1aWxkCiAJCXsKIAkJCSRwbHBlcmwtPkFkZExp YnJhcnkoJHBlcmxfbGlic1swXSk7CiAJCX0KKyAgICAgICAgICAgICAgICBlbHNpZiAoQHBlcmxf bGlicyA9PTIpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgIyBX aXRoIHRoZSBuZXcgQWN0aXZlUGVybCByZWxlYXNlIDUuMjQuMyBib3RoIHRoZSAuYSBhbmQgdGhl IC5saWIgYXJlIGF2YWlsYWJsZS4gIFVzZSB0aGUgLmEKKyAgICAgICAgICAgICAgICAgICAgICAg ICRwbHBlcmwtPkFkZExpYnJhcnkoJHBlcmxfbGlic1sxXSk7CisgICAgICAgICAgICAgICAgfQog CQllbHNlCiAJCXsKLQkJCWRpZQotImNvdWxkIG5vdCBpZGVudGlmeSBwZXJsIGxpYnJhcnkgdmVy c2lvbiBtYXRjaGluZyBwYXR0ZXJuICRwZXJsX3BhdGhcbiI7CisJCQlkaWUgImNvdWxkIG5vdCBp ZGVudGlmeSBwZXJsIGxpYnJhcnkgdmVyc2lvbiBtYXRjaGluZyBwYXR0ZXJuICRwZXJsX3BhdGhc biI7CiAJCX0KIAogCQkjIEFkZCBkZWZpbmVzIGZyb20gUGVybCdzIGNjZmxhZ3M7IHNlZSBQR0FD X0NIRUNLX1BFUkxfRU1CRURfQ0NGTEFHUwo= --f403045c4cfa7cf69c05652c1164 Content-Type: application/octet-stream; name="msvc_perl_lib_check_inclusive_use_first_found.patch" Content-Disposition: attachment; filename="msvc_perl_lib_check_inclusive_use_first_found.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_jdn41gji1 ZGlmZiAtLWdpdCBhL3NyYy90b29scy9tc3ZjL01rdmNidWlsZC5wbSBiL3NyYy90b29scy9tc3Zj L01rdmNidWlsZC5wbQppbmRleCBkOGMyNzlhLi4zMWE4MzQ2IDEwMDY0NAotLS0gYS9zcmMvdG9v bHMvbXN2Yy9Na3ZjYnVpbGQucG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