From: Christian Ullrich <chris@chrullrich.net>
To: Michael Paquier <michael.paquier@gmail.com>
Cc: Andrew Dunstan <andrew@dunslane.net>
Cc: Magnus Hagander <magnus@hagander.net>
Cc: pgsql-committers <pgsql-committers@postgresql.org>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: pgsql: Add putenv support for msvcrt from Visual Studio 2013
Date: Tue, 6 Sep 2016 10:36:45 +0200
Message-ID: <16feb1af-7fbb-49ab-8cf8-f98a6e7da9c0@chrullrich.net> (raw)
In-Reply-To: <CAB7nPqR5vDX4UBXGXqeUGQ5JUHpEg_1fQX7iiSHzNUVRCp-S0Q@mail.gmail.com>
References: <E1atXIK-0003un-G0@gemulon.postgresql.org>
<b0c66170-5711-20dd-2de3-408429ca0f48@chrullrich.net>
<CABUevEzicpYAUOF9ZHkee1-c-gvokKAmr708sqta4H71bOZOWQ@mail.gmail.com>
<34dd7956-3324-0305-288d-edc7d56fba76@chrullrich.net>
<571E6D90.7050903@dunslane.net>
<9d5c6a49-774c-44de-83fc-65c5b431f8d9@chrullrich.net>
<2c5f9472-d0cc-df61-78e3-bc48909ffb59@chrullrich.net>
<784524b2-bd50-1f5e-dad9-f8840f97753a@chrullrich.net>
<CAB7nPqQyNvox10vK1xPvHVsy9NTKJtdbOOHYzLcJiM1DzFtoLg@mail.gmail.com>
<74d35d99-8816-f58f-5898-338fb290567e@chrullrich.net>
<CAB7nPqR5vDX4UBXGXqeUGQ5JUHpEg_1fQX7iiSHzNUVRCp-S0Q@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>
* Michael Paquier wrote:
> On Thu, Sep 1, 2016 at 4:03 PM, Christian Ullrich <chris@chrullrich.net> wrote:
>> My conclusion from April stands:
>>
>>> The fact that master looks like it does means that there have not been
>>> many (or any) complaints about missing cross-module environment
>>> variables. If nobody ever needs to see a variable set elsewhere, we
>>> have a very simple solution: Why don't we simply throw out the whole
>>> #ifdef _MSC_VER block?
>
> Looking at the commit logs and 741e4ad7 that does not sound like a good idea.
Well, I still maintain that if it doesn't work and has never worked,
getting rid of it is better than making it work six years after the
fact. OTOH, there may have been cases where it did actually work,
perhaps those gnuwin32 libraries that were mentioned in the comment
before it was changed in that commit above, if they were loaded before
the first call to the function.
OTTH, wouldn't it be funny if fixing it actually broke something that
worked accidentally because it *didn't* get the updated environment? I
think that is at least as likely as suddenly getting excited reports
that something now works that hasn't before.
> It is better to avoid !!. See for example 1a7a436 that avoided
> problems with VS2015 as far as I recall.
Agreed, thanks for noticing. This change creates a warning, however,
because GetModuleHandleEx() returns BOOL, not HMODULE. Updated 0003
attached, simplified over my original one.
> In order to avoid any problems with the load and unload windows, my
> bet goes for 0001, 0002 and 0003, with the last two patches merged
> together, 0001 being only a set of independent fixes. That's ugly, but
> that looks the safest course of actions. I have rebased/rewritten the
> patches as attached. Thoughts?
In lieu of convincing you to drop the entire thing, yes, that looks
about right, except for the BOOL thing.
--
Christian
Attachments:
0003-Pin-any-DLL-as-soon-as-seen-when-looking-for-_putenv.patch (text/plain, 0B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: chris@chrullrich.net, michael.paquier@gmail.com, andrew@dunslane.net, magnus@hagander.net, pgsql-hackers@postgresql.org
Subject: Re: pgsql: Add putenv support for msvcrt from Visual Studio 2013
In-Reply-To: <16feb1af-7fbb-49ab-8cf8-f98a6e7da9c0@chrullrich.net>
References: <E1atXIK-0003un-G0@gemulon.postgresql.org> <b0c66170-5711-20dd-2de3-408429ca0f48@chrullrich.net> <CABUevEzicpYAUOF9ZHkee1-c-gvokKAmr708sqta4H71bOZOWQ@mail.gmail.com> <34dd7956-3324-0305-288d-edc7d56fba76@chrullrich.net> <571E6D90.7050903@dunslane.net> <9d5c6a49-774c-44de-83fc-65c5b431f8d9@chrullrich.net> <2c5f9472-d0cc-df61-78e3-bc48909ffb59@chrullrich.net> <784524b2-bd50-1f5e-dad9-f8840f97753a@chrullrich.net> <CAB7nPqQyNvox10vK1xPvHVsy9NTKJtdbOOHYzLcJiM1DzFtoLg@mail.gmail.com> <74d35d99-8816-f58f-5898-338fb290567e@chrullrich.net> <CAB7nPqR5vDX4UBXGXqeUGQ5JUHpEg_1fQX7iiSHzNUVRCp-S0Q@mail.gmail.com> <16feb1af-7fbb-49ab-8cf8-f98a6e7da9c0@chrullrich.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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