delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2021/06/28/12:30:13

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 01A3E39B842A
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1624897812;
bh=99HydDdR640LGtnqefdYJFFt0HVAmjINTTNiXaECsPY=;
h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
From;
b=azHlCikU2hSdZujeWfUa9t+AFIZLkpIZswCHpJ7uBbcVrPf1tpdzDuu/2WHp62QEn
IpUjdsQ/IT5IMDiXPyj0kusudviWWeUMS42OkI0xZ42lR6gEzfUu3qA0gB1woMJASm
+XJj6GiJqDNZUeas1q1Qk2QSWwieXn0Fxd0el5Xk=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 942273987C1B
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
b=iVFxYWnQwFbwkcJbFZgmWSm5upHyxiAxRjUcKJTOm3/KBFht0cJGC1KYxg08uiFklbX2FGrFAm9y/EomOfnOIDt2JUZ0HXBBrzExz4jlnCZTiVydaMyogDdbGgMO9ZidjM7Rp+t7+n6olURHpIo/ZglugB99omy5GY/laO6HV+Uf6xaAJNekck2Xx7Uol8byV6D2ddJ7qk6lP0NILEfC8LL5NOkBPr1MUPg8E9VlI7ujoVH23yLAsmuvKCzKfMyKRHN/+N14qb5mXN08p86DC8YrOQBU7jI8+fLn0NyUNxDamjhWEhSzMkY0SUZywQo0Mmatf6Sy9KE2O+QEdnybUA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
s=arcselector9901;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
bh=14NqPFDMRfomVTAOeNy438Lx6Rz15bPwAlqqpkW+WjI=;
b=L4lFXTx66mL7iDREaKg6SYGCERIoxePX2ANBGVY3J9M9eJOf9zRA+LkuQP4Hi1H9nu0Fy8G3TnfdyxqBFQRk/eFIQTNLqzZn9nS72DVwxrqa++AxMjFaCrdUEyG97Qc7IS4gSdwM1YEj8GvSaeeq2x0gAjXdRO11HeI512hxS+3Jhz0L393clMnRKEsRwRJnp4Uo8oT9F8PcmblkFzv5FbotT3Gwov9HUxu3OHUdqMDqyHWlubz/24IRUab/v1W4s8Kw024duXHlQiWCnNn2rNQotbW+0FFdzNcLS4zgDOd7eombJ47FZAs8fOCercySJNnBqzOTpadLqlGMeJF9pw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none;
dkim=none; arc=none
Subject: Re: libtool with mingw hangs building openocd in
func_convert_core_msys_to_w32
To: cygwin AT cygwin DOT com
References: <1f91bcfb-374f-7985-5b4e-c6e323de3cd8 AT outlook DOT com>
Message-ID: <SN6PR13MB42697EC6467C4B92D1F8F757E5039@SN6PR13MB4269.namprd13.prod.outlook.com>
Date: Mon, 28 Jun 2021 12:29:32 -0400
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
In-Reply-To: <1f91bcfb-374f-7985-5b4e-c6e323de3cd8@outlook.com>
X-TMN: [GgvSFqyPSxwFRNDQHC1F4LAtPLLFiDJ4e12HzDXxhB0=]
X-ClientProxiedBy: CH0PR07CA0013.namprd07.prod.outlook.com
(2603:10b6:610:32::18) To SN6PR13MB4269.namprd13.prod.outlook.com
(2603:10b6:805:e0::13)
X-Microsoft-Original-Message-ID: <dbb1a20e-5910-bbac-4337-10475e9cf160 AT outlook DOT com>
MIME-Version: 1.0
X-MS-Exchange-MessageSentRepresentingType: 1
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id: 7c9434f7-ccc6-4e90-e725-08d93a51ec2d
X-MS-TrafficTypeDiagnostic: SN6PR13MB2288:
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: 7UrsmpWmyFe7AMFSC9eTOAFtcudwjyKxdqmb1QZiFTeEUgC95L/EOmShD5K8C0Xg1PbtKJeQgVcyVo8KFnZnu4d/codq4EESxmoVRXlGSdMxAJPpddNS4Q0zGCK+ZTfzb5BOaNB9GdB17FtQ9caFSx+IdDIHNK9OaeTJoRjrJ1zX5GCguEiEMKxmfxT9F/5IQWk2RTyzg2YV9rHA7yT+P5KaOdNrzrYl8LvhwPN6O7EoumnRs2F3+yspi84obiHfM8tpWGbapH7oVx2b+XyFwBZQgMcKBDn/JPZSVwn1B8kWajSZJu/B5RO4Wa4rjeiP60wZXrfwxzjSJDtHnC3OwMxVSuZWIKuEKPEJfol8SLq3MSLyGO3GuLayj3pnm6jgbS/ORzvpMT4jQWnqmzuPs6E2lzwCtrgDLqRLLPDhs6spfErszDrwvrD1sTxt9RMJ
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0: R0bw+MdhYuOXZLB/XwzE/6/MjW20I1b5JLaGMTYIwUKPWr1Zp8KXpHJipnc3KEFqf9BsWukit/vuzAcytrSVw/qlI3BfL9Jg1qGuBXWFfySQQjHpDYihLJc7Nyrj+afiT7Vx91eOZGQqrRiqSYkEpA==
X-OriginatorOrg: outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 7c9434f7-ccc6-4e90-e725-08d93a51ec2d
X-MS-Exchange-CrossTenant-AuthSource: SN6PR13MB4269.namprd13.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jun 2021 16:29:38.3456 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa
X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR13MB2288
X-Spam-Status: No, score=1.7 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_MUA_MOZILLA, FREEMAIL_FROM,
KAM_NUMSUBJECT, MSGID_FROM_MTA_HEADER, NICE_REPLY_A, RCVD_IN_DNSWL_NONE,
RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS,
TXREP autolearn=no autolearn_force=no version=3.4.2
X-Spam-Level: *
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Dietmar May via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Dietmar May <dietmar DOT may AT outlook DOT com>
Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>

