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:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type:content-transfer-encoding; q=dns; s=default; b=smyhrSy9xLGkQZ7PN4e5mtqMb2ONnnW3ogdTlIH8/Ku 5b8fc8m2iVbbESaDZs1faDJ8PjvNUKw5y6BfC1rss/S3n8nfEscGelmG2eZMntK9 EucqCQJzfvemiG5rKscO9kjY+Yfnf51QEkI8AVVqq2vgkWKw0TQE+fdbJ24KKM9Y = 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:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type:content-transfer-encoding; s=default; bh=+rkQGD7/afmg5iUv/MVP+Har9Ag=; b=Zneldj4FSstvgYKSn QzoqonTt5M3L7P6eiDvVkKZLpQZUiEW/5dUKjVGWup2OJ7xTS5xAauxdNl77SER+ H6mF3g8qD8xH9OgDP4qG+wq6oQOedR1Lkz1xlDGKOzVQT5OjJi+MOhYCF33BNg8V rYRIm5jsRlx69SKfyIRqv2RnUw= 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-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.8 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: kautler.net X-Received: by 10.140.94.100 with SMTP id f91mr55263794qge.101.1436168407760; Mon, 06 Jul 2015 00:40:07 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: =?UTF-8?Q?Bj=C3=B6rn_Kautler?= Date: Mon, 6 Jul 2015 09:39:48 +0200 Message-ID: Subject: Re: Migrating from MKS to Cygwin To: cygwin AT cygwin DOT com Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id t667eX9M009917 Hi Sarbjit, pwd is a bash built-in function. This means, even if you do not have any pwd installed, you still could call pwd from Bash. And no matter what pwd you have installed, it will not be called if you just call "pad" from Bash. If you use some path though, the installed one is used. I guess you tested with the Windows port only from Bash, not from the Makefile? Because I'd think it should work from there, except if it spawns some Bash process and makes the call there. Anyways, I'd rather not replace the Cygwin executable by another one and depend on this. E. g. If you update, it gets replaced again and behavior changes. What I'd recommend is, either put the Windows port, or even better a shellscript - that is called pwd and calls pwd by path and then uses cygpath to transform the result - earlier in the PATH (e. g. /usr/local/bin). For the .bat case, I'd either create a symlink beside the .bat or in /usr/local/bin, or if it does not work, a shellscript that calls the .bat. Regards Björn 2015-07-06 8:12 GMT+02:00 Sarbjit singh : > Hi All, > > My organization is evaluating Cygwin as a replacement for MKS. We will > be using Cygwin primarily for running our regression cases on windows > (Regression cases are common for Unix and Windows Platforms). Goal is > to migrate to Cygwin with minimal changes to be done at regression > test cases scripts (Makefile etc.). > > So far, the main challenges are with "pwd" command and the > invocation of applications with .bat extension. > > PWD Command: > > There are few regression cases which uses 'pwd' command in the > Makefile.Since, in the cygwin environment, POSIX paths are returned > and these are not compatible with the software applications under test > i.e. the software application is not able to resolve these paths. > > As a workaround, I did the following : > > - Define a bash function in .bashrc file, which internally calls > cygpath to return windows style paths. This will return the windows > style paths on bash shell but this function is not available in > Makefile. > > - So, for Makefile, I have declared macro (makefile variable) and > using the cygpath to return windows style paths. But, this would > require changes in the Makefile i.e. to replace 'pwd' with ${PWD}. > > - In order to minimize any changes in the Makefile, I also tried > downloading the GNU coreutils for Windows port and replacing pwd.exe > (/usr/bin) with the pwd.exe from coreutils. In this case, if I do pwd, > then I still get POSIX paths, but if I call pwd.exe with absolute > path, then it returns windows style paths. I am not sure, why it is > not working when pwd is called without any path. > > Invocation of applications with .bat extension: > > Second main difference that is observed is that in Cygwin, you have to > call the application with extension if it is .bat. This works > seamlessly on MKS. > > Since, the software installation can't be changed to address this > problem, so far the workarounds are : > > - Create an alias, but again this won't work in Makefile > > - Create a softlink dynamically while running regressions (pre regression setup) > > - Create a file with the application name and call the .bat file. Keep > these new executable files in a accessible path. > > Queries: > > - Can someone please conform if the workarounds being used are OK. Is > there any better way of addressing these problems. Any patches for > both the problems? > > - Why is the pwd not working, when pwd is used from coreutils. > > Thanks in Advance, > Sarbjit > > -- > 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 > -- 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