Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bhBsN-0002YN-22 for pgsql-committers@arkaria.postgresql.org; Tue, 06 Sep 2016 08:37:03 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bhBsM-0003MJ-1o for pgsql-committers@arkaria.postgresql.org; Tue, 06 Sep 2016 08:37:02 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bhBsL-0003M0-2M; Tue, 06 Sep 2016 08:37:01 +0000 Received: from mail-eopbgr00042.outbound.protection.outlook.com ([40.107.0.42] helo=EUR02-AM5-obe.outbound.protection.outlook.com) by magus.postgresql.org with esmtps (TLS1.0:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1bhBsA-00017q-VZ; Tue, 06 Sep 2016 08:37:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gloomberg.onmicrosoft.com; s=selector1-chrullrich-net; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=wekKVv6iFKCNiFBNOAfKi2Z6fwPVQGVfHaOOwSljfP4=; b=XiCXFgTXYjjF552ug7xRuwkZjk51TfOvyqfBrVSCwBSc3Gv3O500Shh6kcxPCiwfB7+aKyoVvz7ZniKZMMX+tHwcqsulOvcR4hbN0idY/d+7udynsoLJaofebl7jpHLPkmf5os2ZdLSzWghS9Bi1DT0MWVtP+a7uep8u/IntVIg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=chris@chrullrich.net; Received: from [192.168.92.135] (217.31.70.82) by DB6PR0602MB2981.eurprd06.prod.outlook.com (10.172.250.138) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.599.9; Tue, 6 Sep 2016 08:36:47 +0000 Subject: Re: pgsql: Add putenv support for msvcrt from Visual Studio 2013 To: Michael Paquier References: <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> <74d35d99-8816-f58f-5898-338fb290567e@chrullrich.net> CC: Andrew Dunstan , Magnus Hagander , pgsql-committers , PostgreSQL-development From: Christian Ullrich Message-ID: <16feb1af-7fbb-49ab-8cf8-f98a6e7da9c0@chrullrich.net> Date: Tue, 6 Sep 2016 10:36:45 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------63886F5E27B20EF033573BDA" X-Originating-IP: [217.31.70.82] X-ClientProxiedBy: AM5PR0601CA0043.eurprd06.prod.outlook.com (10.173.86.157) To DB6PR0602MB2981.eurprd06.prod.outlook.com (10.172.250.138) X-MS-Office365-Filtering-Correlation-Id: f2ea8bd3-cd26-40ab-83e1-08d3d630f12f X-Microsoft-Exchange-Diagnostics: 1;DB6PR0602MB2981;2:bIWqm905BucFlQjcNkEbK0AzpDxIFTh1RbZnGpH+ULFUMCK4530leWE6H3KlhvcfCk9FygiAcVaE0Oft5WHMDP1fdUIoOGxvzKFxoPpSM11vFM4v/g0PQmZFpZQisK9r2RFy2A8Fl+QlPV22IQNQJS6WvejVfAL/TmuPNRsLUi5C6c8bmXENcn7ICmQAEp/3;3:fwKdUWPVt2NXvx+nDdXcaj69ViH9CklHwMwSyCWLlosc8t/c+BvHsBhIPHvIufC2Xdo4hhzRXDBYcNAjQizEs1J7oJf6gFWgifBAp/wvsmDSHym7MJRa2Q5r7sHdie2W;25:HAMdKalAf1o3Lvf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OINsSgURuJesADYPetdqZOzdEZ2jq9YPQJM65l0w6lqBCKUlYR0IyOnb5FLurMBt/qX4sYr+tp34MMzG/1PTdwXEKdzRHtnhk3UmAqE/2Duyevi57PktQYdUc7p9VdHOBanbBnepUSOFf42XooYwmWY3/faq3yRV+fy7SVouROPv2szyPdmyXCcDKBgQuc2ge0T+Wd9uJAFkvB7FR9AvW9hdmX3tSA+IJ+XdY0kH1drkaNtdWiWIG5AcULj1jfNG736gkR1lKxcoOiLaxMnERj7/iq2+ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(20558992708506); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(102415321)(6040176)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046);SRVR:DB6PR0602MB2981;BCL:0;PCL:0;RULEID:;SRVR:DB6PR0602MB2981; X-Microsoft-Exchange-Diagnostics: 1;DB6PR0602MB2981;4:4Ul2X+KFiePMsA+DG4DbL37lM09APbkun93vquNliDDvradIZ3Wq7+WJGxKqUGVglrpXAmwxGQCOHZ+dQWJOozDtzco4Zt1I22j/VQ1k+hdZNV05IV9NHPnXyK9ieBsa6VdfZ5lyreX90ebjFK4O2y5+83f2nnJTob9UQfaRI42/SljoYrKLFNICnyljo+JIRamaNucDuS/bNFSZwJkwj78B/bxXS/G+F0PlLE0zeoyyjdg7uB2wZdmf3/w7GwdzHFLsdqB3tIxRxZjI1dDJoRUtb9/3XJWSV9N54MNJ0bMsT+LklOGK09cjIq3DkUhbOqFtYQx1LEmOdE8gNFA/e0NKu3CZq/BOROvdaBA0ba/UfxMwWHo8teJ6MA0UblXQIibHxyYtu2XWFExIVFhEdF0BGwZ6q9PkWN0rim1pP20T+BS2Ho/lFg+ZH9xjMThJTCD15UD2MYUtWYB3o4ChQw== X-Forefront-PRVS: 0057EE387C X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6049001)(6009001)(7916002)(24454002)(199003)(377454003)(189002)(51444003)(36756003)(7846002)(2950100001)(512944002)(4610100001)(105586002)(81166006)(42186005)(305945005)(31696002)(512874002)(5660300001)(86362001)(2476003)(586003)(31686004)(2906002)(7736002)(106356001)(19580405001)(19580395003)(97736004)(110136002)(84326002)(270700001)(568964002)(189998001)(64126003)(6116002)(3846002)(4326007)(77096005)(5890100001)(50986999)(54356999)(76176999)(8676002)(81156014)(65826007)(68736007)(92566002)(117156001)(4001350100001)(93886004)(65806001)(33646002)(101416001)(65956001)(66066001)(83506001)(40753002);DIR:OUT;SFP:1101;SCL:1;SRVR:DB6PR0602MB2981;H:[192.168.92.135];FPR:;SPF:None;PTR:InfoNoRecords;A:0;MX:1;LANG:en; Received-SPF: None (protection.outlook.com: chrullrich.net does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;DB6PR0602MB2981;23:yAXmlSoTF4Xofxa6zllvwjoTmuhH38vya7ofuG0?= =?us-ascii?Q?wzazkRE8zOR7eIzm4qXkZB7M2YuCdJKQtqZFue/29asPGIPyWScbvEfFiovD?= =?us-ascii?Q?QTX/l02/WvQ6SN0cSXNwER99dJJmwHNYv/P85uO2pHAxP743kF++Xe+ElaML?= =?us-ascii?Q?pByNkH8fBXEfZWVD0E/OHN4IDIRb+GGp6B1VCGlNIkYlDaSg1wg+n0MKl/kW?= =?us-ascii?Q?4cfrgnvBeaLzi9qg/oVoGioWgfeTniwK3r6/zYCr7pOpNg3WyqKxRjfOXaEj?= =?us-ascii?Q?JRkdvia+drzLL5uH7Usvu4lLQURwnYk6v+W/smq8Jsy7oxThffHzY3nKIxul?= =?us-ascii?Q?kpHQpVGS/Z/Z/ICcgLaORawpLTDKP/Z1BF0PsvCxeHnL/ClNawzWEDuAIa6/?= =?us-ascii?Q?c7c+A18A0NTVZqdZ8aVPjVO0iId72xGzArBkGXT2EJw9cxqyItkZo5v3Oo1H?= =?us-ascii?Q?PLby9CpWQio4AG+fiHVDuB/ki5YlK2iJJduEZcpoXTgJHgwb4nxldsIS5DO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EMPahXzQebdKS+KwykZIkr?= =?us-ascii?Q?9u8oIEz1fk8PBVhp60NNXYBe/w7IIUxayPMV04bQgNcLic/naox/BFnSSa1m?= =?us-ascii?Q?oypaT6kjwCmE9jA=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;DB6PR0602MB2981;6:+DxyRRpkD0htdPkef4b301tn2q4WFyFOtBV3Y2AjITUu8mgY/wjx/iVxnYn9BjDB4cdtv2P23Mo0N+St7k8wjZF0cXeQjV8m0l6Rkzcbb0Urcb0JsLHKTsKDlxXt2uktGZuKyKTKLcL5iAV4SkepvHooOTKb7lXR6RGhAwt2jjD3wHzlCnCxut3pss03GW6sdShEC2AK885cTMBIwsYpc3/2fBiGwzlidKksLpSSXlHktvt1zWFVlqfc23yFwTUSyJmJ5R4tvIJDHdTVXItGUg/eUC38xH70kgBTmz8L8nc=;5:jkdchKoZC4ObQ+3BVeaIlZwvJXh4/3oBox8CGmwXCS+N7/6Ixicq9IhFuTKpCeB6nqzffszoFMN0FbjGxevwld8bZ/gyWcfcJZd8oOv+hGoeRoEL8bjBghP8QpClLAVWG2trsy2MfGChe9tpbOpueQ==;24:YkvLP1xK+9Gh+5mYgVntfyXdvsxVe+RrQ5gTwt3e9RVgcYTod2+MrIQrd9mB5GwDe7qcTOqo+IZB6NZH3HZWhDqamGs2EhoGw7Mx8WpoVqU=;7:3+9JlgFlKNX6h1laqudgFZAtbs6Uvz8BapL0W8VBbM7leSoI8WJm7mB2p8q7yNaBwZGbdGdqW17DynBoMIdHJcJhVbIZnfbr/9IanHS2AbzVtmA6mQ4SVEC9qTHsq/8GbGXRRJ0gpVd4liGknQU1ivNbGHMt3uiOmpg36Eu+fEfFUR6NsPF0MWQUZ6ivF9G6OIGLj9BnWQKpKzmO05JiMiuiYWclm3rtSxxVG16kB5H4Ow/piOc3BUHGrjkThquQ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: chrullrich.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Sep 2016 08:36:47.9656 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0602MB2981 X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-committers Precedence: bulk Sender: pgsql-committers-owner@postgresql.org --------------63886F5E27B20EF033573BDA Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit * Michael Paquier wrote: > On Thu, Sep 1, 2016 at 4:03 PM, Christian Ullrich 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 --------------63886F5E27B20EF033573BDA Content-Type: text/plain; charset="UTF-8"; name="0003-Pin-any-DLL-as-soon-as-seen-when-looking-for-_putenv.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0003-Pin-any-DLL-as-soon-as-seen-when-looking-for-_putenv.pa"; filename*1="tch"