> >/$ cmd //c echo hello />/hello />//>/which works, and this, which doesn't: />//>/$ cmd /c echo hello />//>/Microsoft Windows [Version 10.0.blah] />/(c) Microsoft Corporation. All rights reserved. />//>/C:\msys64\home\myname> /
> Your example seems to be inverted, the first form doesn't work, the
> second does with the same results you show (but inverted).
>
> It would be better if you document how you executed those commands,
> we're assuming a mintty terminal running a bash shell, but I haven't
> followed all your messages and it might be a cmd window; results
> shouldn't change anyway, but for completeness sake.

More details for you, then:

 >/I just re-installed msys2 and tried a few things, with interesting 
result. /

I install msys2-x86_64-20210604.exe (downloaded last week) from the 
msys2 website, and accept all defaults during installation, including 
the "run msys2 now" on the final installation screen (which, yes, opens 
a mintty terminal running msys2's bash shell). All commands are executed 
in that same mintty window immediately following a fresh installation.

So here is the output, cut-and-pasted from that mintty terminal:

dietmar AT laptop MSYS ~
$ cmd //c echo hello
hello

dietmar AT laptop MSYS ~
$ cmd /c echo hello
Microsoft Windows [Version 10.0.19043.1055]
(c) Microsoft Corporation. All rights reserved.

C:\msys64\home\dietmar>

As you can see, the first form DOES INDEED work, and the second does 
not. Why not try it yourself? You will likely have the same results.

> No, wrong, cmd is getting an argument which it interprets as it seems
> fit, no hack there.  The same applies to the ls example before, ls
> receives an argument which is expected to be a path, nothing strange.
To find out what cmd is really doing, I believe the authoritative answer 
would be given by Microsoft's Command Prompt:

Microsoft Windows [Version 10.0.19043.1055]
(c) Microsoft Corporation. All rights reserved.

C:\Users\dietmar>cmd //c echo hello
Microsoft Windows [Version 10.0.19043.1055]
(c) Microsoft Corporation. All rights reserved.

C:\Users\dietmar>exit

C:\Users\dietmar>

Here we see that cmd.exe //c starts a subshell, rather than executing a 
single command.

However, in msys2's mintty/bash window, that same syntax works differently:

dietmar AT laptop MSYS ~
$ cmd //c echo hello
hello

dietmar AT laptop MSYS ~
$ cmd ///c echo hello
Microsoft Windows [Version 10.0.19043.1055]
(c) Microsoft Corporation. All rights reserved.

C:\msys64\home\dietmar>exit
exit

dietmar AT laptop MSYS ~
$ cmd ////c echo hello
hello

dietmar AT laptop MSYS ~
$ cmd //////c echo hello
hello

dietmar AT laptop MSYS ~
$ cmd ////////c echo hello
hello

dietmar AT laptop MSYS ~
$ cmd /////////c echo hello
Microsoft Windows [Version 10.0.19043.1055]
(c) Microsoft Corporation. All rights reserved.

C:\msys64\home\dietmar>exit
exit

dietmar AT laptop MSYS ~
$

It seems evident that msys2 is performing slash escaping - ie. 2 
consecutive slashes are consolidated into a single slash (rather like 
quote escaping in various languages - eg. SQL, CSV, C#, YAML) 
recursively (ie. repeatedly) during argument evaluation.

Again, why not simply change this to a form that works without the slash 
hackery?

dietmar AT laptop MSYS ~
$ cmd /c "echo hello"
hello

> >/Interestingly, />//>/ls //c />//>/hangs under msys2 (as well as cygwin), /
> Expected as the documentation link describes, //c is taken as a path to
> a server, you already knew that.
>
> >/whereas />//>/cmd //c />//>/does not; so it almost seems like msys2 has a hack to recognize that />/cmd.exe is being invoked ... /
> No, wrong, cmd is getting an argument which it interprets as it seems
> fit, no hack there.  The same applies to the ls example before, ls
> receives an argument which is expected to be a path, nothing strange.
>
> >/However, both of the following also complete successfully under msys2, />/WITHOUT the double-slash hack: />//>/$ cmd /c "echo hello" />/hello />//>/$ cmd "/c" "echo hello" />/hello />//>/Both seem preferable to bad syntax. />//>/Of course, there's always the question of why libtool is using cmd.exe />/instead of /bin/echo, which seems to work just fine ... />//>/$ /bin/echo "hello world" />/hello world /-- 
> R.Berber


-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019