msvc directory missing in PostgreSQL 17.0

Started by Mark Hillover 1 year ago15 messageshackers
Jump to latest
#1Mark Hill
Mark.Hill@sas.com

I just downloaded the Postgresql 17.0 and the extracted directory postgresql-17.0/src/tools does not contain
the "msvc" directory as it has since I've been building Postgres 12, 14, and 16. How am I supposed to build
PostgreSQL for Windows now? I'm not sure what msvc_gendef.pl does. How do we build Postgres for Windows
using Visual Studio?

Thanks, Mark

#2Bill Smith
bill.smith@enterprisedb.com
In reply to: Mark Hill (#1)
Re: msvc directory missing in PostgreSQL 17.0

On Oct 18, 2024, at 4:05 PM, Mark Hill <Mark.Hill@sas.com> wrote:

I just downloaded the Postgresql 17.0 and the extracted directory postgresql-17.0/src/tools does not contain
the “msvc” directory as it has since I’ve been building Postgres 12, 14, and 16. How am I supposed to build
PostgreSQL for Windows now? I’m not sure what msvc_gendef.pl does. How do we build Postgres for Windows
using Visual Studio?

You’ll want to use meson to build PG. See the docs here:
https://www.postgresql.org/docs/current/installation-platform-notes.html#INSTALLATION-NOTES-VISUAL-STUDIO
17.7. Platform-Specific Notes
postgresql.org

Show quoted text

Thanks, Mark

Attachments:

elephant.pngimage/png; name=elephant.png; x-unix-mode=0666Download
#3Mark Hill
Mark.Hill@sas.com
In reply to: Bill Smith (#2)
RE: msvc directory missing in PostgreSQL 17.0

Thanks Bill! Do you have a sample meson command for building that you could share?

Thanks, Mark

From: Bill Smith <bill.smith@enterprisedb.com>
Sent: Friday, October 18, 2024 4:11 PM
To: Mark Hill <Mark.Hill@sas.com>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: msvc directory missing in PostgreSQL 17.0

EXTERNAL

On Oct 18, 2024, at 4:05 PM, Mark Hill <Mark.Hill@sas.com<mailto:Mark.Hill@sas.com>> wrote:

I just downloaded the Postgresql 17.0 and the extracted directory postgresql-17.0/src/tools does not contain
the “msvc” directory as it has since I’ve been building Postgres 12, 14, and 16. How am I supposed to build
PostgreSQL for Windows now? I’m not sure what msvc_gendef.pl does. How do we build Postgres for Windows
using Visual Studio?

You’ll want to use meson to build PG. See the docs here:
[cid:image001.png@01DB23D4.03B42C60]
17.7. Platform-Specific Notes<https://protect.checkpoint.com/v2/r01/___https://www.postgresql.org/docs/current/installation-platform-notes.html%23INSTALLATION-NOTES-VISUAL-STUDIO___.YzJ1OnNhc2luc3RpdHV0ZTpjOm86OWJiYTkyOGQ4NDg2ZWRhYjhlMjJkNGUzOGNmNjgxYjc6NzowNDYzOmRlNGQ2ZGI4MWYwNTVhNDUzM2Q4ZTc2NWYwZGJlMzQyMGI1YjE3ZDc4MWJjOTY2YTE0ZjAwMTg1ZDE0NjYxOWM6aDpUOk4&gt;
postgresql.org<https://protect.checkpoint.com/v2/r01/___https://www.postgresql.org/docs/current/installation-platform-notes.html%23INSTALLATION-NOTES-VISUAL-STUDIO___.YzJ1OnNhc2luc3RpdHV0ZTpjOm86OWJiYTkyOGQ4NDg2ZWRhYjhlMjJkNGUzOGNmNjgxYjc6Nzo3ZjViOmI0YTgyMGRhMTA2MGY4NDE0OTcyOGQxMWU0MDA4MmE1ZWMzMjg1YjM4YTY2ZjBhZTQwMmZjOGYzNTE1MzNjYzU6aDpUOk4&gt;

Thanks, Mark

Attachments:

image001.pngimage/png; name=image001.pngDownload
#4Bill Smith
bill.smith@enterprisedb.com
In reply to: Mark Hill (#3)
Re: msvc directory missing in PostgreSQL 17.0

Check out this:
https://wiki.postgresql.org/wiki/Meson

There's a table showing the setup & build commands using the old way and the new way (meson).

Show quoted text

On Oct 21, 2024, at 4:12 PM, Mark Hill <Mark.Hill@sas.com> wrote:

Thanks Bill! Do you have a sample meson command for building that you could share?

Thanks, Mark

From: Bill Smith <bill.smith@enterprisedb.com <mailto:bill.smith@enterprisedb.com>>
Sent: Friday, October 18, 2024 4:11 PM
To: Mark Hill <Mark.Hill@sas.com <mailto:Mark.Hill@sas.com>>
Cc: pgsql-hackers@lists.postgresql.org <mailto:pgsql-hackers@lists.postgresql.org>
Subject: Re: msvc directory missing in PostgreSQL 17.0

EXTERNAL

On Oct 18, 2024, at 4:05 PM, Mark Hill <Mark.Hill@sas.com <mailto:Mark.Hill@sas.com>> wrote:

I just downloaded the Postgresql 17.0 and the extracted directory postgresql-17.0/src/tools does not contain
the “msvc” directory as it has since I’ve been building Postgres 12, 14, and 16. How am I supposed to build
PostgreSQL for Windows now? I’m not sure what msvc_gendef.pl does. How do we build Postgres for Windows
using Visual Studio?

You’ll want to use meson to build PG. See the docs here:
<image001.png>
17.7. Platform-Specific Notes <https://protect.checkpoint.com/v2/r01/___https://www.postgresql.org/docs/current/installation-platform-notes.html%23INSTALLATION-NOTES-VISUAL-STUDIO___.YzJ1OnNhc2luc3RpdHV0ZTpjOm86OWJiYTkyOGQ4NDg2ZWRhYjhlMjJkNGUzOGNmNjgxYjc6NzowNDYzOmRlNGQ2ZGI4MWYwNTVhNDUzM2Q4ZTc2NWYwZGJlMzQyMGI1YjE3ZDc4MWJjOTY2YTE0ZjAwMTg1ZDE0NjYxOWM6aDpUOk4&gt;
postgresql.org <https://protect.checkpoint.com/v2/r01/___https://www.postgresql.org/docs/current/installation-platform-notes.html%23INSTALLATION-NOTES-VISUAL-STUDIO___.YzJ1OnNhc2luc3RpdHV0ZTpjOm86OWJiYTkyOGQ4NDg2ZWRhYjhlMjJkNGUzOGNmNjgxYjc6Nzo3ZjViOmI0YTgyMGRhMTA2MGY4NDE0OTcyOGQxMWU0MDA4MmE1ZWMzMjg1YjM4YTY2ZjBhZTQwMmZjOGYzNTE1MzNjYzU6aDpUOk4&gt;

Thanks, Mark

#5黄铎彦
222200428@fzu.edu.cn
In reply to: Bill Smith (#4)
Re: msvc directory missing in PostgreSQL 17.0

I could hardly find detailed and complete tutorials on building the latest version with Visual Studio. I did use meson to generate sln and vcxproj files in Command Prompt (attatchment: 00meson_cmd_to_gen_sln.txt). But after opening the sln and run menu command "build -> build solution", it failed. The contents of the Output Window in Visual Studio are in the attatchment 01build_log.txt.

On 2024/10/27 15:07, Bill Smith wrote:

Check out this:

There's a table showing the setup & build commands using the old way and the new way (meson).

On Oct 21, 2024, at 4:12 PM, Mark Hill <Mark.Hill@sas.com> wrote:

Thanks Bill! Do you have a sample meson command for building that you could share?

Thanks, Mark

From: Bill Smith <bill.smith@enterprisedb.com>
Sent: Friday, October 18, 2024 4:11 PM
To: Mark Hill <Mark.Hill@sas.com>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: msvc directory missing in PostgreSQL 17.0

EXTERNAL

On Oct 18, 2024, at 4:05 PM, Mark Hill <Mark.Hill@sas.com> wrote:

I just downloaded the Postgresql 17.0 and the extracted directory postgresql-17.0/src/tools does not contain

the “msvc” directory as it has since I’ve been building Postgres 12, 14, and 16. How am I supposed to build
PostgreSQL for Windows now? I’m not sure what msvc_gendef.pl does. How do we build Postgres for Windows
using Visual Studio?

You’ll want to use meson to build PG. See the docs here:
|
<image001.png>
|
|
|
17.7. Platform-Specific Notes
postgresql.org
|
|

Thanks, Mark

#6黄铎彦
222200428@fzu.edu.cn
In reply to: 黄铎彦 (#5)
Re: msvc directory missing in PostgreSQL 17.0

Here’re attatchments.

发件人: 黄铎彦
发送时间: 2024年10月27日 15:44
收件人: Bill Smith; Mark.Hill
抄送: pgsql-hackers
主题: Re: msvc directory missing in PostgreSQL 17.0

I could hardly find detailed and complete tutorials on building the latest version with Visual Studio. I did use meson to generate sln and vcxproj files in Command Prompt (attatchment: 00meson_cmd_to_gen_sln.txt). But after opening the sln and run menu command "build -> build solution", it failed. The contents of the Output Window in Visual Studio are in the attatchment 01build_log.txt.
On 2024/10/27 15:07, Bill Smith wrote:
Check out this:

There's a table showing the setup & build commands using the old way and the new way (meson).

On Oct 21, 2024, at 4:12 PM, Mark Hill <Mark.Hill@sas.com> wrote:

Thanks Bill!   Do you have a sample meson command for building that you could share?

Thanks, Mark
 
From: Bill Smith <bill.smith@enterprisedb.com>
Sent: Friday, October 18, 2024 4:11 PM
To: Mark Hill <Mark.Hill@sas.com>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: msvc directory missing in PostgreSQL 17.0
 
EXTERNAL
 

On Oct 18, 2024, at 4:05 PM, Mark Hill <Mark.Hill@sas.com> wrote:
 
I just downloaded the Postgresql 17.0 and the extracted directory postgresql-17.0/src/tools does not contain
the “msvc” directory as it has since I’ve been building Postgres 12, 14, and 16.   How am I supposed to build
PostgreSQL for Windows now?   I’m not sure what msvc_gendef.pl does.   How do we build Postgres for Windows
using Visual Studio?
 
You’ll want to use meson to build PG.  See the docs here:
<image001.png>
17.7. Platform-Specific Notes
postgresql.org

Thanks, Mark

Attachments:

01build_log.txttext/plain; name=01build_log.txtDownload
#7黄铎彦
222200428@fzu.edu.cn
In reply to: 黄铎彦 (#6)
Re: msvc directory missing in PostgreSQL 17.0

I could hardly find detailed and complete tutorials on building the latest version with Visual Studio. I did use meson to generate sln and vcxproj files in Command Prompt (attatchment: 00meson_cmd_to_gen_sln.txt). But after opening the sln and run menu command "build -> build solution", it failed. The contents of the Output Window in Visual Studio are in the attatchment 01build_log.txt.

-----原始邮件-----
发件人: "Bill Smith" <bill.smith@enterprisedb.com>
发送时间: 2024-10-27 15:07:39
收件人: "Mark Hill" <Mark.Hill@sas.com>
抄送: "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>
主题: Re: msvc directory missing in PostgreSQL 17.0

Check out this:
|
|
Meson
wiki.postgresql.org
| |
|

There's a table showing the setup & build commands using the old way and the new way (meson).

On Oct 21, 2024, at 4:12 PM, Mark Hill <Mark.Hill@sas.com> wrote:

Thanks Bill! Do you have a sample meson command for building that you could share?

Thanks, Mark

From: Bill Smith <bill.smith@enterprisedb.com>
Sent: Friday, October 18, 2024 4:11 PM
To: Mark Hill <Mark.Hill@sas.com>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: msvc directory missing in PostgreSQL 17.0

EXTERNAL

On Oct 18, 2024, at 4:05 PM, Mark Hill <Mark.Hill@sas.com> wrote:

I just downloaded the Postgresql 17.0 and the extracted directory postgresql-17.0/src/tools does not contain

the “msvc” directory as it has since I’ve been building Postgres 12, 14, and 16. How am I supposed to build
PostgreSQL for Windows now? I’m not sure what msvc_gendef.pl does. How do we build Postgres for Windows
using Visual Studio?

You’ll want to use meson to build PG. See the docs here:
|
<image001.png>
|
|
|
17.7. Platform-Specific Notes
postgresql.org
|
|

Thanks, Mark

Attachments:

00meson_cmd_to_gen_sln.txttext/plain; name=00meson_cmd_to_gen_sln.txt; x-cm-attr="attId:_CMClient@671df213.1.67rv02qh30i77rv0"Download
01build_log.txttext/plain; name=01build_log.txt; x-cm-attr="attId:_CMClient@671df213.2.97rv02qh30ia8rv0"Download
#8黄铎彦
222200428@fzu.edu.cn
In reply to: 黄铎彦 (#7)
Re: msvc directory missing in PostgreSQL 17.0

I could hardly find detailed and complete tutorials on building the latest version with Visual Studio. I did use meson to generate sln and vcxproj files in Command Prompt (attatchment: 00meson_cmd_to_gen_sln.txt). But after opening the sln and run menu command "build -> build solution", it failed. The contents of the Output Window in Visual Studio are in the attatchment 01build_log.txt.

-----原始邮件-----
From: "Bill Smith" <bill.smith@enterprisedb.com>
Sent: 2024-10-27 15:07:39
To: "Mark Hill" <Mark.Hill@sas.com>
Cc: "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>
Subject: Re: msvc directory missing in PostgreSQL 17.0

Check out this:
|
|
Meson
wiki.postgresql.org
| |
|

There's a table showing the setup & build commands using the old way and the new way (meson).

On Oct 21, 2024, at 4:12 PM, Mark Hill <Mark.Hill@sas.com> wrote:

Thanks Bill! Do you have a sample meson command for building that you could share?

Thanks, Mark

From: Bill Smith <bill.smith@enterprisedb.com>
Sent: Friday, October 18, 2024 4:11 PM
To: Mark Hill <Mark.Hill@sas.com>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: msvc directory missing in PostgreSQL 17.0

EXTERNAL

On Oct 18, 2024, at 4:05 PM, Mark Hill <Mark.Hill@sas.com> wrote:

I just downloaded the Postgresql 17.0 and the extracted directory postgresql-17.0/src/tools does not contain

the “msvc” directory as it has since I’ve been building Postgres 12, 14, and 16. How am I supposed to build
PostgreSQL for Windows now? I’m not sure what msvc_gendef.pl does. How do we build Postgres for Windows
using Visual Studio?

You’ll want to use meson to build PG. See the docs here:
|
<image001.png>
|
|
|
17.7. Platform-Specific Notes
postgresql.org
|
|

Thanks, Mark

Attachments:

00meson_cmd_to_gen_sln.txttext/plain; name=00meson_cmd_to_gen_sln.txt; x-cm-attr="attId:_CMClient@671df6eb.1.F4KHhRPj30iG4KHh"Download
01build_log.txttext/plain; name=01build_log.txt; x-cm-attr="attId:_CMClient@671df6eb.2.I4KHhRPj30iJ4KHh"Download
#9Dave Page
dpage@pgadmin.org
In reply to: 黄铎彦 (#8)
Re: msvc directory missing in PostgreSQL 17.0

On Sun, 27 Oct 2024 at 10:17, 黄铎彦 <222200428@fzu.edu.cn> wrote:

I could hardly find detailed and complete tutorials on building the latest
version with Visual Studio.

You can see how it’s done if you take a look at the actions in
https://github.com/dpage/winpgbuild. The postgresql-dev one is probably the
best example, as it only runs a single meson build, whilst the postgresql
action is a matrix build that has to handle both the old style msvc and
meson, and thus is much harder to read.

The repo also shows how to build (nearly) all the dependencies in a meson
compatible way, or you can just download the build artefacts if you don’t
want to do that yourself (see the bundle-deps action). You may not see the
artefacts if you’re not logged in to Github.

I did use meson to generate sln and vcxproj files in Command Prompt

Show quoted text

(attatchment: 00meson_cmd_to_gen_sln.txt). But after opening the sln and
run menu command "build -> build solution", it failed. The contents of the
Output Window in Visual Studio are in the attatchment 01build_log.txt.

-----原始邮件-----
*From: *"Bill Smith" <bill.smith@enterprisedb.com>
*Sent: *2024-10-27 15:07:39
*To: *"Mark Hill" <Mark.Hill@sas.com>
*Cc: *"pgsql-hackers@lists.postgresql.org" <
pgsql-hackers@lists.postgresql.org>

*Subject: *Re: msvc directory missing in PostgreSQL 17.0

Check out this:
Meson <https://wiki.postgresql.org/wiki/Meson&gt;
wiki.postgresql.org <https://wiki.postgresql.org/wiki/Meson&gt;
<https://wiki.postgresql.org/wiki/Meson&gt;
<https://wiki.postgresql.org/wiki/Meson&gt;

There's a table showing the setup & build commands using the old way and
the new way (meson).

On Oct 21, 2024, at 4:12 PM, Mark Hill <Mark.Hill@sas.com> wrote:

Thanks Bill! Do you have a sample meson command for building that you
could share?

Thanks, Mark

*From:* Bill Smith <bill.smith@enterprisedb.com>
*Sent:* Friday, October 18, 2024 4:11 PM
*To:* Mark Hill <Mark.Hill@sas.com>
*Cc:* pgsql-hackers@lists.postgresql.org
*Subject:* Re: msvc directory missing in PostgreSQL 17.0

*EXTERNAL*

On Oct 18, 2024, at 4:05 PM, Mark Hill <Mark.Hill@sas.com> wrote:

I just downloaded the Postgresql 17.0 and the extracted directory
postgresql-17.0/src/tools does not contain

the “msvc” directory as it has since I’ve been building Postgres 12, 14,
and 16. How am I supposed to build
PostgreSQL for Windows now? I’m not sure what msvc_gendef.pl does.
How do we build Postgres for Windows
using Visual Studio?

You’ll want to use meson to build PG. See the docs here:
<image001.png>
17.7. Platform-Specific Notes
<https://protect.checkpoint.com/v2/r01/___https://www.postgresql.org/docs/current/installation-platform-notes.html%23INSTALLATION-NOTES-VISUAL-STUDIO___.YzJ1OnNhc2luc3RpdHV0ZTpjOm86OWJiYTkyOGQ4NDg2ZWRhYjhlMjJkNGUzOGNmNjgxYjc6NzowNDYzOmRlNGQ2ZGI4MWYwNTVhNDUzM2Q4ZTc2NWYwZGJlMzQyMGI1YjE3ZDc4MWJjOTY2YTE0ZjAwMTg1ZDE0NjYxOWM6aDpUOk4&gt;
postgresql.org
<https://protect.checkpoint.com/v2/r01/___https://www.postgresql.org/docs/current/installation-platform-notes.html%23INSTALLATION-NOTES-VISUAL-STUDIO___.YzJ1OnNhc2luc3RpdHV0ZTpjOm86OWJiYTkyOGQ4NDg2ZWRhYjhlMjJkNGUzOGNmNjgxYjc6Nzo3ZjViOmI0YTgyMGRhMTA2MGY4NDE0OTcyOGQxMWU0MDA4MmE1ZWMzMjg1YjM4YTY2ZjBhZTQwMmZjOGYzNTE1MzNjYzU6aDpUOk4&gt;

Thanks, Mark

#10黄铎彦
huangdy2022@qq.com
In reply to: 黄铎彦 (#8)
Re: Re: msvc directory missing in PostgreSQL 17.0

On Sun, 27 Oct 2024 at 16:38 GMT+8, Dave Page <dpage@pgadmin.org> wrote:

You can see how it’s done if you take a look at the actions in

https://github.com/dpage/winpgbuild. The postgresql-dev one is probably the

best example, as it only runs a single meson build, whilst the postgresql

action is a matrix build that has to handle both the old style msvc and

meson, and thus is much harder to read.

The repo also shows how to build (nearly) all the dependencies in a meson

compatible way, or you can just download the build artefacts if you don’t

want to do that yourself (see the bundle-deps action). You may not see the

artefacts if you’re not logged in to Github.

That repo seems to be something like Github action. But I would like to generate sln and vcxproj files in my Windows PC, then open Visual Studio, compile and navigate.

(Just now I changed my email address)

#11黄铎彦
huangdy2022@qq.com
In reply to: 黄铎彦 (#8)
Re: msvc directory missing in PostgreSQL 17.0

On Sun, 27 Oct 2024 at 17:38 GMT+8, 黄铎彦 <huangdy2022@qq.com> wrote:

That repo seems to be something like Github action. But I would like to generate sln and vcxproj files in my Windows PC, then open Visual Studio, compile and navigate.

I used `meson setup --backend vs` but got compile error with the sln file.

#12Andres Freund
andres@anarazel.de
In reply to: 黄铎彦 (#11)
Re: msvc directory missing in PostgreSQL 17.0

Hi,

On October 27, 2024 5:50:51 AM EDT, "huangdy2022@qq.com" <huangdy2022@qq.com> wrote:

On Sun, 27 Oct 2024 at 17:38 GMT+8, 黄铎彦 <huangdy2022@qq.com> wrote:

That repo seems to be something like Github action. But I would like to generate sln and vcxproj files in my Windows PC, then open Visual Studio, compile and navigate.

I used `meson setup --backend vs` but got compile error with the sln file.

Without knowing the error it's hard for us to help...

Andres
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.

#13黄铎彦
huangdy2022@qq.com
In reply to: 黄铎彦 (#8)
Re: msvc directory missing in PostgreSQL 17.0

On Oct 28, 2024 1:58 GMT+8, Andres Freund <andres@anarazel.de> wrote:

Without knowing the error it's hard for us to help...

The build log is attatched. Note current environment on my Windows PC can build pg 16.3 successfully, as I referenced https://www.postgresql.org/docs/16/install-windows-full.html.
I didn't make any change to my dependencies. I use Windows 10 Home and Visual Studio 2019.

Attachments:

01build_log.txtapplication/octet-stream; name=01build_log.txtDownload
00meson_cmd_to_gen_sln.txtapplication/octet-stream; name=00meson_cmd_to_gen_sln.txtDownload
#14Umar Hayat
postgresql.wizard@gmail.com
In reply to: 黄铎彦 (#13)
Re: msvc directory missing in PostgreSQL 17.0

Hi,
In my opinion the issue could be Active-state perl ( as I see in your
log file, activestate perl path). In this thread [0]/messages/by-id/CADK3HHLQ1MNmfXqEvQi36D_MQrheOZPcXv2H3s6otMbSmfwjzg@mail.gmail.com people faced
same problem and solved it using strawberry perl.

Regards
Umar Hayat

[0]: /messages/by-id/CADK3HHLQ1MNmfXqEvQi36D_MQrheOZPcXv2H3s6otMbSmfwjzg@mail.gmail.com

Show quoted text

On Mon, 28 Oct 2024 at 10:31, 黄铎彦 <huangdy2022@qq.com> wrote:

On Oct 28, 2024 1:58 GMT+8, Andres Freund <andres@anarazel.de> wrote:

Without knowing the error it's hard for us to help...

The build log is attatched. Note current environment on my Windows PC can build pg 16.3 successfully, as I referenced https://www.postgresql.org/docs/16/install-windows-full.html.
I didn't make any change to my dependencies. I use Windows 10 Home and Visual Studio 2019.

#15黄铎彦
huangdy2022@qq.com
In reply to: 黄铎彦 (#8)
Re: msvc directory missing in PostgreSQL 17.0

On 2024-10-28 09:42 GMT+8 Umar Hayat <postgresql.wizard@gmail.com> wrote:

[0] /messages/by-id/CADK3HHLQ1MNmfXqEvQi36D_MQrheOZPcXv2H3s6otMbSmfwjzg@mail.gmail.com

It worked! Thank you Umar! My poor searching ability QwQ.
But may be a small bug about the order of generation. After I first executed "build -> build solution", I got an error message "libpq.pdb not found". Then I executed for a second time and it returned complete success.