Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TxDkk-0000pl-Sl for pgsql-hackers@arkaria.postgresql.org; Mon, 21 Jan 2013 09:33:19 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TxDkj-0007uD-Ol for pgsql-hackers@arkaria.postgresql.org; Mon, 21 Jan 2013 09:33:17 +0000 Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TxDkP-0007d5-EL for pgsql-hackers@postgresql.org; Mon, 21 Jan 2013 09:32:57 +0000 Received: from outmail148095.authsmtp.com ([62.13.148.95]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TxDkJ-0004Go-7M for pgsql-hackers@postgresql.org; Mon, 21 Jan 2013 09:32:57 +0000 Received: from mail-c226.authsmtp.com (mail-c226.authsmtp.com [62.13.128.226]) by punt8.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id r0L9WmZq060067; Mon, 21 Jan 2013 09:32:48 GMT Received: from ayaki.localdomain (dsl-124-150-41-206.dyn.iinet.net.au [124.150.41.206] (may be forged)) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2/) with ESMTP id r0L9WcVh097003 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 21 Jan 2013 09:32:41 GMT Message-ID: <50FD0B35.3020503@2ndQuadrant.com> Date: Mon, 21 Jan 2013 17:32:37 +0800 From: Craig Ringer Organization: 2nd Quadrant User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Noah Misch CC: Brar Piening , Heikki Linnakangas , Magnus Hagander , pgsql-hackers Subject: Re: Visual Studio 2012 RC References: <4FCA84F6.5090706@gmx.de> <4FD3F553.9060105@gmx.de> <4FEB0D39.6080108@enterprisedb.com> <50526BA6.3030103@gmx.de> <20121002011201.GC30396@tornado.leadboat.com> <507B2B0A.2030506@gmx.de> <20121015115351.GC4627@tornado.leadboat.com> <20130101025421.GA17763@tornado.leadboat.com> In-Reply-To: <20130101025421.GA17763@tornado.leadboat.com> X-Enigmail-Version: 1.4.6 Content-Type: multipart/alternative; boundary="------------020707060304000202020208" X-Server-Quench: 82eb47a4-63ad-11e2-98a9-0025907ec6c5 X-AuthReport-Spam: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-AuthRoute: OCdxZQATClZeVg0b BQteCiN5VAwpPBRK HVkIKg5MJUcNSQVJ NksacxtFagRbZ1hf HGQLWldEUFR7WmF/ bw8fbAdZfEtLXxtu UVZLQlRNFgBqBAMA SFweLhAVJGMeeHd3 ZUZhEHVTWEx4O05/ FxxQEjwCeGFjOTQC UUENdR5deFJDYx9F aFV2VHRYMmNUYzQC El17DBAYFhZyEh9g Cj8MNk8bRQ4wAiMw RhdKR212RwU/bE0A X-Authentic-SMTP: 61633235383639.1020:706 X-AuthFastPath: 0 (Was 255) X-AuthSMTP-Origin: 124.150.41.206/2525 X-AuthVirus-Status: No virus detected - but ensure you scan with your own anti-virus system. X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org This is a multi-part message in MIME format. --------------020707060304000202020208 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 01/01/2013 10:54 AM, Noah Misch wrote: > On Mon, Oct 15, 2012 at 07:53:51AM -0400, Noah Misch wrote: >> The only matter still requiring attention is a fix for IsoLocaleName(). > Following off-list coordination with Brar, I went about finishing up this > patch. The above problem proved deeper than expected. For Windows Vista, > Microsoft made RFC 4646 tags the preferred way to denote a locale in Windows. > Microsoft calls them "locale names". Starting with Visual Studio 2012, > setlocale() accepts locale names in addition to all the things it previously > accepted. One can now use things like "initdb --locale=zh-CN" and "CREATE > DATABASE foo LC_CTYPE = 'pl'". This meant updating win32_langinfo() and > find_matching_ts_config() to handle the new formats. In passing, I fixed an > unchecked malloc() in win32_langinfo(). > > In addition to expanding the set of valid locale inputs, VS2012 changes the > (undocumented) content of _locale_t to hold locale names where it previously > held locale identifiers. I taught IsoLocaleName() to handle the new material. > I also sought to improve the comments on IsoLocaleName(); its significance was > not previously clear to me. This thread has some background: > http://archives.postgresql.org/message-id/4964B45E.5080003@hagander.net > > Though I'm not entirely sanguine about digging into the officially-opaque > _locale_t, we have been doing it that way for several years. None of the > alternatives are clearly-satisfying. In particular, I found no good way to > look up the code page corresponding to a locale name on pre-Vista systems. > The CRT itself handles this by translating locale names to locale identifiers > using a lookup table. The Gnulib "localename" and "setlocale" modules are > also interesting studies on the topic. > > In previous reviews, I missed the need to update pgwin32_putenv(). The > addition of VS2010 support had also missed it, so this catches up. That > function has other problems, but I will hold them for another patch. > > Tester warning: if you currently have some form of VS2010 installed, including > the compilers of Windows SDK 7.1, beware of this problem: > http://stackoverflow.com/questions/10888391/link-fatal-error-lnk1123-failure-during-conversion-to-coff-file-invalid-or-c FYI, you can properly fix this without uninstalling anything, giving you a system with a working VS 2012 as well as working SDK 7.1 / VS 2010 SP1 32-bit and 64-bit compilers. Install the tools in the following order: * VS Express 2010: http://www.microsoft.com/visualstudio/eng/products/visual-studio-2010-express * Windows SDK 7.1 * VS 2010 SP1: http://www.microsoft.com/en-au/download/details.aspx?id=23691 * VS 2010 SP1 Compiler Update: http://www.microsoft.com/en-au/download/details.aspx?id=4422 * VS Express 2012 Note that SDK 7.1 and VS 2010 will fail to install if you have a newer version of the Visual c++ 2010 runtime installed. Newer programs often install this for you. As a workaround, you must uninstall the newer runtime, install Visual Studio, the SDK, and service pack, then reinstall the newer runtime to get the programs that require it to work again. I've written more about both of these in the TROUBLESHOOTING section of https://github.com/2ndQuadrant/pg_build_win/blob/master/README.md -- Craig Ringer http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services --------------020707060304000202020208 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
On 01/01/2013 10:54 AM, Noah Misch wrote:
On Mon, Oct 15, 2012 at 07:53:51AM -0400, Noah Misch wrote:
The only matter still requiring attention is a fix for IsoLocaleName().
Following off-list coordination with Brar, I went about finishing up this
patch.  The above problem proved deeper than expected.  For Windows Vista,
Microsoft made RFC 4646 tags the preferred way to denote a locale in Windows.
Microsoft calls them "locale names".  Starting with Visual Studio 2012,
setlocale() accepts locale names in addition to all the things it previously
accepted.  One can now use things like "initdb --locale=zh-CN" and "CREATE
DATABASE foo LC_CTYPE = 'pl'".  This meant updating win32_langinfo() and
find_matching_ts_config() to handle the new formats.  In passing, I fixed an
unchecked malloc() in win32_langinfo().

