X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:date:message-id:references :mime-version:content-type:content-transfer-encoding :in-reply-to; q=dns; s=default; b=ya52XT4f2vEvsg4l6MSjoWAHctaQFn AbESJKtaVbg67KuMU7uiWxl03o/rKyp/eSi6WOp6gK3CP6MMf9ZMT4x0NB+CvNN3 6zv9Tw4AoxkJ9tzQ/P4bwdzmnvcKUADWUNnonp9hOdevCshYeRKCC1V4N2eFcmRd 0d93jipDs1YYg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:date:message-id:references :mime-version:content-type:content-transfer-encoding :in-reply-to; s=default; bh=Xw2dDeMTanR9kdHchiaubE5sUvw=; b=W4Wy C/nQ1K7ApcK+kEToN9cpYtpepKFSQVJ6yucKLCOqJL6wbORQ9ETkkqDmAwMhIc41 Cb0pji8tHKwPRr9jxe3oJ1TrYHccbYI9GDqIC3+oOiSCiIDP6Y7Us+s868txaqNh gFCA1xiuSTIATeDVUux0IZPQ5o2NABpLNrQRfoE= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=1.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA,FREEMAIL_FROM,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 spammy=H*r:Unknown, explain, desktop, somewhere X-HELO: blaine.gmane.org To: cygwin AT cygwin DOT com From: Franz Fehringer Subject: Re: antrun versus wsl versus cygwin Date: Tue, 19 Feb 2019 20:14:38 +0100 Message-ID: References: <0f26a1aa-7c70-5201-5212-5f3df54a50fa AT gmail DOT com> <1968849310 DOT 20190218020001 AT yandex DOT ru> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 Openpgp: preference=signencrypt In-Reply-To: X-IsSubscribed: yes Am 19.02.2019 um 00:36 schrieb Houder: > On Mon, 18 Feb 2019 13:15:02, Franz Fehringer wrote: > >> Am 18.02.2019 um 11:42 schrieb Houder: > [snip] > >>> Now show us the output of an antrun script, where the executable >>> is C:\Tools\Cygwin\bin\which and its argument: bash >> >> >> >> >> >> >> >> >> gives >> >> [exec] /usr/bin/bash >> [exec] W i n d o w s S u b s y s t e m f o r L i n u x h a s n >> o i n s t a l l e d d i s t r i b u ti o n s . >> [exec] D i s t r i b u t i o n s c a n b e i n s t a l l e d >> b y v i s i t i n g t h e M i c r o s o f t S t o r e : >> [exec] h t t p s : / / a k a . m s / w s l s t o r e >> >> It is as if C:\Windows\System32 were hardcoded somewhere >> The ant exec documentation says >> "The task delegates to Runtime.exec which in turn apparently >> calls ::CreateProcess. It is the latter Win32 function that defines the >> exact semantics of the call. " > > Erm, thinking this over ... you may be on the right track ... > > After invoking the Windows executable (JVM or whatever) from Cygwin, "bash" > is started using CreateProcess() > > https://docs.microsoft.com/en-us/windows/desktop/api/processthreadsapi/nf-processthreadsapi-createprocessa > > Before it searches PATH, CreateProcess checks "the 32-bit Windows system > directory" for the presence of "bash.exe". > > And we know that bash.exe from WSL is present in C:\Windows\System32. That > does explain why the output of bash from WSL is shown, does it not? > (reporting that a distribution is still to be installed). > > The above also explains why renaming bash from WSL to "wslbash.exe" forces > CreateProcess() to search for the presence of bash.exe down the PATH. > > Henri > > Yes, that is it most probably (and unfortunately). -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple