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 1jrwNn-0003Js-9I for pljava-dev@arkaria.postgresql.org; Sun, 05 Jul 2020 04:36:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jrwNm-0005YA-4V for pljava-dev@arkaria.postgresql.org; Sun, 05 Jul 2020 04:36:02 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jrwNl-0005Xz-U2 for pljava-dev@lists.postgresql.org; Sun, 05 Jul 2020 04:36:01 +0000 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jrwNj-0005pD-N8 for pljava-dev@lists.postgresql.org; Sun, 05 Jul 2020 04:36:00 +0000 Received: by mail-ed1-x533.google.com with SMTP id e22so31694717edq.8 for ; Sat, 04 Jul 2020 21:35:59 -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=INR34EANhPOHogr+6EF8PaTDpmatimXPuPgROILeZ4k=; b=f8yQfGPgA0kVJp6+qu3zBTbjnS9ZtrM35BrwxNbVSf1SH4lH/RfvFYPSYMxpFBaRVc DRop+KExd4N9jp4anB7AoQHic5FB3Ue41LlldZDjxmwO2HQUE/l0UzfK3pAZKxBBpPq1 Nq78fz5oDXz1q+H5sW+jx0thkSoBNDJK1E4bfThdNgByClgYG40CH7ugZ1F4clI12MYP LhzNqq3+j0RKUjxVbtZt/I23vjGcqzqEI7fD5NG2u6/dOVrmmjORdabwufzpF1C9YcHZ 7h0/wVxyzPJLiJSodTkJqms+yH2ZzT8mx3XbZVtkTMe6uw5VLvxGaGihKyPknOi0LdFi A/gg== 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=INR34EANhPOHogr+6EF8PaTDpmatimXPuPgROILeZ4k=; b=Vd4Sj2myUep7JsYQzV5wR/eeHygK4Re8+PVWuydeEmosRXicSDa337hK7XQ2k5B8lt b3rPVjXbMlPt9qPbsi0xmWEhT2Pk0saOG8tj3KuuHHWFGunVoCiHegFus+QsQgGRixHi dTkCOQJmogwS+iQa0qjGDU7iqJFr1mbZlFJzP7DUVAgvSJYMy8YKAm8A9gTOXMRAM0TB mpI7LOw12WA9JpEy4N1Q8E/cX3fC2+CXzwbdBh/qmKzCMlJvsfgj2dD4hhIweel1pjco psN49s+VZHZ/dDuc/5Ziueyz6K26SSka1AnX8YFMHM1djfGR6ud0JH2ZAQr1cA130rMK 1fgA== X-Gm-Message-State: AOAM530m6/mBwiF/TmI7cSGrMZVg9RuaOxvsNqQjSMiNXQ/5I/E3APMT sUhtpQWhpFAJD0RwSFK1Z3+oOmsFFPWiKbELyqTnkutI X-Google-Smtp-Source: ABdhPJx/xB3TrB56JPjhMUavKLElbGtRPJ3+f4DIzyhlyuVHeEwgC/yXErCplwNS5bZmkUZQot5srZshxeMcXRwdHfs= X-Received: by 2002:a05:6402:1d0b:: with SMTP id dg11mr16809520edb.212.1593923757952; Sat, 04 Jul 2020 21:35:57 -0700 (PDT) MIME-Version: 1.0 References: <5EF7B265.3060907@anastigmatix.net> <5EFA6C22.8060006@anastigmatix.net> <5EFC18D9.3090108@anastigmatix.net> <5EFD41B1.30009@anastigmatix.net> <5EFE0A4D.8060402@anastigmatix.net> <5F0125BC.5000609@anastigmatix.net> In-Reply-To: <5F0125BC.5000609@anastigmatix.net> From: Kartik Ohri Date: Sun, 5 Jul 2020 10:05:46 +0530 Message-ID: Subject: Re: PL/Java new build plugin To: Chapman Flack Cc: pljava-dev@lists.postgresql.org Content-Type: multipart/alternative; boundary="0000000000006451d005a9aa4be3" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --0000000000006451d005a9aa4be3 Content-Type: text/plain; charset="UTF-8" > > The commit where I tweaked for the custom suffixes was bf59577, and > the one for the PG10 numbering change was c434748. The commit comments > and diffs give some insight into what was changed and why. (Have you > played with 'blame' in git before?) > No, I do not know about git blame but I will take a look and learn about that. It looks as if you copied the expressions faithfully, except perhaps > for the flags that are set for the first one. That probably doesn't > explain any problem you're having (though it should be fixed anyway), > as that first pattern isn't even in play unless you are building against > a devel, alpha, beta, or rc version of PostgreSQL. > I had checked about the si flag and think it is probably the same function as the DOTALL flag I set for that pattern. Can you supply an example of what is going wrong? > After the replacement, the string when written to file displays some empty boxes instead of the correct version. I'll share an example soon. One last thing, not regex related: > > You can see the original build.xml code invokes pg_config multiple > times, reading one configuration value each time, and the same is > done by PGXS in Makefile.global [1]. > > It does seem more efficient to invoke pg_config only once and parse > its output for the various values, as you are doing here. > > What could be the reason existing code avoided doing that? > I saw this as well and though that the plugin in POM executed multiple times with the specific argument to assign the entire output as the property. I did not go with that approach because I thought it was simply not possible for that plugin to read the output and process it to store different parts in multiple properties. I believe it to be the case with PGXS as well since both of them are generic and need to cater various use cases. --0000000000006451d005a9aa4be3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
The commit where I tweaked for the custom suffixes was bf5957= 7, and
the one for the PG10 numbering change was c434748. The commit comments
and diffs give some insight into what was changed and why. (Have you
played with 'blame' in git before?)
No, I do not know about git blame but I will take a look and lear= n about that.

It looks as if you copied the ex= pressions faithfully, except perhaps
for the flags that are set for the first one. That probably doesn't
explain any problem you're having (though it should be fixed anyway), as that first pattern isn't even in play unless you are building agains= t
a devel, alpha, beta, or rc version of PostgreSQL.
I had checked about the si flag and think it is probably th= e same function as the DOTALL flag I set for that pattern.

Can you supply an example of what is going wrong?
After the replacement, the string when written to file displ= ays some empty boxes instead of the correct version. I'll share an exam= ple soon.

One last thing, not regex related:

You can see the original build.xml code invokes pg_config multiple
times, reading one configuration value each time, and the same is
done by PGXS in Makefile.global [1].

It does seem more efficient to invoke pg_config only once and parse
its output for the various values, as you are doing here.

What could be the reason existing code avoided doing that?
=
I saw this as well and though that the plugin in PO= M executed multiple times with the specific argument to assign the entire o= utput as the property. I did=C2=A0 not go with that approach because I thou= ght it was simply not possible for that plugin to read the output and proce= ss it to store different parts in multiple properties. I believe it to be t= he case with PGXS as well since both of them are generic and need to cater = various use cases.
--0000000000006451d005a9aa4be3--