plperl version on the meson setup summary screen

Lists: pgsql-hackers
From: Zharkov Roman <r(dot)zharkov(at)postgrespro(dot)ru>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: plperl version on the meson setup summary screen
Date: 2024-10-18 02:02:04
Message-ID: [email protected]
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hello,

Would it be convinient to show the plperl version on the meson setup
summary
screen? Now it displays only 'YES' or 'NO'. This is the expected
behavior of
the meson build system and explains in its source code:
https://github.com/mesonbuild/meson/blob/5f0bd8ff1e7fc43199d4b371fc4625f80baba810/mesonbuild/dependencies/base.py#L311C15-L311C27
With the attached patch we can see the "perlversion" in the summary
information table. But without a beautiful console colorize.

Additionaly, we found out that "perlversion" gets from the perl
"api_versionstring" config variable. When the configure script parses
the
"perl -v" output:

> pgac_perl_version=`$PERL -v 2>/dev/null | sed -n 's/This is
> perl.*v[a-...

Is this behavior correct?

--
Roman Zharkov

Attachment Content-Type Size
0001-show-plperl-version-in-the-meson-setup-summary.patch text/x-diff 723 bytes

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Zharkov Roman <r(dot)zharkov(at)postgrespro(dot)ru>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: plperl version on the meson setup summary screen
Date: 2024-11-27 14:50:57
Message-ID: [email protected]
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


On 2024-10-17 Th 10:02 PM, Zharkov Roman wrote:
> Hello,
>
> Would it be convinient to show the plperl version on the meson setup
> summary
> screen? Now it displays only 'YES' or 'NO'. This is the expected
> behavior of
> the meson build system and explains in its source code:
> https://github.com/mesonbuild/meson/blob/5f0bd8ff1e7fc43199d4b371fc4625f80baba810/mesonbuild/dependencies/base.py#L311C15-L311C27
>
> With the attached patch we can see the "perlversion" in the summary
> information table. But without a beautiful console colorize.
>

Yeah, the lack of version number has mildly annoyed me too, so let's fix
it. I haven't found the right secret sauce to make the version number
appear colorized, either. Maybe some meson guru can tell us how.

> Additionaly, we found out that "perlversion" gets from the perl
> "api_versionstring" config variable. When the configure script parses the
> "perl -v" output:
>
>> pgac_perl_version=`$PERL -v 2>/dev/null | sed -n 's/This is
>> perl.*v[a-...
>
> Is this behavior correct?

I think it's ok, it should give the same answer AFAIK. Using sed like
this to parse the output of 'perl -v' is somewhat hacky, so the meson
recipe is arguably an improvement.

cheers

andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com


From: Zharkov Roman <r(dot)zharkov(at)postgrespro(dot)ru>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: plperl version on the meson setup summary screen
Date: 2024-11-29 05:39:52
Message-ID: [email protected]
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hello,

On 2024-11-27 21:50, Andrew Dunstan wrote:
> it should give the same answer

Sometimes "version" and "api_versionstring" are different. Here are two
simple examples from my windows system and from a linux system of one of
my colleagues:

C:\Temp>perl -MConfig -e "print \"$Config{api_versionstring}\n\"; print
\"$Config{version}\n\""
5.32.0
5.32.1
C:\Temp>perl -v
This is perl 5, version 32, subversion 1 (v5.32.1) built for
MSWin32-x64-multi-thread

perl -MConfig -e 'print "$Config{api_versionstring}\n"; print
"$Config{version}\n"'
5.38.0
5.38.2
perl -v
This is perl 5, version 38, subversion 2 (v5.38.2)

--
Best regards, Roman Zharkov.


From: Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>
To: Zharkov Roman <r(dot)zharkov(at)postgrespro(dot)ru>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: plperl version on the meson setup summary screen
Date: 2024-11-29 08:26:00
Message-ID: CAN55FZ3_fZH=JSn=q+a+hqJKAHh_i1NNaAcpyiy6MqTkh5AuoQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi,

On Fri, 29 Nov 2024 at 08:40, Zharkov Roman <r(dot)zharkov(at)postgrespro(dot)ru> wrote:
>
> Hello,
>
> On 2024-11-27 21:50, Andrew Dunstan wrote:
> > it should give the same answer
>
> Sometimes "version" and "api_versionstring" are different. Here are two
> simple examples from my windows system and from a linux system of one of
> my colleagues:
>
> C:\Temp>perl -MConfig -e "print \"$Config{api_versionstring}\n\"; print
> \"$Config{version}\n\""
> 5.32.0
> 5.32.1
> C:\Temp>perl -v
> This is perl 5, version 32, subversion 1 (v5.32.1) built for
> MSWin32-x64-multi-thread
>
> perl -MConfig -e 'print "$Config{api_versionstring}\n"; print
> "$Config{version}\n"'
> 5.38.0
> 5.38.2
> perl -v
> This is perl 5, version 38, subversion 2 (v5.38.2)

It is different for me too:

$ perl -MConfig -e 'print "$Config{api_versionstring}\n";
print"$Config{version}\n"'
5.38.0
5.38.2
$ perl -v
This is perl 5, version 38, subversion 2 (v5.38.2)

On Wed, 27 Nov 2024 at 17:51, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
> On 2024-10-17 Th 10:02 PM, Zharkov Roman wrote:
> > With the attached patch we can see the "perlversion" in the summary
> > information table. But without a beautiful console colorize.
> >
> Yeah, the lack of version number has mildly annoyed me too, so let's fix
> it. I haven't found the right secret sauce to make the version number
> appear colorized, either. Maybe some meson guru can tell us how.

It seems that we can force ANSI colors:

- 'plperl': [perl_dep, perlversion],
+ 'plperl': [perl_dep, '\033[1;36m(at)0@\033[0m'.format(perlversion)],

But I think this is too hacky. I am not sure if that is the best way
or worth it.

--
Regards,
Nazir Bilal Yavuz
Microsoft


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>, Zharkov Roman <r(dot)zharkov(at)postgrespro(dot)ru>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: plperl version on the meson setup summary screen
Date: 2024-12-04 16:10:07
Message-ID: [email protected]
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


On 2024-11-29 Fr 3:26 AM, Nazir Bilal Yavuz wrote:
> Hi,
>
> On Fri, 29 Nov 2024 at 08:40, Zharkov Roman <r(dot)zharkov(at)postgrespro(dot)ru> wrote:
>> Hello,
>>
>> On 2024-11-27 21:50, Andrew Dunstan wrote:
>>> it should give the same answer
>> Sometimes "version" and "api_versionstring" are different. Here are two
>> simple examples from my windows system and from a linux system of one of
>> my colleagues:
>>
>> C:\Temp>perl -MConfig -e "print \"$Config{api_versionstring}\n\"; print
>> \"$Config{version}\n\""
>> 5.32.0
>> 5.32.1
>> C:\Temp>perl -v
>> This is perl 5, version 32, subversion 1 (v5.32.1) built for
>> MSWin32-x64-multi-thread
>>
>> perl -MConfig -e 'print "$Config{api_versionstring}\n"; print
>> "$Config{version}\n"'
>> 5.38.0
>> 5.38.2
>> perl -v
>> This is perl 5, version 38, subversion 2 (v5.38.2)
> It is different for me too:
>
> $ perl -MConfig -e 'print "$Config{api_versionstring}\n";
> print"$Config{version}\n"'
> 5.38.0
> 5.38.2
> $ perl -v
> This is perl 5, version 38, subversion 2 (v5.38.2)
>
> On Wed, 27 Nov 2024 at 17:51, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
>> On 2024-10-17 Th 10:02 PM, Zharkov Roman wrote:
>>> With the attached patch we can see the "perlversion" in the summary
>>> information table. But without a beautiful console colorize.
>>>
>> Yeah, the lack of version number has mildly annoyed me too, so let's fix
>> it. I haven't found the right secret sauce to make the version number
>> appear colorized, either. Maybe some meson guru can tell us how.
> It seems that we can force ANSI colors:
>
> - 'plperl': [perl_dep, perlversion],
> + 'plperl': [perl_dep, '\033[1;36m(at)0@\033[0m'.format(perlversion)],
>
> But I think this is too hacky. I am not sure if that is the best way
> or worth it.
>

Yes, way too hacky. If we can't find a better way I'm good with Roman's
idea in principle.

cheers

andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com


From: Zharkov Roman <r(dot)zharkov(at)postgrespro(dot)ru>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: plperl version on the meson setup summary screen
Date: 2025-02-04 06:37:29
Message-ID: [email protected]
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hello,

Here is a new patch version.
I tried to use perl 'version' instead of 'api_versionstring' to sync
with configure script.

--
Roman Zharkov

Attachment Content-Type Size
v2-0001-Show-plperl-version-in-the-meson-setup.patch text/x-diff 1.6 KB

From: vignesh C <vignesh21(at)gmail(dot)com>
To: Zharkov Roman <r(dot)zharkov(at)postgrespro(dot)ru>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: plperl version on the meson setup summary screen
Date: 2025-03-13 14:34:11
Message-ID: CALDaNm0W8dxaTO5pHD5KMU99rvkT-9sXDH1zJE4b55+N90mJGQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, 4 Feb 2025 at 12:07, Zharkov Roman <r(dot)zharkov(at)postgrespro(dot)ru> wrote:
>
> Hello,
>
> Here is a new patch version.
> I tried to use perl 'version' instead of 'api_versionstring' to sync
> with configure script.

Thanks for the patch, this looks good to me.

Regards,
Vignesh


From: vignesh C <vignesh21(at)gmail(dot)com>
To: Zharkov Roman <r(dot)zharkov(at)postgrespro(dot)ru>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: plperl version on the meson setup summary screen
Date: 2025-03-14 06:08:09
Message-ID: CALDaNm2fK3TS6q6qG4Lh=K6GXhW45WzhWWVEQ60o3wqauMbeaA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, 4 Feb 2025 at 12:07, Zharkov Roman <r(dot)zharkov(at)postgrespro(dot)ru> wrote:
>
> Hello,
>
> Here is a new patch version.
> I tried to use perl 'version' instead of 'api_versionstring' to sync
> with configure script.

One suggestion, there are many other external libraries for which we
don't display the version, can we include the version for them too:
@@ -3711,7 +3712,7 @@ if meson.version().version_compare('>=0.57')
'nls': libintl,
'openssl': ssl,
'pam': pam,
- 'plperl': perl_dep,
+ 'plperl': [perl_dep, perlversion],
'plpython': python3_dep,

Regards,
Vignesh


From: Zharkov Roman <r(dot)zharkov(at)postgrespro(dot)ru>
To: vignesh C <vignesh21(at)gmail(dot)com>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: plperl version on the meson setup summary screen
Date: 2025-03-17 08:43:13
Message-ID: [email protected]
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 2025-03-14 13:08, vignesh C wrote:
> One suggestion, there are many other external libraries for which we
> don't display the version, can we include the version for them too:

Hello,
We have seven "libraries" whose versions meson does not show: bonjour,
bsd_auth, docs, docs_pdf, nls, pam, plperl. And only plperl has a known
version.
bonjour, bsd_auth produces by declare_dependency() function, and I don't
know where to find their versions.
docs, docs_pdf are the complex of libraries: xmllint_bin, xsltproc_bin
and fop. Which version do we need?
nls can be formed in two ways: by declare_dependency() or by
cc.find_library(). It is not clear to me where to get a version.
pam also can be produced by dependency() or cc.find_library().

Best regards, Roman Zharkov


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Zharkov Roman <r(dot)zharkov(at)postgrespro(dot)ru>, vignesh C <vignesh21(at)gmail(dot)com>
Cc: Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: plperl version on the meson setup summary screen
Date: 2025-03-17 14:31:54
Message-ID: [email protected]
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


On 2025-03-17 Mo 4:43 AM, Zharkov Roman wrote:
> On 2025-03-14 13:08, vignesh C wrote:
>> One suggestion, there are many other external libraries for which we
>> don't display the version, can we include the version for them too:
>
> Hello,
> We have seven "libraries" whose versions meson does not show: bonjour,
> bsd_auth, docs, docs_pdf, nls, pam, plperl. And only plperl has a
> known version.
> bonjour, bsd_auth produces by declare_dependency() function, and I
> don't know where to find their versions.
> docs, docs_pdf are the complex of libraries: xmllint_bin, xsltproc_bin
> and fop. Which version do we need?
> nls can be formed in two ways: by declare_dependency() or by
> cc.find_library(). It is not clear to me where to get a version.
> pam also can be produced by dependency() or cc.find_library().
>
>
>

Yeah. I'm planning to commit your patch shortly.

cheers

andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com