Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kBGTE-000667-IC for pljava-dev@arkaria.postgresql.org; Thu, 27 Aug 2020 11:53:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kBGSg-0000M1-P2 for pljava-dev@arkaria.postgresql.org; Thu, 27 Aug 2020 11:52:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kBGSg-0000Lu-FX for pljava-dev@lists.postgresql.org; Thu, 27 Aug 2020 11:52:58 +0000 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kBGSZ-0005RI-8b for pljava-dev@lists.postgresql.org; Thu, 27 Aug 2020 11:52:57 +0000 Received: by mail-ed1-x52f.google.com with SMTP id c10so4639955edk.6 for ; Thu, 27 Aug 2020 04:52:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NncGQ0fLoD90hL4Rme0xzNPj0O/hd7wWvNLP/vVMRQM=; b=Af/R5WcF27G5xGhjD2CjRVKI7+AIIKjdKVQkXSQXc8mAl+LUwx7ZYgzIUMm7PbXrK8 sNsMJTGHfwYrfSHmQsDaa9HOV/9mJOQYLtwkFXDRwZP0AfH9opNjtohUe/ns63EGAK9Z t4UCBigTB+Di/7yo84kqEyHw/jHFv4NAfHa8noQVDX7zjI/1bdnElQ3dhvd8B7BYgIQJ qvrgVCVdjl6yhfouL0qsv4qbyH+B0lRQAi/dpN0gYhvPIkm3O2tKMm0BcpD6QE+ia8cX fK0xAiwFr11jl2rLXoFCnkA25mysTXwfQ2Ktl47Q4HKFNS/L3tFb2D9/I8Zwya70xwlO 37YQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NncGQ0fLoD90hL4Rme0xzNPj0O/hd7wWvNLP/vVMRQM=; b=ds75ICj+G4oXhN3AvSR3YEmMvUBap9O0e1uZHdZsLndDdzgs2auYJ2thjwpEcD7xKq CxeLjUZiffLPZjbUHcXU4aeUumoSfdiq0xPbEiq2+kOQ7DV1zu6/8eMnotVeAg8purwf I/Ik30vV2dks78B313GA98LfSBZvWPzSsxs73E/7NXLcgexqLp330DjzANchw5Vayi/B 5MS3u5yeCYwJ8gOIjm7migpAjoelQcNe/vjuAwByICCqj7uMgbxiWmQwR6FELhwJiL0W dG+nqLgNlf1Ohhwp+rkxNsyYP0IvGOwOBPryOGiwwGpe0sW74RuovRIR/tjrYwyV0mPG RLeg== X-Gm-Message-State: AOAM532ByanecXiH0wxVMLgOFU2/SDvqaly1wmmh9nujIZWyxW2rMHks Jc93FASCdu2KQ9bbfM8nEsUSmcnYEUmcbyNuJIX+UH8P4TiKXg== X-Google-Smtp-Source: ABdhPJyD+Y0Z/Nl93O8gSOVdcyWPdO2gl3y4eP8menqX9+Jntc62WHOqRTjVBIpYNkSyBMCN5/GHgbxveeFL0RJa1f0= X-Received: by 2002:aa7:cd52:: with SMTP id v18mr18364783edw.165.1598529168111; Thu, 27 Aug 2020 04:52:48 -0700 (PDT) MIME-Version: 1.0 References: <5F3D32E9.80504@anastigmatix.net> <5F3D36BE.70703@anastigmatix.net> <5F3D38F8.7050907@anastigmatix.net> <5F3D3A75.5010304@anastigmatix.net> <5F3D3D2E.4070109@anastigmatix.net> <5F3D43BD.4020900@anastigmatix.net> <5F3DA48D.7090408@anastigmatix.net> <5F41943D.9080707@anastigmatix.net> <5F427604.5010103@anastigmatix.net> <5F42A71F.8000002@anastigmatix.net> <5F459B6E.3020803@anastigmatix.net> <5F45EE7F.5020609@anastigmatix.net> <5F46B70E.6070601@anastigmatix.net> <5F46DC70.1080404@anastigmatix.net> In-Reply-To: <5F46DC70.1080404@anastigmatix.net> From: Kartik Ohri Date: Thu, 27 Aug 2020 17:22:36 +0530 Message-ID: Subject: Re: the ScriptingMojo To: Chapman Flack Cc: pljava-dev@lists.postgresql.org Content-Type: multipart/alternative; boundary="0000000000003a7c1405adda939d" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --0000000000003a7c1405adda939d Content-Type: text/plain; charset="UTF-8" On Thu, Aug 27, 2020 at 3:34 AM Chapman Flack wrote: > On 08/26/20 15:25, Chapman Flack wrote: > > > If the nar-maven-plugin is also generating such files when it uses MSVC > > to build, then probably it also has some classes to help generating those > > files (or it uses a dependency that has some classes to help generating > > those files). It might not be too bad to end up adding that as a > dependency > > of the PGXS plugin (added by a profile conditioned on Windows os) in > order > > to reuse that part of its code, if it is accessible. > > That stuff seems to be here, and accessible: > > > https://maven-nar.github.io/apidocs/com/github/maven_nar/cpptasks/ide/ProjectWriter.html > > ... but I have never really watched the nar-maven-plugin closely enough > on Windows to see if it even creates such a file for pljava, or just passes > everything on the command line. I don't know enough about MSVC to know if > the project file is mandatory. > > In your commit cb0ceb9 I see that maybe you could get by with only the > command line. > > Of course I would handle the /DNDEBUG, /DWindows, /DWIN32, and > /DPLJAVA_SO_VERSION=1.6.0-SNAPSHOT by defines.add (without the /D) > and overriding formatDefines to supply /D rather than -D. And really, > the PLJAVA_SO_VERSION=project.version should be among the base defines > supplied to any template. > > I would rather have the probing be done in the probe method; it could > just have an OS name parameter and return a boolean. > > "Windows-MinGW-w64" : { > probe : function(os) { > return os.startsWith('Windows') && System.gete...GW64"); > > "Windows-MSVC" : { > probe : function(os) { > return os.startsWith('Windows') && System.gete...VCINSTALLDIR"); > > or something like that, where the outer container of the templates would > be a [ ] rather than a { } so there would be a reliable order for probing > the templates. The driving code could just go down the list calling > probe(os) until one returned true, and use that one. > > Regards, > -Chap > Yes, I am going to incorporate these changes in the configuration block. I had hardcoded the values for the sake of getting a basic implementation ready. A basic implementation is ready and now is working on for all configurations except MinGW with a weird error https://ci.appveyor.com/project/amCap1712/pljava/builds/34883248/job/0s01axnd9t76o6da . It seems there is some issue in linking but the logs do not hint this. Another possible reason could be the packaging module not being able to find the .dll. But again no sign of this from the logs. Do you have any idea about what could be the issue here ? Thanks Regards, Kartik --0000000000003a7c1405adda939d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Thu, Aug 27, 2020 at 3:34 AM Chapman F= lack <chap@an= astigmatix.net> wrote:
On 08/26/20 15:25, Chapman Flack w= rote:

> If the nar-maven-plugin is also generating such files when it uses MSV= C
> to build, then probably it also has some classes to help generating th= ose
> files (or it uses a dependency that has some classes to help generatin= g
> those files). It might not be too bad to end up adding that as a depen= dency
> of the PGXS plugin (added by a profile conditioned on Windows os) in o= rder
> to reuse that part of its code, if it is accessible.

That stuff seems to be here, and accessible:

https://mave= n-nar.github.io/apidocs/com/github/maven_nar/cpptasks/ide/ProjectWriter.htm= l

... but I have never really watched the nar-maven-plugin closely enough
on Windows to see if it even creates such a file for pljava, or just passes=
everything on the command line. I don't know enough about MSVC to know = if
the project file is mandatory.

In your commit cb0ceb9 I see that maybe you could get by with only the
command line.

Of course I would handle the /DNDEBUG, /DWindows, /DWIN32, and
/DPLJAVA_SO_VERSION=3D1.6.0-SNAPSHOT by defines.add (without the /D)
and overriding formatDefines to supply /D rather than -D. And really,
the PLJAVA_SO_VERSION=3Dproject.version should be among the base defines supplied to any template.

I would rather have the probing be done in the probe method; it could
just have an OS name parameter and return a boolean.

"Windows-MinGW-w64" : {
=C2=A0 probe : function(os) {
=C2=A0 =C2=A0return os.startsWith('Windows') && System.gete= ...GW64");

"Windows-MSVC" : {
=C2=A0 probe : function(os) {
=C2=A0 =C2=A0return os.startsWith('Windows') && System.gete= ...VCINSTALLDIR");

or something like that, where the outer container of the templates would be a [ ] rather than a { } so there would be a reliable order for probing the templates. The driving code could just go down the list calling
probe(os) until one returned true, and use that one.

Regards,
-Chap

Yes, I am going to incorporate th= ese changes in the configuration block. I had hardcoded the values for the = sake of getting a basic implementation ready. A basic implementation is rea= dy and now is working on for all configurations except MinGW with a weird e= rror=C2=A0https://ci.appveyor.com/project/amCap1712/= pljava/builds/34883248/job/0s01axnd9t76o6da.=C2=A0

=
It seems there is some issue in linking but the logs=C2=A0do not hint = this. Another possible reason could be the packaging module not being able = to find the .dll. But again no sign of this from the logs. Do you have any = idea about what could be the issue here ?

Thanks
Regards,
Kartik
--0000000000003a7c1405adda939d--