Re: Exporting float_to_shortest_decimal_buf(n) with Postgres 17 on Windows

From: Vladlen Popolitov <v(dot)popolitov(at)postgrespro(dot)ru>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Andrew Kane <andrew(at)ankane(dot)org>, Nathan Bossart <nathandbossart(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Exporting float_to_shortest_decimal_buf(n) with Postgres 17 on Windows
Date: 2024-12-23 10:32:04
Message-ID: 1e2ba5ae7380fdb947e5bfcb6200063e@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Michael Paquier писал(а) 2024-09-14 03:15:
> On Fri, Sep 13, 2024 at 03:26:42PM -0700, Andrew Kane wrote:
>> This was my hunch as well since none of the source files changed.
>> Also,
>> neither function is present with `dumpbin /EXPORTS /SYMBOLS
>> lib\postgres.lib`, which led me to believe it may need to be addressed
>> upstream.
>
> Hmm. Perhaps we are not careful enough with the calls of
> msvc_gendef.pl in meson.build, missing some spots?
> --
> Michael

Dear colleagues

I found the reason of this bug and the fix for it.

dumpbin processes libraries to prepare DEF file. libcommon_srv.a does
not have
all necessary object files in the moment of processing due to meson
optimisation:
this library marked as install=false, and all objects depend on
it also marked as install=false.
meson is smart enough to exclude obj-files, that are not required on
later stages.

The option to set install=true is not good: all files are built
correctly,
but not needed library will be installed.

Fortunatelly meson has option to force put all object files to library -
add
dependency with the flag link_whole .

I made the one-line patch and it fixes this issue.

- 'dependencies': opts['dependencies'] + [ssl],
+ 'dependencies': opts['dependencies'] + [ssl] +
[declare_dependency( link_whole : cflag_libs)],

P.S. Other libraries in this meson.build file (libcommon.a and
libcommon_shlib.a)
are not affected by this issue and patch, as they both marked
install=true and build
without any missed files.

--
Best regards,

Vladlen Popolitov.

Attachment Content-Type Size
v1-0001-Fix-meson.build-to-prevent-missed-obj-files-in-li.patch text/x-diff 874 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message 2024-12-23 10:36:38 Re: Re: transaction lost when delete clog file after normal shutdown
Previous Message Andrey Borodin 2024-12-23 10:15:10 Re: transaction lost when delete clog file after normal shutdown