MSVC Build support with visual studio 2019

classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

MSVC Build support with visual studio 2019

Haribabu Kommi-2
Hi Hackers,

Here I attached a patch that supports building of PostgreSQL with VS 2019.
VS 2019 is going to release on Apr 2nd 2019, it will be good if version 12
supports compiling. The attached for is for review, it may needs some updates
once the final version is released.

Commit d9dd406fe281d22d5238d3c26a7182543c711e74 has reduced the
minimum visual studio support to 2013 to support C99 standards, because of this
reason, the current attached patch cannot be backpatched as it is.

I can provide a separate back branches patch later once this patch comes to a stage of commit. Currently all the supported branches are possible to compile with VS 2017.

comments?

Regards,
Haribabu Kommi
Fujitsu Australia

0001-Support-building-with-visual-studio-2019.patch (14K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: MSVC Build support with visual studio 2019

Michael Paquier-2
On Thu, Mar 21, 2019 at 11:36:42AM +1100, Haribabu Kommi wrote:
> I can provide a separate back branches patch later once this patch comes to
> a stage of commit. Currently all the supported branches are possible to
> compile with VS 2017.

When it comes to support newer versions of MSVC, we have come up
lately to backpatch that down to two stable versions but not further
down (see f2ab389 for v10 and v9.6), so it looks sensible to target
v11 and v10 as well if we were to do it today, and v11/v12 if we do it
in six months per the latest trends.
--
Michael

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: MSVC Build support with visual studio 2019

Michael Paquier-2
On Thu, Mar 21, 2019 at 09:47:02AM +0900, Michael Paquier wrote:
> When it comes to support newer versions of MSVC, we have come up
> lately to backpatch that down to two stable versions but not further
> down (see f2ab389 for v10 and v9.6), so it looks sensible to target
> v11 and v10 as well if we were to do it today, and v11/v12 if we do it
> in six months per the latest trends.

By the way, you mentioned upthread that all the branches can compile
with MSVC 2017, but that's not actually the case for 9.5 and 9.4 if
you don't back-patch f2ab389 further down.  Or did you mean that the
code as-is is compilable if the scripts are patched manually?
--
Michael

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: MSVC Build support with visual studio 2019

Haribabu Kommi-2

On Thu, Mar 21, 2019 at 12:31 PM Michael Paquier <[hidden email]> wrote:
On Thu, Mar 21, 2019 at 09:47:02AM +0900, Michael Paquier wrote:
> When it comes to support newer versions of MSVC, we have come up
> lately to backpatch that down to two stable versions but not further
> down (see f2ab389 for v10 and v9.6), so it looks sensible to target
> v11 and v10 as well if we were to do it today, and v11/v12 if we do it
> in six months per the latest trends.

By the way, you mentioned upthread that all the branches can compile
with MSVC 2017, but that's not actually the case for 9.5 and 9.4 if
you don't back-patch f2ab389 further down.

The commit f2ab389 is later back-patch to version till 9.3 in commit 19acfd65.
I guess that building the windows installer for all the versions using the same
visual studio is may be the reason behind that back-patch.

Regards,
Haribabu Kommi
Fujitsu Australia
Reply | Threaded
Open this post in threaded view
|

Re: MSVC Build support with visual studio 2019

Michael Paquier-2
On Thu, Mar 21, 2019 at 12:45:57PM +1100, Haribabu Kommi wrote:
> The commit f2ab389 is later back-patch to version till 9.3 in commit
> 19acfd65.  I guess that building the windows installer for all the
> versions using the same visual studio is may be the reason behind
> that back-patch.

I did not remember this one, thanks for pointing it out.  So my
memories on that were incorrect.  If it is possible to get the code to
build with MSVC 2019 on all the supported branches, we could do so.
--
Michael

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: MSVC Build support with visual studio 2019

Andrew Dunstan-8

On 3/21/19 3:13 AM, Michael Paquier wrote:
> On Thu, Mar 21, 2019 at 12:45:57PM +1100, Haribabu Kommi wrote:
>> The commit f2ab389 is later back-patch to version till 9.3 in commit
>> 19acfd65.  I guess that building the windows installer for all the
>> versions using the same visual studio is may be the reason behind
>> that back-patch.
> I did not remember this one, thanks for pointing it out.  So my
> memories on that were incorrect.  If it is possible to get the code to
> build with MSVC 2019 on all the supported branches, we could do so.




VS2019 is currently in preview. I think we'd probably be better off
waiting until the full release. I don't know of any pressing urgency for
us to support it.


cheers


andrew


--
Andrew Dunstan                https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


Reply | Threaded
Open this post in threaded view
|

Re: MSVC Build support with visual studio 2019

Andrew Dunstan-8
I

On 3/25/19 3:44 PM, Andrew Dunstan wrote:

> On 3/21/19 3:13 AM, Michael Paquier wrote:
>> On Thu, Mar 21, 2019 at 12:45:57PM +1100, Haribabu Kommi wrote:
>>> The commit f2ab389 is later back-patch to version till 9.3 in commit
>>> 19acfd65.  I guess that building the windows installer for all the
>>> versions using the same visual studio is may be the reason behind
>>> that back-patch.
>> I did not remember this one, thanks for pointing it out.  So my
>> memories on that were incorrect.  If it is possible to get the code to
>> build with MSVC 2019 on all the supported branches, we could do so.
>
>
>
> VS2019 is currently in preview. I think we'd probably be better off
> waiting until the full release. I don't know of any pressing urgency for
> us to support it.
>
>

I see Haribabu mentioned that in his original email.


I'll take a look at verifying the patch.


cheers


andrew


--
Andrew Dunstan                https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


Reply | Threaded
Open this post in threaded view
|

Re: MSVC Build support with visual studio 2019

Andrew Dunstan-8
In reply to this post by Haribabu Kommi-2

On 3/20/19 8:36 PM, Haribabu Kommi wrote:

> Hi Hackers,
>
> Here I attached a patch that supports building of PostgreSQL with VS 2019.
> VS 2019 is going to release on Apr 2nd 2019, it will be good if version 12
> supports compiling. The attached for is for review, it may needs some
> updates
> once the final version is released.
>
> Commit d9dd406fe281d22d5238d3c26a7182543c711e74 has reduced the
> minimum visual studio support to 2013 to support C99 standards,
> because of this
> reason, the current attached patch cannot be backpatched as it is.
>
> I can provide a separate back branches patch later once this patch
> comes to a stage of commit. Currently all the supported branches are
> possible to compile with VS 2017.
>
> comments?
>
>


I have verified that this works with VS2019.


There are a few typos in the comments that need cleaning up.


cheers


andrew


--
Andrew Dunstan                https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


Reply | Threaded
Open this post in threaded view
|

Re: MSVC Build support with visual studio 2019

Haribabu Kommi-2

On Wed, Mar 27, 2019 at 3:03 AM Andrew Dunstan <[hidden email]> wrote:

On 3/20/19 8:36 PM, Haribabu Kommi wrote:
> Hi Hackers,
>
> Here I attached a patch that supports building of PostgreSQL with VS 2019.
> VS 2019 is going to release on Apr 2nd 2019, it will be good if version 12
> supports compiling. The attached for is for review, it may needs some
> updates
> once the final version is released.
>
> Commit d9dd406fe281d22d5238d3c26a7182543c711e74 has reduced the
> minimum visual studio support to 2013 to support C99 standards,
> because of this
> reason, the current attached patch cannot be backpatched as it is.
>
> I can provide a separate back branches patch later once this patch
> comes to a stage of commit. Currently all the supported branches are
> possible to compile with VS 2017.
>
> comments?
>
>


I have verified that this works with VS2019.


There are a few typos in the comments that need cleaning up.

Thanks for the review.

I corrected the typos in the comments, hopefully I covered everything.
Attached is the updated patch. Once the final VS 2019, I will check the
patch if it needs any more updates.

Regards,
Haribabu Kommi
Fujitsu Australia

0001-Support-building-with-visual-studio-2019_v2.patch (14K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: MSVC Build support with visual studio 2019

Haribabu Kommi-2

On Wed, Mar 27, 2019 at 11:42 AM Haribabu Kommi <[hidden email]> wrote:

On Wed, Mar 27, 2019 at 3:03 AM Andrew Dunstan <[hidden email]> wrote:

On 3/20/19 8:36 PM, Haribabu Kommi wrote:
> Hi Hackers,
>
> Here I attached a patch that supports building of PostgreSQL with VS 2019.
> VS 2019 is going to release on Apr 2nd 2019, it will be good if version 12
> supports compiling. The attached for is for review, it may needs some
> updates
> once the final version is released.
>
> Commit d9dd406fe281d22d5238d3c26a7182543c711e74 has reduced the
> minimum visual studio support to 2013 to support C99 standards,
> because of this
> reason, the current attached patch cannot be backpatched as it is.
>
> I can provide a separate back branches patch later once this patch
> comes to a stage of commit. Currently all the supported branches are
> possible to compile with VS 2017.
>
> comments?
>
>


I have verified that this works with VS2019.


There are a few typos in the comments that need cleaning up.

Thanks for the review.

I corrected the typos in the comments, hopefully I covered everything.
Attached is the updated patch. Once the final VS 2019, I will check the
patch if it needs any more updates.

Visual Studio 2019 is officially released. There is no major change in the
patch, except some small comments update.

Also attached patches for the back branches also.

Regards,
Haribabu Kommi
Fujitsu Australia

0001-Support-building-with-visual-studio-2019_v11.patch (13K) Download Attachment
0001-support-building-with-visual-studio-2019_v10_to_v9.6.patch (13K) Download Attachment
0001-Support-building-with-visual-studio-2019.patch (13K) Download Attachment
0001-support-building-with-visual-studio-2019_v9.4.patch (13K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: MSVC Build support with visual studio 2019

Juan José Santamaría Flecha
I have gone through path '0001-Support-building-with-visual-studio-2019.patch' only, but I am sure some comments will also apply to back branches.

1. The VisualStudioVersion value looks odd:

+ $self->{VisualStudioVersion}        = '16.0.32.32432';

Are you using a pre-release version [1]?

2. There is a typo: s/stuido/studio/:

+ # The major visual stuido that is suppored has nmake version >= 14.20 and < 15.

There is something in the current code that I think should be also updated. The code for _GetVisualStudioVersion contains:

  if ($major > 14)
  {
  carp
  "The determined version of Visual Studio is newer than the latest supported version. Returning the latest supported version instead.";
  return '14.00';
  }

Shouldn't the returned value be '14.20' for Visual Studio 2019?

Regards,

Juan José Santamaría Flecha

[1] https://docs.microsoft.com/en-us/visualstudio/releases/2019/history#release-dates-and-build-numbers
Reply | Threaded
Open this post in threaded view
|

Re: MSVC Build support with visual studio 2019

Haribabu Kommi-2

On Wed, May 22, 2019 at 7:36 AM Juanjo Santamaria Flecha <[hidden email]> wrote:
I have gone through path '0001-Support-building-with-visual-studio-2019.patch' only, but I am sure some comments will also apply to back branches.

Thanks for the review.

 
1. The VisualStudioVersion value looks odd:

+       $self->{VisualStudioVersion}        = '16.0.32.32432';

Are you using a pre-release version [1]?

I first developed this patch on the preview version.
I updated it to version 16.0.28729.10.
 
2. There is a typo: s/stuido/studio/:

+       # The major visual stuido that is suppored has nmake version >= 14.20 and < 15.

There is something in the current code that I think should be also updated. The code for _GetVisualStudioVersion contains:

  if ($major > 14)
        {
        carp
         "The determined version of Visual Studio is newer than the latest supported version. Returning the latest supported version instead.";
        return '14.00';
        }

Shouldn't the returned value be '14.20' for Visual Studio 2019?

Yes, that will be good to return Visual Studio 2019, updated.

Updated patches are attached for all branches.

Regards,
Haribabu Kommi
Fujitsu Australia

0001-Support-building-with-visual-studio-2019_HEAD.patch (13K) Download Attachment
0001-support-building-with-visual-studio-2019_v11.patch (13K) Download Attachment
0001-support-building-with-visual-studio-2019_v9.4.patch (13K) Download Attachment
0001-support-building-with-visual-studio-2019_v10_to_v9.5.patch (13K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: MSVC Build support with visual studio 2019

Juan José Santamaría Flecha

On Thu, May 23, 2019 at 3:44 AM Haribabu Kommi <[hidden email]> wrote:

Updated patches are attached for all branches.


I have gone through all patches and there are a couple of typos:

    1. s/prodcutname/productname/

    1.1 In file: 0001-support-building-with-visual-studio-2019_v9.4.patch
@@ -97,8 +97,9 @@
   <productname>Visual Studio 2013</productname>. Building with
   <productname>Visual Studio 2015</productname> is supported down to
   <productname>Windows Vista</> and <productname>Windows Server 2008</>.
-   Building with <productname>Visual Studio 2017</productname> is supported
-   down to <productname>Windows 7 SP1</> and <productname>Windows Server 2008 R2 SP1</>.
+   Building with <productname>Visual Studio 2017</productname> and
+   <prodcutname>Visual Studio 2019</prodcutname> are supported down to

    1.2 In file:   0001-support-building-with-visual-studio-2019_v10_to_v9.5.patch
@@ -97,8 +97,9 @@
   <productname>Visual Studio 2013</productname>. Building with
   <productname>Visual Studio 2015</productname> is supported down to
   <productname>Windows Vista</> and <productname>Windows Server 2008</>.
-   Building with <productname>Visual Studio 2017</productname> is supported
-   down to <productname>Windows 7 SP1</> and <productname>Windows Server 2008 R2 SP1</>.
+   Building with <productname>Visual Studio 2017</productname> and
+   <prodcutname>Visual Studio 2019</prodcutname> are supported down to

    2. s/stuido/studio/

     2.1 In file: 0001-support-building-with-visual-studio-2019_v9.4.patch
 @@ -143,12 +173,12 @@ sub DetermineVisualStudioVersion
 sub _GetVisualStudioVersion
 {
  my ($major, $minor) = @_;
- # visual 2017 hasn't changed the nmake version to 15, so still using the older version for comparison.
+ # The major visual stuido that is suppored has nmake version >= 14.20 and < 15.

     2.2 In file:  0001-support-building-with-visual-studio-2019_v10_to_v9.5.patch
@@ -132,12 +162,12 @@ sub DetermineVisualStudioVersion
 sub _GetVisualStudioVersion
 {
  my ($major, $minor) = @_;
- # visual 2017 hasn't changed the nmake version to 15, so still using the older version for comparison.
+ # The major visual stuido that is suppored has nmake version >= 14.20 and < 15.

     2.3 In file:  0001-support-building-with-visual-studio-2019_v11.patch
@@ -139,12 +165,12 @@ sub _GetVisualStudioVersion
 {
  my ($major, $minor) = @_;
 
- # visual 2017 hasn't changed the nmake version to 15, so still using the older version for comparison.
+ # The major visual stuido that is suppored has nmake version >= 14.20 and < 15.

     2.4 In file:  0001-Support-building-with-visual-studio-2019_HEAD.patch
@@ -106,17 +132,17 @@ sub _GetVisualStudioVersion
 {
  my ($major, $minor) = @_;
 
- # visual 2017 hasn't changed the nmake version to 15, so still using the older version for comparison.
+ # The major visual stuido that is suppored has nmake version >= 14.20 and < 15.


Other than that, since this is affects comments and docs, I have already tested that the patches build and pass tests on all the intended versions.

Regards,

Juan José Santamaría Flecha

 
Reply | Threaded
Open this post in threaded view
|

Re: MSVC Build support with visual studio 2019

Haribabu Kommi-2

On Mon, May 27, 2019 at 8:14 PM Juan José Santamaría Flecha <[hidden email]> wrote:

On Thu, May 23, 2019 at 3:44 AM Haribabu Kommi <[hidden email]> wrote:

Updated patches are attached for all branches.


I have gone through all patches and there are a couple of typos:

Thanks for the review.
 
    1. s/prodcutname/productname/

    1.1 In file: 0001-support-building-with-visual-studio-2019_v9.4.patch
@@ -97,8 +97,9 @@
   <productname>Visual Studio 2013</productname>. Building with
   <productname>Visual Studio 2015</productname> is supported down to
   <productname>Windows Vista</> and <productname>Windows Server 2008</>.
-   Building with <productname>Visual Studio 2017</productname> is supported
-   down to <productname>Windows 7 SP1</> and <productname>Windows Server 2008 R2 SP1</>.
+   Building with <productname>Visual Studio 2017</productname> and
+   <prodcutname>Visual Studio 2019</prodcutname> are supported down to

    1.2 In file:   0001-support-building-with-visual-studio-2019_v10_to_v9.5.patch
@@ -97,8 +97,9 @@
   <productname>Visual Studio 2013</productname>. Building with
   <productname>Visual Studio 2015</productname> is supported down to
   <productname>Windows Vista</> and <productname>Windows Server 2008</>.
-   Building with <productname>Visual Studio 2017</productname> is supported
-   down to <productname>Windows 7 SP1</> and <productname>Windows Server 2008 R2 SP1</>.
+   Building with <productname>Visual Studio 2017</productname> and
+   <prodcutname>Visual Studio 2019</prodcutname> are supported down to

Corrected.
 
    2. s/stuido/studio/

     2.1 In file: 0001-support-building-with-visual-studio-2019_v9.4.patch
 @@ -143,12 +173,12 @@ sub DetermineVisualStudioVersion
 sub _GetVisualStudioVersion
 {
  my ($major, $minor) = @_;
- # visual 2017 hasn't changed the nmake version to 15, so still using the older version for comparison.
+ # The major visual stuido that is suppored has nmake version >= 14.20 and < 15.

     2.2 In file:  0001-support-building-with-visual-studio-2019_v10_to_v9.5.patch
@@ -132,12 +162,12 @@ sub DetermineVisualStudioVersion
 sub _GetVisualStudioVersion
 {
  my ($major, $minor) = @_;
- # visual 2017 hasn't changed the nmake version to 15, so still using the older version for comparison.
+ # The major visual stuido that is suppored has nmake version >= 14.20 and < 15.

     2.3 In file:  0001-support-building-with-visual-studio-2019_v11.patch
@@ -139,12 +165,12 @@ sub _GetVisualStudioVersion
 {
  my ($major, $minor) = @_;
 
- # visual 2017 hasn't changed the nmake version to 15, so still using the older version for comparison.
+ # The major visual stuido that is suppored has nmake version >= 14.20 and < 15.

     2.4 In file:  0001-Support-building-with-visual-studio-2019_HEAD.patch
@@ -106,17 +132,17 @@ sub _GetVisualStudioVersion
 {
  my ($major, $minor) = @_;
 
- # visual 2017 hasn't changed the nmake version to 15, so still using the older version for comparison.
+ # The major visual stuido that is suppored has nmake version >= 14.20 and < 15.

Corrected. And also 'supported' spelling is also wrong.

Updated patches are attached.

Regards,
Haribabu Kommi
Fujitsu Australia

0001-support-building-with-visual-studio-2019_v11_v3.patch (13K) Download Attachment
0001-support-building-with-visual-studio-2019_v10_to_v9.6_v3.patch (13K) Download Attachment
0001-support-building-with-visual-studio-2019_v9.4_v3.patch (13K) Download Attachment
0001-Support-building-with-visual-studio-2019_HEAD_v3.patch (13K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: MSVC Build support with visual studio 2019

Juan José Santamaría Flecha

On Wed, May 29, 2019 at 10:30 AM Haribabu Kommi <[hidden email]> wrote:

Updated patches are attached.


All patches apply, build and pass tests. The patch '0001-support-building-with-visual-studio-2019_v10_to_v9.6_v3.patch' applies on version 9.5.

Not sure if more review is needed before moving to 'ready for commite'r, but I have no more comments to make on current patches.

Regards,

Juan José Santamaría Flecha
Reply | Threaded
Open this post in threaded view
|

Re: MSVC Build support with visual studio 2019

Haribabu Kommi-2

On Wed, 5 Jun 2019 at 17:22, Juan José Santamaría Flecha <[hidden email]> wrote:

On Wed, May 29, 2019 at 10:30 AM Haribabu Kommi <[hidden email]> wrote:

Updated patches are attached.


All patches apply, build and pass tests. The patch '0001-support-building-with-visual-studio-2019_v10_to_v9.6_v3.patch' applies on version 9.5.

Not sure if more review is needed before moving to 'ready for commite'r, but I have no more comments to make on current patches.

Thanks for the review. Yes, that patch applies till 9.5, it is my mistake in naming the patch.

Regards,
Haribabu Kommi