VS2022: Support Visual Studio 2022 on Windows
Hans Buschmann <buschmann@nidsa.net>
From: Hans Buschmann <buschmann@nidsa.net>
To: "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2021-10-01T15:15:59Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Add support for Visual Studio 2022 in build scripts
- 82881a9b9d0f 10.20 landed
- 1061e41ff9ae 11.15 landed
- 420d5e40b3a3 12.10 landed
- baef657d3c84 13.6 landed
- 0e681fa45875 14.2 landed
- b2265d305d81 15.0 landed
Attachments
- 0001_support_vs2022.patch (application/octet-stream) patch
During testing of the new Visual Studio 2022 Preview Version 4.1 from Microsoft I also tried PG14.0 on it.
The x64 version built without error!.
Even when this is only a preview version (the real thing is to expected soon) it seems appropriate to include the support to Postgres msvc tools directory.
I followed the guideline of the patch msvc-2019-support-v4.patch for VS2019 support. New patch attached.
The only thing that will change later in the first non-preview release is the exact version number, which seems to change allways on every minor VS upgrade and is not used explicitely:
$self->{VisualStudioVersion} = '17.0.31717.71';
The patch is not invasive, so it should follow the practice of backpatching it to (most) supported versions.
I have tested the x64 compile and install with the release source code of PG14.0 from 2021-09-30.
Due to bad development environment I did not a full run of all tests afterwords.
Visual Studio is co-installable to an already existing VS version on the same machine (I had VS2019 installed) and is separately choosable as compile environment.
Compilation time and file sizes are almost identical, but the GUI promises a native 64bit implementation, so it may appealing to use the new version.
HELP NEEDED:
Please could somebody test the patch and enter it to the next commit fest?
(Only my second patch, not much experience with the tool chain :-( )
Another point is the failure of using VS2019/VS2022 for building the 32bit version, but this has to be discussed in another thread (if the Windows 32bit Version is still important to support on newer VS Versions)
Thanks for looking at it
Hans Buschmann