Extending MSVC scripts to support --with-extra-version

Lists: pgsql-hackers
From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Extending MSVC scripts to support --with-extra-version
Date: 2014-05-27 00:58:55
Message-ID: CAB7nPqTRiKBExhocozum5=Ri7jaLuOKY6+0h3zP-OeXvFQtp6w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi all,

Please find attached a patch extending support of --with-extra-version
in the MSVC scripts. This is something I have been using internally,
and I believe that it is useful for Windows packagers.
Similarly to the other options, a new field called extraver is added
in config_default.pl and it can be overwritten in config.pl to have an
additional version string, similarly to what is currently doable with
./configure.

I'll add this patch to the next commit fest.
Regards,
--
Michael

Attachment Content-Type Size
20140527_msvc_extra_ver.patch text/x-patch 3.5 KB

From: Asif Naeem <anaeem(dot)it(at)gmail(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Extending MSVC scripts to support --with-extra-version
Date: 2014-06-26 23:26:01
Message-ID: CAEB4t-O80OUPvNMCKXrtye5tmgL6WVO7dQM4mNS65fdu0KAwDA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi,

I have spent some time reviewing the code. It applies well and PG master
branch build fine with setting extraver or keep it undefined. I have
observed the following output applying the patch i.e.

*Keeping extraver undefined* :

C:\PG\postgresql\inst_withpatch_no_extra-version>bin\psql.exe -d postgres
> psql (9.5devel)
> WARNING: Console code page (437) differs from Windows code page (1252)
> 8-bit characters might not work correctly. See psql reference
> page "Notes for Windows users" for details.
> Type "help" for help.
> postgres=# select version();
> version
> ----------------------------------------------------------------
> PostgreSQL 9.5devel, compiled by Visual C++ build 1600, 64-bit
> (1 row)
> C:\PG\postgresql\inst_withpatch_no_extra-version>bin\initdb.exe -V
> initdb (PostgreSQL) 9.5devel

*Setting extraver as ‘June27’* :

C:\PG\postgresql\inst_withpatch_extra-version>bin\psql -d postgres
> psql (9.5devel)
> WARNING: Console code page (437) differs from Windows code page (1252)
> 8-bit characters might not work correctly. See psql reference
> page "Notes for Windows users" for details.
> Type "help" for help.
> postgres=# select version();
> version
> ----------------------------------------------------------------------
> PostgreSQL 9.5develJune27, compiled by Visual C++ build 1600, 64-bit
> (1 row)
>
> C:\PG\postgresql\inst_withpatch_extra-version>bin\initdb.exe -V
> initdb (PostgreSQL) 9.5devel

It seems that extraver information only appears when version function is
being used. If we use -V (--version) with pg utilities/binaries, it does
not include additional provided information.

Can you please guide how can I perform similar functionality via configure
script (that can be used on Unix like OS/MinGW) or It is intended for
Window specific requirement ?. Thanks.

Regards,
Muhammad Asif Naeem

On Tue, May 27, 2014 at 5:58 AM, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
wrote:

> Hi all,
>
> Please find attached a patch extending support of --with-extra-version
> in the MSVC scripts. This is something I have been using internally,
> and I believe that it is useful for Windows packagers.
> Similarly to the other options, a new field called extraver is added
> in config_default.pl and it can be overwritten in config.pl to have an
> additional version string, similarly to what is currently doable with
> ./configure.
>
> I'll add this patch to the next commit fest.
> Regards,
> --
> Michael
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>
>


From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Asif Naeem <anaeem(dot)it(at)gmail(dot)com>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Extending MSVC scripts to support --with-extra-version
Date: 2014-06-27 00:00:19
Message-ID: CAB7nPqSaa-AMSFozQDnZqOz7DP+_OZXe0gx=eiKj6V7+2af_qA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, Jun 27, 2014 at 8:26 AM, Asif Naeem <anaeem(dot)it(at)gmail(dot)com> wrote:

> I have spent some time reviewing the code. It applies well and PG master
> branch build fine with setting extraver or keep it undefined.
>
Thanks for reviewing that.

> I have observed the following output applying the patch i.e.
>
It seems that extraver information only appears when version function is
> being used. If we use -V (--version) with pg utilities/binaries, it does
> not include additional provided information.
>
You are right. The first version of this patch updates PG_VERSION_STR but
not PG_VERSION, which is the string used for all the binaries to report the
version.

> Can you please guide how can I perform similar functionality via
> configure script (that can be used on Unix like OS/MinGW) or It is intended
> for Window specific requirement ?. Thanks.
>
Sure, you can do the equivalent with plain configure like that:
./configure --with-extra-version="-foo" --prefix=/to/path/
And here is the output that I get with such options on OSX for example:
$ psql -c 'select substring(version(), 1, 52)'
substring
------------------------------------------------------
PostgreSQL 9.5devel-foo on x86_64-apple-darwin13.2.0
(1 row)
$ initdb --version
initdb (PostgreSQL) 9.5devel-foo

With the new patch attached, the following output is generated for an MSVC
build:
$ psql -c 'select version()'
version
--------------------------------------------------------------------
PostgreSQL 9.5devel-foo, compiled by Visual C++ build 1600, 64-bit
(1 row)
$ initdb --version
initdb (PostgreSQL) 9.5devel-foo

Regards,
--
Michael

Attachment Content-Type Size
20140627_msvc_extra_version_v2.patch text/x-patch 3.7 KB

From: Asif Naeem <anaeem(dot)it(at)gmail(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Extending MSVC scripts to support --with-extra-version
Date: 2014-06-30 10:05:11
Message-ID: CAEB4t-O7Fv1bduOPqv5dbf7tG8FyJHL70-Qne-JXw9Rd_F1YJw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Thank you for sharing updated patch. I have compared it with MSVC and
configure generated build i.e.

*MacOSX (*--with-extra-version "-30JUN"*)*

pc1dotnetpk:inst asif$ ./bin/psql -d postgres
> psql (9.5devel-30JUN)
> Type "help" for help.
> postgres=# select version();
> version
>
> --------------------------------------------------------------------------------------------------------------------------------------------
> PostgreSQL 9.5devel-30JUN on x86_64-apple-darwin13.2.0, compiled by Apple
> LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn), 64-bit
> (1 row)
> pc1dotnetpk:inst asif$ ./bin/initdb -V
> initdb (PostgreSQL) 9.5devel-30JUN

*Windows7 64bit (*extraver => '-30JUN'*)*

C:\PG\postgresql\inst_withpatch_v2_extra-version>bin\psql -d postgres
> psql (9.5devel-30JUN)
> WARNING: Console code page (437) differs from Windows code page (1252)
> 8-bit characters might not work correctly. See psql reference
> page "Notes for Windows users" for details.
> Type "help" for help.
> postgres=# select version();
> version
> ----------------------------------------------------------------------
> PostgreSQL 9.5devel-30JUN, compiled by Visual C++ build 1600, 64-bit
> (1 row)
> C:\PG\postgresql\inst_withpatch_v2_extra-version>bin\initdb.exe -V
> initdb (PostgreSQL) 9.5devel-30JUN

Patch looks good to me. I think it is ready for committer. Thanks.

Regards,
Muhammad Asif Naeem

On Fri, Jun 27, 2014 at 5:00 AM, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
wrote:

>
>
>
> On Fri, Jun 27, 2014 at 8:26 AM, Asif Naeem <anaeem(dot)it(at)gmail(dot)com> wrote:
>
>> I have spent some time reviewing the code. It applies well and PG master
>> branch build fine with setting extraver or keep it undefined.
>>
> Thanks for reviewing that.
>
>
>> I have observed the following output applying the patch i.e.
>>
> It seems that extraver information only appears when version function is
>> being used. If we use -V (--version) with pg utilities/binaries, it does
>> not include additional provided information.
>>
> You are right. The first version of this patch updates PG_VERSION_STR but
> not PG_VERSION, which is the string used for all the binaries to report the
> version.
>
>
>> Can you please guide how can I perform similar functionality via
>> configure script (that can be used on Unix like OS/MinGW) or It is intended
>> for Window specific requirement ?. Thanks.
>>
> Sure, you can do the equivalent with plain configure like that:
> ./configure --with-extra-version="-foo" --prefix=/to/path/
> And here is the output that I get with such options on OSX for example:
> $ psql -c 'select substring(version(), 1, 52)'
> substring
> ------------------------------------------------------
> PostgreSQL 9.5devel-foo on x86_64-apple-darwin13.2.0
> (1 row)
> $ initdb --version
> initdb (PostgreSQL) 9.5devel-foo
>
> With the new patch attached, the following output is generated for an MSVC
> build:
> $ psql -c 'select version()'
> version
> --------------------------------------------------------------------
> PostgreSQL 9.5devel-foo, compiled by Visual C++ build 1600, 64-bit
> (1 row)
> $ initdb --version
> initdb (PostgreSQL) 9.5devel-foo
>
> Regards,
> --
> Michael
>


From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Asif Naeem <anaeem(dot)it(at)gmail(dot)com>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Extending MSVC scripts to support --with-extra-version
Date: 2014-06-30 11:43:19
Message-ID: 20140630114317.GA65957@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, Jun 30, 2014 at 7:05 PM, Asif Naeem <anaeem(dot)it(at)gmail(dot)com> wrote:
> Patch looks good to me. I think it is ready for committer. Thanks.
Thanks for the extra checks and for taking the time to review it.
--
Michael

Attachment Content-Type Size
unknown_filename text/html 6.0 KB

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Asif Naeem <anaeem(dot)it(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Extending MSVC scripts to support --with-extra-version
Date: 2014-07-12 17:39:28
Message-ID: CABUevEyy4pNcEFdHAeZTQozH7ZHGDPAbZmAC454YMkLpfKe-YA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, Jun 30, 2014 at 1:43 PM, Michael Paquier
<michael(dot)paquier(at)gmail(dot)com> wrote:
>
>
>
> On Mon, Jun 30, 2014 at 7:05 PM, Asif Naeem <anaeem(dot)it(at)gmail(dot)com> wrote:
>> Patch looks good to me. I think it is ready for committer. Thanks.
> Thanks for the extra checks and for taking the time to review it.

Applied, thanks!

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


From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: Asif Naeem <anaeem(dot)it(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Extending MSVC scripts to support --with-extra-version
Date: 2014-07-12 22:38:23
Message-ID: CAB7nPqQdSaTL7JH-KA7TEaKbSYCz-LEt-Ni76Wepf3WCZtbGYw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Sun, Jul 13, 2014 at 2:39 AM, Magnus Hagander <magnus(at)hagander(dot)net>
> Applied, thanks!.
Thanks.
--
Michael