Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l2vI0-0005g0-2I for pgsql-bugs@arkaria.postgresql.org; Fri, 22 Jan 2021 12:11:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l2vHy-00070X-Jv for pgsql-bugs@arkaria.postgresql.org; Fri, 22 Jan 2021 12:11:42 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l2vHy-00070Q-9s for pgsql-bugs@lists.postgresql.org; Fri, 22 Jan 2021 12:11:42 +0000 Received: from mail-io1-xd2f.google.com ([2607:f8b0:4864:20::d2f]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1l2vHu-0007K9-RU for pgsql-bugs@lists.postgresql.org; Fri, 22 Jan 2021 12:11:41 +0000 Received: by mail-io1-xd2f.google.com with SMTP id y19so10557148iov.2 for ; Fri, 22 Jan 2021 04:11:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pke-hr.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:organization:message-id :disposition-notification-to:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=IW5r5YayEA7zRjJsgF0cMuUqcCVAa0z91qYtLtqXiOM=; b=QKyh8cd8tgrs9Pp7GwknIuK+Cgiu0QKcnS0Icyx2byj1dfasWyRwnjOC65RLA62XoW kGwESufb3+b5rkchJ7Q6m39zFRDOgZoefos9govvtqf7cPeXDiJSlz9KXiMx5iVpJGk8 zjTRqmjXlUUyBfcyG4dX8nQVDdVKDRzLNJUA8zbLZAK1T0AFWJF2Y5ASq4psHVh3Fvtt G39Mm43Wao6APIZDGPtdNz4TZKM1nBBe83JwOoL+BKOqr8ccwwABseimqQmahMR/olck dGcyzWRG07jxVja8sGvQ/BDUt0xpuf1qcFAnNqsKsMbW/QOCePLYD48bYsT64hz1L5U3 UPhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:disposition-notification-to:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=IW5r5YayEA7zRjJsgF0cMuUqcCVAa0z91qYtLtqXiOM=; b=QJhk6hJ04f2lT1mlh+ppQEE9qUc6qA8G2aiTPgEvBytSgh29im/FgzpzeGXB6zgC+s eoS7OJbh9ckhiPzc+wwDf7V0BuIqUghE4lABdFVuClCIwrZRfq3E50r4bUVXwx4x366I 7878c0kVgp+I5v5xxCSRTz43rtParR6ywXrdKtjSO901+V3JarBvZa4gGIPRi28Di5no 8R7M0XATBBp7fSf4LV8rIpJDe+NP/6+ychfJTU6Cagr6yk0abcqjI5Q/evriGZrbB1y/ z9fWHXAb6wFZhk3YUOGkGETUTtHw96BcG/6aHQfzdMntdxSSMtV3ASPZBXaVUB+iYN3Q ltVQ== X-Gm-Message-State: AOAM531zCzR9c4UNkOa+5zW7GR8nt2+JzqZTJPRJ3aXoBTppcMyPFyE+ MV+aCqcGK4ToZAn/XGrxgxFw8NjnjdbOUpht X-Google-Smtp-Source: ABdhPJy94+PqBG4MGpuAo1VUnDsmbxitOq+ahb2exOYGFdnNG+Gj3m3dn6iDRvcdfwcLsgy/Tf39vA== X-Received: by 2002:a5e:9612:: with SMTP id a18mr711667ioq.209.1611317496020; Fri, 22 Jan 2021 04:11:36 -0800 (PST) Received: from [192.168.1.8] (93-139-29-29.adsl.net.t-com.hr. [93.139.29.29]) by smtp.gmail.com with ESMTPSA id r7sm5692195ilo.31.2021.01.22.04.11.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 22 Jan 2021 04:11:35 -0800 (PST) Subject: Re: BUG #16825: When building on Windows, cl /? retrun 'x64' not AMD64 and the build does not create x64 environment To: Michael Paquier , =?UTF-8?Q?Juan_Jos=c3=a9_Santamar=c3=ada_Flecha?= Cc: robionekenobi@bluewin.ch, PostgreSQL mailing lists References: <16825-c4f104bcebc67034@postgresql.org> <000001d6ecfd$a5fde810$f1f9b830$@bluewin.ch> From: =?UTF-8?Q?Jurko_Gospodneti=c4=87?= Organization: PKE sistemi d.o.o. Message-ID: <30af0ea6-63c2-471e-601a-802174f9d7c6@pke.hr> Disposition-Notification-To: =?UTF-8?Q?Jurko_Gospodneti=c4=87?= Date: Fri, 22 Jan 2021 13:11:30 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi. On 21.1.2021. 3:12, Michael Paquier wrote: > On Wed, Jan 20, 2021 at 04:24:47PM +0900, Michael Paquier wrote: >> If there are no objections, I am planning to apply this patch to >> HEAD. > > Done as of 733d670. There may be a point in back-patching and > classifying that as a bug, but I have played it conservative as that's > an improvement and nobody really complained about that AFAIK. > -- > Michael > Thanks for patching this. And actually I did report it a while ago, just hadn't found the time to follow up and rebase the patch to develop: ------ Hi. I'm not sure what the process is here so just attempting a polite ping. I've posted a message (reattached to the bottom of this e-mail) about this problem, including a fix for it, almost a month about and there has thus far been no response nor can I see the change applied to https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/tools/msvc/Solution.pm;hb=HEAD Please let me know if I should be posting about this somewhere else. Kind regards, Jurko Gospodnetić On 7.10.2020. 18:08, PG Bug reporting form wrote: > The following bug has been logged on the website: > > Bug reference: 16660 > Logged by: Jurko Gospodnetić > Email address: jurko.gospodnetic@pke.hr > PostgreSQL version: 9.6.19 > Operating system: Windows > Description: > > If you run the 64-bit postgres build from a virtual subst drive (see > Windows `help subst` command), it will fail. > > Internally it will fail to detect that the used Visual C++ compiler > executable `cl.exe` has been configured for producing 64-bit targets > and will thus configure the generated Visual Studio projects & > solution for building 32-bit targets even through the used compiler > will actually be producing 64-bit ones. > > Even deeper, the original problem stems from `cl.exe` behaviour, which > seems to produce no compiler option output when invoked as `cl /?` > from a subst drive. On one occasion it was reported that it did show > compiler options on some subst drives but not others, but this could > not be reproduced later on so such behaviour can be at most considered > random. > > Invoking the executable as `cl /help` works correctly on all tested > drives. Go figure. > > Here's a patch fixing the problem based on the code in the 9.6.19 > distribution: From a3ccfe68dbe5190f743cd13a4fc90faaf6478370 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jurko=20Gospodneti=C4=87?= Date: Wed, 7 Oct 2020 16:17:29 +0200 Subject: [PATCH] patch compiler architecture detection on virtual subst drives --- src/tools/msvc/Solution.pm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm index 7ec7120..29ebab5 100644 --- a/src/tools/msvc/Solution.pm +++ b/src/tools/msvc/Solution.pm @@ -75,8 +75,13 @@ sub DeterminePlatform { my $self = shift; - # Examine CL help output to determine if we are in 32 or 64-bit mode. - my $output = `cl /? 2>&1`; + # examine CL help output to determine if we are in 32 or 64-bit mode + # + # we intentionally use `cl /help` as opposed to `cl /?` as the former works + # when the current drive is a virtual `subst` drive (see `help subst`) while + # the latter does not (noticed at least with compiler executable version + # `Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27043 for x64`) + my $output = `cl /help 2>&1`; $? >> 8 == 0 or die "cl command not found"; $self->{platform} = ($output =~ /^\/favor:<.+AMD64/m) ? 'x64' : 'Win32'; print "Detected hardware platform: $self->{platform}\n";