In addition to expanding the set of valid locale inputs, VS2012 changes the
(undocumented) content of _locale_t to hold locale names where it previously
held locale identifiers.  I taught IsoLocaleName() to handle the new material.
I also sought to improve the comments on IsoLocaleName(); its significance was
not previously clear to me.  This thread has some background:
http://archives.postgresql.org/message-id/4964B45E.5080003@hagander.net

Though I'm not entirely sanguine about digging into the officially-opaque
_locale_t, we have been doing it that way for several years.  None of the
alternatives are clearly-satisfying.  In particular, I found no good way to
look up the code page corresponding to a locale name on pre-Vista systems.
The CRT itself handles this by translating locale names to locale identifiers
using a lookup table.  The Gnulib "localename" and "setlocale" modules are
also interesting studies on the topic.

In previous reviews, I missed the need to update pgwin32_putenv().  The
addition of VS2010 support had also missed it, so this catches up.  That
function has other problems, but I will hold them for another patch.

Tester warning: if you currently have some form of VS2010 installed, including
the compilers of Windows SDK 7.1, beware of this problem:
http://stackoverflow.com/questions/10888391/link-fatal-error-lnk1123-failure-during-conversion-to-coff-file-invalid-or-c
FYI, you can properly fix this without uninstalling anything, giving you a system with a working VS 2012 as well as working SDK 7.1 / VS 2010 SP1 32-bit and 64-bit compilers.

Install the tools in the following order:

* VS Express 2010: http://www.microsoft.com/visualstudio/eng/products/visual-studio-2010-express
* Windows SDK 7.1
* VS 2010 SP1: http://www.microsoft.com/en-au/download/details.aspx?id=23691
* VS 2010 SP1 Compiler Update: http://www.microsoft.com/en-au/download/details.aspx?id=4422
* VS Express 2012

Note that SDK 7.1 and VS 2010 will fail to install if you have a newer version of the Visual c++ 2010 runtime installed. Newer programs often install this for you. As a workaround, you must uninstall the newer runtime, install Visual Studio, the SDK, and service pack, then reinstall the newer runtime to get the programs that require it to work again.

I've written more about both of these in the TROUBLESHOOTING section of https://github.com/2ndQuadrant/pg_build_win/blob/master/README.md

-- 
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services
--------------020707060304000202020208--