pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #17681: Building the REL_12_13 source in Visual Studio 2013 fails.
5+ messages / 3 participants
[nested] [flat]
Commits from this thread:
2022-11-10 cf0f465c0d 0942acb73e 576506303c 06dca17ad5 Re-allow building on Microsoft Visual Studio 2013.
* BUG #17681: Building the REL_12_13 source in Visual Studio 2013 fails.
@ 2022-11-09 06:08 PG Bug reporting form <noreply@postgresql.org>
2022-11-09 14:44 ` Re: BUG #17681: Building the REL_12_13 source in Visual Studio 2013 fails. Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 5+ messages in thread
From: PG Bug reporting form @ 2022-11-09 06:08 UTC (permalink / raw)
To: pgsql-bugs@lists.postgresql.org; +Cc: higuchi.daisuke@fujitsu.com
The following bug has been logged on the website:
Bug reference: 17681
Logged by: daisuke higuchi
Email address: higuchi.daisuke@fujitsu.com
PostgreSQL version: Unsupported/Unknown
Operating system: Windows 10
Description:
Hi,
I tried to build using the codes of REL_12_13 in the following environment,
but it failed.
In the same environment, building with code with REL_12_12 succeeds.
- Windows 10
- Visual Studio 2013
I know I'm using an older version of Visual Studio, but according to the
manual,
I believe it supports building with Visual Studio 2013, so I think this is
bug.
https://www.postgresql.org/docs/12/install-windows-full.html
-----------------------------------
17.1. Building with Visual C++ or the Microsoft Windows SDK
64-bit PostgreSQL builds are supported with Microsoft Windows SDK version
8.1a to 10 or Visual Studio 2013 and above.
-----------------------------------
The main messages when it fails are following:
-----------------------------------
"Z:\postgres\pgsql.sln" (default target) (1) ->
"Z:\postgres\postgres.vcxproj" (default target) (2) ->
(ClCompile target) ->
src/port/snprintf.c(1006): warning C4013: 'snprintf' undefined; assuming
extern returning int [Z:\postgres\postgres.vcxproj]
"Z:\postgres\pgsql.sln" (default target) (1) ->
"Z:\postgres\libpqwalreceiver.vcxproj" (default target) (4) ->
"Z:\postgres\libpq.vcxproj" (default target) (5) ->
"Z:\postgres\libpgport.vcxproj" (default target) (7) ->
src/port/snprintf.c(1006): warning C4013: 'snprintf' undefined; assuming
extern returning int [Z:\postgres\libpgport.vcxproj]
"Z:\postgres\pgsql.sln" (default target) (1) ->
"Z:\postgres\postgres.vcxproj" (default target) (2) ->
(Link target) ->
snprintf.obj : error LNK2019: unresolved external symbol snprintf
referenced in function pg_strfromd [Z:\postgres\postgres.vcxproj]
.\Release\postgres\postgres.exe : fatal error LNK1120: 1 unresolved
externals [Z:\postgres\postgres.vcxproj]
"Z:\postgres\pgsql.sln" (default target) (1) ->
"Z:\postgres\libpqwalreceiver.vcxproj" (default target) (4) ->
"Z:\postgres\libpq.vcxproj" (default target) (5) ->
libpgport.lib(snprintf.obj) : error LNK2019: unresolved external symbol
snprintf referenced in function pg_strfromd [Z:\postgres\libpq.vcxproj]
.\Release\libpq\libpq.dll : fatal error LNK1120: 1 unresolved externals
[Z:\postgres\libpq.vcxproj]
-----------------------------------
I think the cause of this error is the following commit regarding
snprintf.
As a test, I reverted this commit and built again, and the build
succeeded.
d33ac1ec2af5297b2ac8fbf89464f0c7f90a7955
Regards,
Higuchi
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: BUG #17681: Building the REL_12_13 source in Visual Studio 2013 fails.
2022-11-09 06:08 BUG #17681: Building the REL_12_13 source in Visual Studio 2013 fails. PG Bug reporting form <noreply@postgresql.org>
@ 2022-11-09 14:44 ` Tom Lane <tgl@sss.pgh.pa.us>
2022-11-09 15:37 ` Re: BUG #17681: Building the REL_12_13 source in Visual Studio 2013 fails. Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 5+ messages in thread
From: Tom Lane @ 2022-11-09 14:44 UTC (permalink / raw)
To: higuchi.daisuke@fujitsu.com; +Cc: pgsql-bugs@lists.postgresql.org
PG Bug reporting form <noreply@postgresql.org> writes:
> I tried to build using the codes of REL_12_13 in the following environment,
> but it failed.
> The main messages when it fails are following:
> -----------------------------------
> "Z:\postgres\postgres.vcxproj" (default target) (2) ->
> (Link target) ->
> snprintf.obj : error LNK2019: unresolved external symbol snprintf
> referenced in function pg_strfromd [Z:\postgres\postgres.vcxproj]
Ugh.
> I think the cause of this error is the following commit regarding
> snprintf.
> As a test, I reverted this commit and built again, and the build
> succeeded.
> d33ac1ec2af5297b2ac8fbf89464f0c7f90a7955
Thanks for checking that. However, as that commit message says,
we require C99 support in v12 and up, and snprintf is definitely
required by C99. So I'm disinclined to revert that. If VS2013
can't supply snprintf, it's not meeting our minimum platform
standards, so we should remove it from the list of supported
platforms.
Having said that, Microsoft had had well over a dozen years by
that point to get off their duffs and build a C99-compliant
library. So I have to suspect that there is a snprintf lurking
somewhere --- maybe there is some build option you need to
enable to get it?
regards, tom lane
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: BUG #17681: Building the REL_12_13 source in Visual Studio 2013 fails.
2022-11-09 06:08 BUG #17681: Building the REL_12_13 source in Visual Studio 2013 fails. PG Bug reporting form <noreply@postgresql.org>
2022-11-09 14:44 ` Re: BUG #17681: Building the REL_12_13 source in Visual Studio 2013 fails. Tom Lane <tgl@sss.pgh.pa.us>
@ 2022-11-09 15:37 ` Tom Lane <tgl@sss.pgh.pa.us>
2022-11-10 01:27 ` RE: BUG #17681: Building the REL_12_13 source in Visual Studio 2013 fails. Daisuke Higuchi (Fujitsu) <higuchi.daisuke@fujitsu.com>
0 siblings, 1 reply; 5+ messages in thread
From: Tom Lane @ 2022-11-09 15:37 UTC (permalink / raw)
To: higuchi.daisuke@fujitsu.com; +Cc: pgsql-bugs@lists.postgresql.org
I wrote:
> Thanks for checking that. However, as that commit message says,
> we require C99 support in v12 and up, and snprintf is definitely
> required by C99. So I'm disinclined to revert that. If VS2013
> can't supply snprintf, it's not meeting our minimum platform
> standards, so we should remove it from the list of supported
> platforms.
> Having said that, Microsoft had had well over a dozen years by
> that point to get off their duffs and build a C99-compliant
> library.
After googling the question, I find that indeed Microsoft couldn't
be bothered to support snprintf until VS2015. Bozos. Still,
I suppose it'd be better to not move this portability goalpost
in released branches. We could do something like
#if defined(_MSC_VER) && _MSC_VER < 1900 /* pre-VS2015 */
#define snprintf(str,size,...) sprintf(str,__VA_ARGS__)
#endif
in snprintf.c below where it #undef's snprintf. Could you
try that and verify it works for you?
Also, the reason we didn't notice this problem is the lack of any
VS2013 animal in the buildfarm. While we've dropped support for
that as of HEAD (v16), it seems like somebody had better run such
an animal on the back branches if they want the platform to
keep working.
regards, tom lane
^ permalink raw reply [nested|flat] 5+ messages in thread
* RE: BUG #17681: Building the REL_12_13 source in Visual Studio 2013 fails.
2022-11-09 06:08 BUG #17681: Building the REL_12_13 source in Visual Studio 2013 fails. PG Bug reporting form <noreply@postgresql.org>
2022-11-09 14:44 ` Re: BUG #17681: Building the REL_12_13 source in Visual Studio 2013 fails. Tom Lane <tgl@sss.pgh.pa.us>
2022-11-09 15:37 ` Re: BUG #17681: Building the REL_12_13 source in Visual Studio 2013 fails. Tom Lane <tgl@sss.pgh.pa.us>
@ 2022-11-10 01:27 ` Daisuke Higuchi (Fujitsu) <higuchi.daisuke@fujitsu.com>
2022-11-10 15:24 ` Re: BUG #17681: Building the REL_12_13 source in Visual Studio 2013 fails. Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 5+ messages in thread
From: Daisuke Higuchi (Fujitsu) @ 2022-11-10 01:27 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
>#if defined(_MSC_VER) && _MSC_VER < 1900 /* pre-VS2015 */
>#define snprintf(str,size,...) sprintf(str,__VA_ARGS__)
>#endif
>
>in snprintf.c below where it #undef's snprintf. Could you try that and verify it works for you?
Thank you! I verified this fix works correctly.
I confirmed that it succeeded to build the source of REL_12_13 + this fix in Visual Studio 2013.
Regards,
Higuchi
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: BUG #17681: Building the REL_12_13 source in Visual Studio 2013 fails.
2022-11-09 06:08 BUG #17681: Building the REL_12_13 source in Visual Studio 2013 fails. PG Bug reporting form <noreply@postgresql.org>
2022-11-09 14:44 ` Re: BUG #17681: Building the REL_12_13 source in Visual Studio 2013 fails. Tom Lane <tgl@sss.pgh.pa.us>
2022-11-09 15:37 ` Re: BUG #17681: Building the REL_12_13 source in Visual Studio 2013 fails. Tom Lane <tgl@sss.pgh.pa.us>
2022-11-10 01:27 ` RE: BUG #17681: Building the REL_12_13 source in Visual Studio 2013 fails. Daisuke Higuchi (Fujitsu) <higuchi.daisuke@fujitsu.com>
@ 2022-11-10 15:24 ` Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 5+ messages in thread
From: Tom Lane @ 2022-11-10 15:24 UTC (permalink / raw)
To: Daisuke Higuchi (Fujitsu) <higuchi.daisuke@fujitsu.com>; +Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
"Daisuke Higuchi (Fujitsu)" <higuchi.daisuke@fujitsu.com> writes:
>> #if defined(_MSC_VER) && _MSC_VER < 1900 /* pre-VS2015 */
>> #define snprintf(str,size,...) sprintf(str,__VA_ARGS__)
>> #endif
>> in snprintf.c below where it #undef's snprintf. Could you try that and verify it works for you?
> Thank you! I verified this fix works correctly.
> I confirmed that it succeeded to build the source of REL_12_13 + this fix in Visual Studio 2013.
Excellent. Fix pushed.
regards, tom lane
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2022-11-10 15:24 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-11-09 06:08 BUG #17681: Building the REL_12_13 source in Visual Studio 2013 fails. PG Bug reporting form <noreply@postgresql.org>
2022-11-09 14:44 ` Tom Lane <tgl@sss.pgh.pa.us>
2022-11-09 15:37 ` Tom Lane <tgl@sss.pgh.pa.us>
2022-11-10 01:27 ` Daisuke Higuchi (Fujitsu) <higuchi.daisuke@fujitsu.com>
2022-11-10 15:24 ` Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox